-
Notifications
You must be signed in to change notification settings - Fork 7
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
Manuel HUEZ
authored and
Manuel HUEZ
committed
Nov 17, 2016
1 parent
3d7f1d7
commit 7f68d6e
Showing
32 changed files
with
1,707 additions
and
1,547 deletions.
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
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
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
include_once(dirname(__FILE__) . "/src/ProcessOut.php"); | ||
|
||
include_once(dirname(__FILE__) . "/src/Exceptions/AuthenticationException.php"); | ||
include_once(dirname(__FILE__) . "/src/Exceptions/GenericException.php"); | ||
include_once(dirname(__FILE__) . "/src/Exceptions/InternalException.php"); | ||
include_once(dirname(__FILE__) . "/src/Exceptions/NotFoundException.php"); | ||
include_once(dirname(__FILE__) . "/src/Exceptions/ValidationException.php"); | ||
|
||
include_once(dirname(__FILE__) . "/src/Networking/Request.php"); | ||
include_once(dirname(__FILE__) . "/src/Networking/Response.php"); | ||
|
||
include_once(dirname(__FILE__) . "/src/Activity.php"); | ||
include_once(dirname(__FILE__) . "/src/AuthorizationRequest.php"); | ||
include_once(dirname(__FILE__) . "/src/Card.php"); | ||
include_once(dirname(__FILE__) . "/src/Coupon.php"); | ||
include_once(dirname(__FILE__) . "/src/Customer.php"); | ||
include_once(dirname(__FILE__) . "/src/Token.php"); | ||
include_once(dirname(__FILE__) . "/src/Discount.php"); | ||
include_once(dirname(__FILE__) . "/src/Event.php"); | ||
include_once(dirname(__FILE__) . "/src/Gateway.php"); | ||
include_once(dirname(__FILE__) . "/src/GatewayConfiguration.php"); | ||
include_once(dirname(__FILE__) . "/src/Invoice.php"); | ||
include_once(dirname(__FILE__) . "/src/CustomerAction.php"); | ||
include_once(dirname(__FILE__) . "/src/Plan.php"); | ||
include_once(dirname(__FILE__) . "/src/Product.php"); | ||
include_once(dirname(__FILE__) . "/src/Project.php"); | ||
include_once(dirname(__FILE__) . "/src/Refund.php"); | ||
include_once(dirname(__FILE__) . "/src/Subscription.php"); | ||
include_once(dirname(__FILE__) . "/src/Transaction.php"); | ||
include_once(dirname(__FILE__) . "/src/Webhook.php"); | ||
|
||
include_once(dirname(__FILE__) . "/src/GatewayRequest.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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
include 'init.php'; | ||
|
||
$client = new \ProcessOut\ProcessOut('proj_gAO1Uu0ysZJvDuUpOGPkUBeE3pGalk3x', | ||
'key_fBjPvkgT8gyKc1SUpy0PfjL7UgsRmUug'); | ||
|
||
// Create and fetch a new invoice | ||
$invoice = $client->newInvoice(array( | ||
'name' => 'Test invoice', | ||
'amount' => '9.99', | ||
'currency' => 'USD' | ||
))->create(); | ||
|
||
assert(!empty($invoice->getId()), 'The invoice ID should not be empty'); | ||
|
||
$fetched = $client->newInvoice()->find($invoice->getId()); | ||
assert(!empty($fetched->getId()), 'The fetched invoice ID should not be empty'); | ||
assert($invoice->getId() == $fetched->getId(), 'The invoices ID should be equal'); | ||
|
||
// Fetch the customers | ||
$customers = $client->newCustomer()->all(); | ||
|
||
// Create a subscription for a customer | ||
$customer = $client->newCustomer()->create(); | ||
assert(!empty($customer->getId()), 'The created customer ID should not be empty'); | ||
|
||
$subscription = $client->newSubscription(array( | ||
'amount' => '9.99', | ||
'currency' => 'USD', | ||
'interval' => '1d', | ||
'name' => 'great subscription' | ||
))->create($customer->getId()); | ||
assert(!empty($subscription->getId()), 'The created subscription ID should not be empty'); |
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
Oops, something went wrong.