forked from AssemblyPayments/promisepay-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f430717
commit 2cdab03
Showing
2 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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, | ||
|
@@ -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'); | ||
} | ||
|
||
} |