forked from LiveCarta/PayPal-PHP-SDK
Enabled Billing Plans and Agreements APIs
- Added API Classes, Samples, and Tests - Updated Functional Tests - Updated Documentation with new SDK Name - Updated Few Samples to use newer nicer result page
This commit is contained in:
25
sample/billing/GetPlan.php
Normal file
25
sample/billing/GetPlan.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
// # Get Plan Sample
|
||||
//
|
||||
// This sample code demonstrate how you can get a billing plan, as documented here at:
|
||||
// https://developer.paypal.com/webapps/developer/docs/api/#retrieve-a-plan
|
||||
// API used: /v1/payments/billing-plans
|
||||
|
||||
// Retrieving the Plan object from Create Plan Sample
|
||||
/** @var Plan $createdPlan */
|
||||
$createdPlan = require 'CreatePlan.php';
|
||||
|
||||
use PayPal\Api\Plan;
|
||||
|
||||
try {
|
||||
$plan = Plan::get($createdPlan->getId(), $apiContext);
|
||||
} catch (PayPal\Exception\PPConnectionException $ex) {
|
||||
echo "Exception: " . $ex->getMessage() . PHP_EOL;
|
||||
var_dump($ex->getData());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ResultPrinter::printResult("Retrieved a Plan", "Plan", $plan->getId(), null, $plan);
|
||||
|
||||
return $plan;
|
||||
Reference in New Issue
Block a user