Skip to content

Commit

Permalink
Charges README Examples
Browse files Browse the repository at this point in the history
  • Loading branch information
NinoSkopac committed Jun 10, 2016
1 parent f430717 commit 2cdab03
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,39 @@ $account = PromisePay::PayPalAccount()->delete('PAYPAL_ACCOUNT_ID');
$user = PromisePay::PayPalAccount()->getUser('PAYPAL_ACCOUNT_ID');
```

##Charges
#####Create Charge
```php
$createCharge = PromisePay::Charges()->create(
array
(
'account_id' => 'CARD_OR_BANK_ACCOUNT_ID',
'amount' => 100,
'email' => '[email protected]',
'zip' => 90210,
'country' => 'AUS',
'device_id' => 'DEVICE_ID',
'ip_address' => '49.229.186.182'
)
);
```
#####List Charges
```php
$getList = PromisePay::Charges()->getList();
```
#####Show Charge
```php
$charge = PromisePay::Charges()->show('CHARGE_ID');
```
#####Show Charge Buyer
```php
$buyer = PromisePay::Charges()->showBuyer('CHARGE_ID');
```
#####Show Charge Status
```php
$status = PromisePay::Charges()->showStatus('CHARGE_ID');
```

##Token Auth
#####Generate Card Token
```php
Expand Down
31 changes: 30 additions & 1 deletion tests/ChargesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ class ChargesTest extends \PHPUnit_Framework_TestCase {
$userData;

protected function setUp() {
$this->chargeData = array(
$this->chargeData = array
(
'account_id' => null,
'amount' => 100,
'email' => null,
Expand Down Expand Up @@ -162,4 +163,32 @@ public function testShowStatus() {
$this->assertEquals($status['id'], $charge['id']);
}

private function readmeExamples() {
// CREATE
$createCharge = PromisePay::Charges()->create(
array
(
'account_id' => 'CARD_OR_BANK_ACCOUNT_ID',
'amount' => 100,
'email' => '[email protected]',
'zip' => 90210,
'country' => 'AUS',
'device_id' => 'DEVICE_ID',
'ip_address' => '49.229.186.182'
)
);

// GET LIST
$getList = PromisePay::Charges()->getList();

// SHOW CHARGE
$charge = PromisePay::Charges()->show('CHARGE_ID');

// SHOW BUYER
$buyer = PromisePay::Charges()->showBuyer('CHARGE_ID');

// SHOW STATUS
$status = PromisePay::Charges()->showStatus('CHARGE_ID');
}

}

0 comments on commit 2cdab03

Please sign in to comment.