2017 © Pedro Peláez
 

library smartcoin-php

smartcoin php library

image

smartcoin/smartcoin-php

smartcoin php library

  • Wednesday, May 27, 2015
  • by smartcoin
  • Repository
  • 3 Watchers
  • 4 Stars
  • 32 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

Build Status Latest Stable Version License, (*1)

Crie sua conta na Smartcoin., (*2)

Vamos fazer

Exemplo de uso:, (*3)

\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 para mais exemplos., (*4)

Teste

Para instalar a suite de teste, execute o SimpleTest via Composer:, (*5)

composer update --dev

Para executar o teste:, (*6)

php ./test/Smartcoin.php

The Versions

27/05 2015

dev-master

9999999-dev

smartcoin php library

  Sources   Download

MIT

The Requires

  • ext-curl *
  • ext-json *
  • php >=5.4

 

The Development Requires

by agranado

20/05 2015

0.3.6

0.3.6.0

smartcoin php library

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *

 

The Development Requires

by agranado

17/03 2015

0.3.5

0.3.5.0

smartcoin php library

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *

 

The Development Requires

by agranado

31/01 2015

0.3.4

0.3.4.0

smartcoin php library

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *

 

The Development Requires

by agranado

22/12 2014

0.3.3

0.3.3.0

smartcoin php library

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-curl *
  • ext-json *

 

The Development Requires

by agranado

21/12 2014

0.3.2

0.3.2.0

smartcoin php library

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-curl *
  • ext-json *

 

The Development Requires

by agranado

19/12 2014

0.3.0

0.3.0.0

smartcoin php library

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-curl *
  • ext-json *

 

The Development Requires

by agranado

15/12 2014

0.2.0

0.2.0.0

smartcoin php library

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-curl *
  • ext-json *

 

The Development Requires

by agranado

17/08 2014

0.1.8

0.1.8.0

smartcoin php library

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-curl *
  • ext-json *

 

The Development Requires

by agranado

06/06 2014

0.1.6

0.1.6.0

Navaska PHP library

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-curl *
  • ext-json *

 

The Development Requires

by agranado

22/02 2014

0.0.1

0.0.1.0

Navaska PHP library

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-curl *
  • ext-json *

 

The Development Requires

by agranado