PHPackages                             smartcoin/smartcoin-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. smartcoin/smartcoin-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

smartcoin/smartcoin-php
=======================

smartcoin php library

0.3.6(11y ago)436MITPHPPHP &gt;=5.4

Since Feb 22Pushed 11y ago3 watchersCompare

[ Source](https://github.com/smartcoinpayments/smartcoin-php)[ Packagist](https://packagist.org/packages/smartcoin/smartcoin-php)[ RSS](/packages/smartcoin-smartcoin-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (11)Used By (0)

[![Build Status](https://camo.githubusercontent.com/b4201469da39b56c8ff80a76cdd2e1eeee5df44bd263dee6a4b43f343eaed98d/68747470733a2f2f7472617669732d63692e6f72672f736d617274636f696e7061796d656e74732f736d617274636f696e2d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/smartcoinpayments/smartcoin-php)[![Latest Stable Version](https://camo.githubusercontent.com/a80f26080a73e6d75eafcd2abd2f2bb7a6fddc8be2a43340214fe19c9ee36798/68747470733a2f2f706f7365722e707567782e6f72672f736d617274636f696e2f736d617274636f696e2d7068702f762f737461626c652e737667)](https://packagist.org/packages/smartcoin/smartcoin-php)[![License](https://camo.githubusercontent.com/b305f2d1d4ada143f8f51259b02d1b79c82b20df21ab2fce70ad4e2387d0ac56/68747470733a2f2f706f7365722e707567782e6f72672f736d617274636f696e2f736d617274636f696e2d7068702f6c6963656e73652e737667)](https://packagist.org/packages/smartcoin/smartcoin-php)

Crie sua conta na [Smartcoin](https://smartcoin.com.br/).

Vamos fazer
===========

[](#vamos-fazer)

Exemplo de uso:

```
\Smartcoin\Smartcoin::api_key('pk_test_407d1f51a61756');
\Smartcoin\Smartcoin::api_secret('sk_test_86e4486a0078b2');

//Credit Card Charge without token as card param
try {
  $charge = \Smartcoin\Charge::create(array(
    'amount' => 100,
    'currency' => 'brl',
    'card' => array(
      'number' => '4242424242424242',
      'exp_month' => 10,
      'exp_year' => 15,
      'cvc' => '083'
    ),
    'description' => 'Smartcoin charge test for example@test.com'
  ));
  echo $charge->to_json();
}catch(\Smartcoin\Error $e){
  echo json_encode($e->get_json_body());
}

//Credit Card Charge with token as card param
try {
  $charge = \Smartcoin\Charge::create(array(
    'amount' => 100,
    'currency' => 'brl',
    'card' => 'tok_434343434343434343434',
    'description' => 'Smartcoin charge test for example@test.com'
  ));
  echo $charge->to_json();
}catch(\Smartcoin\Error $e){
  echo json_encode($e->get_json_body());
}

//Bank Slip Charge
try {
  $charge = \Smartcoin\Charge::create(array(
    'amount' => 1000,
    'currency' => 'brl',
    'type' => 'bank_slip'
  ));
  echo $charge->to_json();
}catch(\Smartcoin\Error $e){
  echo json_encode($e->get_json_body());
}

//Create Subscription
try {
  $customer = \Smartcoin\Customer::create(array(
    'email' => 'test@examplo.com',
    "card" => array('number' => 5454545454545454,
                    'exp_month' => 11,
                    'exp_year' => 2017,
                    'cvc' => 111,
                    'name' => 'Doctor Who')
      ));

  $sub = $customer->subscriptions()->create(array(
    'plan' => 'silver'
  ));
  echo $sub->to_json();
}catch(\Smartcoin\Error $e){
  echo json_encode($e->get_json_body());
}
```

Veja os [testes](https://github.com/smartcoinpayments/smartcoin-php/blob/master/test/Smartcoin/ChargeTest.php) para mais exemplos.

Teste
=====

[](#teste)

Para instalar a suite de teste, execute o [SimpleTest](https://packagist.org/packages/simpletest/simpletest) via [Composer](https://getcomposer.org/):

```
composer update --dev

```

Para executar o teste:

```
php ./test/Smartcoin.php

```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~50 days

Recently: every ~37 days

Total

10

Last Release

4061d ago

PHP version history (2 changes)0.0.1PHP &gt;=5.3

0.3.4PHP &gt;=5.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5116675?v=4)[smartcoin](/maintainers/smartcoin)[@SmartCoin](https://github.com/SmartCoin)

---

Top Contributors

[![agranado2k](https://avatars.githubusercontent.com/u/838518?v=4)](https://github.com/agranado2k "agranado2k (86 commits)")[![moniquelive](https://avatars.githubusercontent.com/u/70070?v=4)](https://github.com/moniquelive "moniquelive (17 commits)")

### Embed Badge

![Health badge](/badges/smartcoin-smartcoin-php/health.svg)

```
[![Health](https://phpackages.com/badges/smartcoin-smartcoin-php/health.svg)](https://phpackages.com/packages/smartcoin-smartcoin-php)
```

###  Alternatives

[symfony/runtime

Enables decoupling PHP applications from global state

74798.8M1.0k](/packages/symfony-runtime)[haruncpi/laravel-user-activity

Monitor user activity easily!

425183.9k2](/packages/haruncpi-laravel-user-activity)[mattwright/urlresolver

PHP class that attempts to resolve URLs to a final, canonical link.

66183.6k](/packages/mattwright-urlresolver)[nyu8/flarum-email-filter

Filter emails registering your Flarum site with whitelist, blacklist and even regular expressions.

102.3k](/packages/nyu8-flarum-email-filter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
