Open Monograph Press
3.3.0
|
Protected Member Functions | |
getEndpoint () | |
getEndpoint () | |
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 Update Plan Request
You can update the information for an existing billing plan. The state of a plan must be active before a billing agreement is created.
Pass the billing plan id in the URI of a PATCH call, including the replace operation in the body. Other operations in the patch_request object will throw validation exceptions.
To create the billing plan, see the code example in RestCreatePlanRequest.
// Create a gateway for the PayPal REST Gateway // (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 ));
// Update the billing plan $transaction = $gateway->updatePlan(array( 'transactionReference' => $plan_id, 'state' => $gateway::BILLING_PLAN_STATE_ACTIVE, )); $response = $transaction->send(); if ($response->isSuccessful()) { echo "Update Plan transaction was successful!\n"; }
This is from the PayPal web site:
curl -v -k -X PATCH 'https://api.sandbox.paypal.com/v1/payments/billing-plans/P-94458432VR012762KRWBZEUA' \ -H "Content-Type: application/json" \ -H "Authorization: Bearer <Access-Token>" \ -d '[ { "path": "/", "value": { "state": "ACTIVE" }, "op": "replace" } ]'
Returns the HTTP status of 200 if the call is successful.
RestCreateSubscriptionRequest Omnipay PayPal REST Update Plan Request You can update the information for an existing billing plan. The state of a plan must be active before a billing agreement is created. autotoc_md106 Request Data Pass the billing plan id in the URI of a PATCH call, including the replace operation in the body. Other operations in the patch_request object will throw validation exceptions. autotoc_md107 Example To create the billing plan, see the code example in RestCreatePlanRequest. // Create a gateway for the PayPal REST Gateway // (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 )); // Update the billing plan $transaction = $gateway->updatePlan(array( 'transactionReference' => $plan_id, 'state' => $gateway::BILLING_PLAN_STATE_ACTIVE, )); $response = $transaction->send(); if ($response->isSuccessful()) { echo "Update Plan transaction was successful!\n"; }
autotoc_md108 Request Sample This is from the PayPal web site: curl -v -k -X PATCH 'https://api.sandbox.paypal.com/v1/payments/billing-plans/P-94458432VR012762KRWBZEUA' \ -H "Content-Type: application/json" \ -H "Authorization: Bearer <Access-Token>" \ -d '[ { "path": "/", "value": { "state": "ACTIVE" }, "op": "replace" } ]'
autotoc_md109 Response Returns the HTTP status of 200 if the call is successful. https://developer.paypal.com/docs/api/#update-a-plan RestCreateSubscriptionRequest Omnipay
Definition at line 74 of file lib/vendor/omnipay/paypal/src/Message/RestUpdatePlanRequest.php.
Omnipay\PayPal\Message\RestUpdatePlanRequest::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 97 of file lib/vendor/omnipay/paypal/src/Message/RestUpdatePlanRequest.php.
References Omnipay\PayPal\Message\RestUpdatePlanRequest\getState(), and Omnipay\Common\Message\AbstractRequest\validate().
Omnipay\PayPal\Message\RestUpdatePlanRequest::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 97 of file vendor/omnipay/paypal/src/Message/RestUpdatePlanRequest.php.
References Omnipay\PayPal\Message\RestUpdatePlanRequest\getState(), and Omnipay\Common\Message\AbstractRequest\validate().
|
protected |
Get transaction endpoint.
Billing plans are managed using the /billing-plans resource.
Reimplemented from Omnipay\PayPal\Message\AbstractRestRequest.
Definition at line 118 of file lib/vendor/omnipay/paypal/src/Message/RestUpdatePlanRequest.php.
References Omnipay\Common\Message\AbstractRequest\getTransactionReference().
|
protected |
Get transaction endpoint.
Billing plans are managed using the /billing-plans resource.
Reimplemented from Omnipay\PayPal\Message\AbstractRestRequest.
Definition at line 118 of file vendor/omnipay/paypal/src/Message/RestUpdatePlanRequest.php.
References Omnipay\Common\Message\AbstractRequest\getTransactionReference().
|
protected |
Get HTTP Method.
This is nearly always POST but can be over-ridden in sub classes.
Reimplemented from Omnipay\PayPal\Message\AbstractRestRequest.
Definition at line 123 of file vendor/omnipay/paypal/src/Message/RestUpdatePlanRequest.php.
|
protected |
Get HTTP Method.
This is nearly always POST but can be over-ridden in sub classes.
Reimplemented from Omnipay\PayPal\Message\AbstractRestRequest.
Definition at line 123 of file lib/vendor/omnipay/paypal/src/Message/RestUpdatePlanRequest.php.
Omnipay\PayPal\Message\RestUpdatePlanRequest::getState | ( | ) |
Get the plan state
Definition at line 81 of file vendor/omnipay/paypal/src/Message/RestUpdatePlanRequest.php.
References Omnipay\Common\Message\AbstractRequest\getParameter().
Omnipay\PayPal\Message\RestUpdatePlanRequest::getState | ( | ) |
Get the plan state
Definition at line 81 of file lib/vendor/omnipay/paypal/src/Message/RestUpdatePlanRequest.php.
References Omnipay\Common\Message\AbstractRequest\getParameter().
Referenced by Omnipay\PayPal\Message\RestUpdatePlanRequest\getData().
Omnipay\PayPal\Message\RestUpdatePlanRequest::setState | ( | $value | ) |
Set the plan state
string | $value |
Definition at line 92 of file lib/vendor/omnipay/paypal/src/Message/RestUpdatePlanRequest.php.
References Omnipay\Common\Message\AbstractRequest\setParameter().
Omnipay\PayPal\Message\RestUpdatePlanRequest::setState | ( | $value | ) |
Set the plan state
string | $value |
Definition at line 92 of file vendor/omnipay/paypal/src/Message/RestUpdatePlanRequest.php.
References Omnipay\Common\Message\AbstractRequest\setParameter().