Open Journal Systems
3.3.0
|
Protected Member Functions | |
getHttpMethod () | |
getHttpMethod () | |
![]() | |
createResponse ($data, $statusCode) | |
createResponse ($data, $statusCode) | |
![]() | |
getCurrencies () | |
getParameter ($key) | |
setParameter ($key, $value) | |
setParameter ($key, $value) | |
Additional Inherited Members | |
![]() | |
const | API_VERSION = 'v1' |
![]() | |
$liveEndpoint = 'https://api.paypal.com' | |
$payerId = null | |
$testEndpoint = 'https://api.sandbox.paypal.com' | |
![]() | |
$currencies | |
$httpClient | |
$httpRequest | |
$negativeAmountAllowed = false | |
$parameters | |
$response | |
$zeroAmountAllowed = true | |
PayPal REST List Plans Request
Use this call to get a list of plans in any state (CREATED, ACTIVE, etc.). The plans returned are the plans made by the merchant making the call.
// Create a gateway for the PayPal RestGateway // (routes to GatewayFactory::create) $gateway = Omnipay::create('PayPal_Rest');
// Initialise the gateway $gateway->initialize(array( 'clientId' => 'MyPayPalClientId', 'secret' => 'MyPayPalSecret', 'testMode' => true, // Or false when you are ready for live transactions ));
// List all billing plans $transaction = $gateway->listPlan([ 'state' => CREATED, ]); $response = $transaction->send(); $data = $response->getData(); echo "Gateway listPlan response data == " . print_r($data, true) . "\n";
This is from the PayPal web site:
curl -v -X GET https://api.sandbox.paypal.com/v1/payments/billing-plans?page_size=3&status=ACTIVE&page=1\ -H "Content-Type:application/json" \ -H "Authorization: Bearer Access-Token"
This is from the PayPal web site:
{ "total_items": "166", "total_pages": "83", "plans": [ { "id": "P-7DC96732KA7763723UOPKETA", "state": "ACTIVE", "name": "Plan with Regular and Trial Payment Definitions", "description": "Plan with regular and trial billing payment definitions.", "type": "FIXED", "create_time": "2017-08-22T04:41:52.836Z", "update_time": "2017-08-22T04:41:53.169Z", "links": [ { "href": "https://api.sandbox.paypal.com//v1/payments/billing-plans/P-7DC96732KA7763723UOPKETA", "rel": "self", "method": "GET" } ] }, { "id": "P-1TV69435N82273154UPWDU4I", "state": "ACTIVE", "name": "Plan with Regular Payment Definition", "description": "Plan with one regular payment definition, minimal merchant preferences, and no shipping fee", "type": "INFINITE", "create_time": "2017-08-22T04:41:55.623Z", "update_time": "2017-08-22T04:41:56.055Z", "links": [ { "href": "https://api.sandbox.paypal.com//v1/payments/billing-plans/P-1TV69435N82273154UPWDU4I", "rel": "self", "method": "GET" } ] } ], "links": [ { "href": "https://api.sandbox.paypal.com/v1/payments/billing-plans?page_size=2&page=1&start=3&status=active", "rel": "start", "method": "GET" }, { "href": "https://api.sandbox.paypal.com/v1/payments/billing-plans?page_size=2&page=0&status=active", "rel": "previous_page", "method": "GET" }, { "href": "https://api.sandbox.paypal.com/v1/payments/billing-plans?page_size=2&page=2&status=active", "rel": "next_page", "method": "GET" }, { "href": "https://api.sandbox.paypal.com/v1/payments/billing-plans?page_size=2&page=82&status=active", "rel": "last", "method": "GET" } ] }
PayPal REST List Plans Request Use this call to get a list of plans in any state (CREATED, ACTIVE, etc.). The plans returned are the plans made by the merchant making the call. autotoc_md91 Example autotoc_md92 Initialize Gateway // Create a gateway for the PayPal RestGateway // (routes to GatewayFactory::create) $gateway = Omnipay::create('PayPal_Rest'); // Initialise the gateway $gateway->initialize(array( 'clientId' => 'MyPayPalClientId', 'secret' => 'MyPayPalSecret', 'testMode' => true, // Or false when you are ready for live transactions ));
autotoc_md93 List all plans that have state CREATED // List all billing plans $transaction = $gateway->listPlan([ 'state' => CREATED, ]); $response = $transaction->send(); $data = $response->getData(); echo "Gateway listPlan response data == " . print_r($data, true) . "\n";
autotoc_md94 Request Sample This is from the PayPal web site: curl -v -X GET https://api.sandbox.paypal.com/v1/payments/billing-plans?page_size=3&status=ACTIVE&page=1\ -H "Content-Type:application/json" \ -H "Authorization: Bearer Access-Token"
autotoc_md95 Response Sample This is from the PayPal web site: { "total_items": "166", "total_pages": "83", "plans": [ { "id": "P-7DC96732KA7763723UOPKETA", "state": "ACTIVE", "name": "Plan with Regular and Trial Payment Definitions", "description": "Plan with regular and trial billing payment definitions.", "type": "FIXED", "create_time": "2017-08-22T04:41:52.836Z", "update_time": "2017-08-22T04:41:53.169Z", "links": [ { "href": "https://api.sandbox.paypal.com//v1/payments/billing-plans/P-7DC96732KA7763723UOPKETA", "rel": "self", "method": "GET" } ] }, { "id": "P-1TV69435N82273154UPWDU4I", "state": "ACTIVE", "name": "Plan with Regular Payment Definition", "description": "Plan with one regular payment definition, minimal merchant preferences, and no shipping fee", "type": "INFINITE", "create_time": "2017-08-22T04:41:55.623Z", "update_time": "2017-08-22T04:41:56.055Z", "links": [ { "href": "https://api.sandbox.paypal.com//v1/payments/billing-plans/P-1TV69435N82273154UPWDU4I", "rel": "self", "method": "GET" } ] } ], "links": [ { "href": "https://api.sandbox.paypal.com/v1/payments/billing-plans?page_size=2&page=1&start=3&status=active", "rel": "start", "method": "GET" }, { "href": "https://api.sandbox.paypal.com/v1/payments/billing-plans?page_size=2&page=0&status=active", "rel": "previous_page", "method": "GET" }, { "href": "https://api.sandbox.paypal.com/v1/payments/billing-plans?page_size=2&page=2&status=active", "rel": "next_page", "method": "GET" }, { "href": "https://api.sandbox.paypal.com/v1/payments/billing-plans?page_size=2&page=82&status=active", "rel": "last", "method": "GET" } ] }
https://developer.paypal.com/docs/api/payments.billing-plans#plan_list
Definition at line 124 of file lib/vendor/omnipay/paypal/src/Message/RestListPlanRequest.php.
Omnipay\PayPal\Message\RestListPlanRequest::getData | ( | ) |
Get the raw data array for this message. The format of this varies from gateway to gateway, but will usually be either an associative array, or a SimpleXMLElement.
Implements Omnipay\Common\Message\MessageInterface.
Definition at line 216 of file lib/vendor/omnipay/paypal/src/Message/RestListPlanRequest.php.
References Omnipay\PayPal\Message\RestListPlanRequest\getPage(), Omnipay\PayPal\Message\RestListPlanRequest\getPageSize(), Omnipay\PayPal\Message\RestListPlanRequest\getStatus(), and Omnipay\PayPal\Message\RestListPlanRequest\getTotalRequired().
Omnipay\PayPal\Message\RestListPlanRequest::getData | ( | ) |
Get the raw data array for this message. The format of this varies from gateway to gateway, but will usually be either an associative array, or a SimpleXMLElement.
Implements Omnipay\Common\Message\MessageInterface.
Definition at line 216 of file vendor/omnipay/paypal/src/Message/RestListPlanRequest.php.
References Omnipay\PayPal\Message\RestListPlanRequest\getPage(), Omnipay\PayPal\Message\RestListPlanRequest\getPageSize(), Omnipay\PayPal\Message\RestListPlanRequest\getStatus(), and Omnipay\PayPal\Message\RestListPlanRequest\getTotalRequired().
Omnipay\PayPal\Message\RestListPlanRequest::getEndpoint | ( | ) |
Reimplemented from Omnipay\PayPal\Message\AbstractRestRequest.
Definition at line 238 of file lib/vendor/omnipay/paypal/src/Message/RestListPlanRequest.php.
Omnipay\PayPal\Message\RestListPlanRequest::getEndpoint | ( | ) |
Reimplemented from Omnipay\PayPal\Message\AbstractRestRequest.
Definition at line 238 of file vendor/omnipay/paypal/src/Message/RestListPlanRequest.php.
|
protected |
Get HTTP Method.
The HTTP method for list plans requests must be GET.
Reimplemented from Omnipay\PayPal\Message\AbstractRestRequest.
Definition at line 233 of file vendor/omnipay/paypal/src/Message/RestListPlanRequest.php.
|
protected |
Get HTTP Method.
The HTTP method for list plans requests must be GET.
Reimplemented from Omnipay\PayPal\Message\AbstractRestRequest.
Definition at line 233 of file lib/vendor/omnipay/paypal/src/Message/RestListPlanRequest.php.
Omnipay\PayPal\Message\RestListPlanRequest::getPage | ( | ) |
Get the request page
Definition at line 133 of file lib/vendor/omnipay/paypal/src/Message/RestListPlanRequest.php.
References Omnipay\Common\Message\AbstractRequest\getParameter().
Referenced by Omnipay\PayPal\Message\RestListPlanRequest\getData().
Omnipay\PayPal\Message\RestListPlanRequest::getPage | ( | ) |
Get the request page
Definition at line 133 of file vendor/omnipay/paypal/src/Message/RestListPlanRequest.php.
References Omnipay\Common\Message\AbstractRequest\getParameter().
Omnipay\PayPal\Message\RestListPlanRequest::getPageSize | ( | ) |
Get the request page size
Definition at line 176 of file lib/vendor/omnipay/paypal/src/Message/RestListPlanRequest.php.
References Omnipay\Common\Message\AbstractRequest\getParameter().
Referenced by Omnipay\PayPal\Message\RestListPlanRequest\getData().
Omnipay\PayPal\Message\RestListPlanRequest::getPageSize | ( | ) |
Get the request page size
Definition at line 176 of file vendor/omnipay/paypal/src/Message/RestListPlanRequest.php.
References Omnipay\Common\Message\AbstractRequest\getParameter().
Omnipay\PayPal\Message\RestListPlanRequest::getStatus | ( | ) |
Get the request status
Definition at line 155 of file lib/vendor/omnipay/paypal/src/Message/RestListPlanRequest.php.
References Omnipay\Common\Message\AbstractRequest\getParameter().
Referenced by Omnipay\PayPal\Message\RestListPlanRequest\getData().
Omnipay\PayPal\Message\RestListPlanRequest::getStatus | ( | ) |
Get the request status
Definition at line 155 of file vendor/omnipay/paypal/src/Message/RestListPlanRequest.php.
References Omnipay\Common\Message\AbstractRequest\getParameter().
Omnipay\PayPal\Message\RestListPlanRequest::getTotalRequired | ( | ) |
Get the request total required
Definition at line 197 of file lib/vendor/omnipay/paypal/src/Message/RestListPlanRequest.php.
References Omnipay\Common\Message\AbstractRequest\getParameter().
Referenced by Omnipay\PayPal\Message\RestListPlanRequest\getData().
Omnipay\PayPal\Message\RestListPlanRequest::getTotalRequired | ( | ) |
Get the request total required
Definition at line 197 of file vendor/omnipay/paypal/src/Message/RestListPlanRequest.php.
References Omnipay\Common\Message\AbstractRequest\getParameter().
Omnipay\PayPal\Message\RestListPlanRequest::setPage | ( | $value | ) |
Set the request page
integer | $value |
Definition at line 145 of file lib/vendor/omnipay/paypal/src/Message/RestListPlanRequest.php.
References Omnipay\Common\Message\AbstractRequest\setParameter().
Omnipay\PayPal\Message\RestListPlanRequest::setPage | ( | $value | ) |
Set the request page
integer | $value |
Definition at line 145 of file vendor/omnipay/paypal/src/Message/RestListPlanRequest.php.
References Omnipay\Common\Message\AbstractRequest\setParameter().
Omnipay\PayPal\Message\RestListPlanRequest::setPageSize | ( | $value | ) |
Set the request page size
string | $value |
Definition at line 187 of file vendor/omnipay/paypal/src/Message/RestListPlanRequest.php.
References Omnipay\Common\Message\AbstractRequest\setParameter().
Omnipay\PayPal\Message\RestListPlanRequest::setPageSize | ( | $value | ) |
Set the request page size
string | $value |
Definition at line 187 of file lib/vendor/omnipay/paypal/src/Message/RestListPlanRequest.php.
References Omnipay\Common\Message\AbstractRequest\setParameter().
Omnipay\PayPal\Message\RestListPlanRequest::setStatus | ( | $value | ) |
Set the request status
string | $value |
Definition at line 166 of file lib/vendor/omnipay/paypal/src/Message/RestListPlanRequest.php.
References Omnipay\Common\Message\AbstractRequest\setParameter().
Omnipay\PayPal\Message\RestListPlanRequest::setStatus | ( | $value | ) |
Set the request status
string | $value |
Definition at line 166 of file vendor/omnipay/paypal/src/Message/RestListPlanRequest.php.
References Omnipay\Common\Message\AbstractRequest\setParameter().
Omnipay\PayPal\Message\RestListPlanRequest::setTotalRequired | ( | $value | ) |
Set the request total required
string | $value |
Definition at line 208 of file vendor/omnipay/paypal/src/Message/RestListPlanRequest.php.
References Omnipay\Common\Message\AbstractRequest\setParameter().
Omnipay\PayPal\Message\RestListPlanRequest::setTotalRequired | ( | $value | ) |
Set the request total required
string | $value |
Definition at line 208 of file lib/vendor/omnipay/paypal/src/Message/RestListPlanRequest.php.
References Omnipay\Common\Message\AbstractRequest\setParameter().