Open Journal Systems
3.3.0
|
Protected Member Functions | |
getEndpoint () | |
getEndpoint () | |
![]() | |
createResponse ($data, $statusCode) | |
createResponse ($data, $statusCode) | |
getHttpMethod () | |
getHttpMethod () | |
![]() | |
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 Reactivate Subscription Request
Use this call to reactivate an agreement.
Pass the agreement id in the URI of a POST call. Also include a description, which is the reason for reactivating the subscription.
To create the agreement, see the code example in RestCreateSubscriptionRequest.
// 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 ));
// Do a reactivate subscription transaction on the gateway $transaction = $gateway->reactivateSubscription(array( 'transactionReference' => $subscription_id, 'description' => "Reactivating the agreement.", )); $response = $transaction->send(); if ($response->isSuccessful()) { echo "Reactivate Subscription transaction was successful!\n"; }
Note that the subscription_id that you get from calling the response's getTransactionReference() method at the end of the completeSubscription call will be different to the one that you got after calling the response's getTransactionReference() method at the end of the createSubscription call. The one that you get from completeSubscription is the correct one to use going forwards (e.g. for cancelling or updating the subscription).
This is from the PayPal web site:
curl -v POST https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-0LN988D3JACS/re-activate \ -H 'Content-Type:application/json' \ -H 'Authorization: Bearer <Access-Token>' \ -d '{ "note": "Reactivating the agreement." }'
RestCreateSubscriptionRequest Omnipay PayPal REST Reactivate Subscription Request Use this call to reactivate an agreement. autotoc_md104 Request Data Pass the agreement id in the URI of a POST call. Also include a description, which is the reason for reactivating the subscription. autotoc_md105 Example To create the agreement, see the code example in RestCreateSubscriptionRequest. // 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 )); // Do a reactivate subscription transaction on the gateway $transaction = $gateway->reactivateSubscription(array( 'transactionReference' => $subscription_id, 'description' => "Reactivating the agreement.", )); $response = $transaction->send(); if ($response->isSuccessful()) { echo "Reactivate Subscription transaction was successful!\n"; }
Note that the subscription_id that you get from calling the response's getTransactionReference() method at the end of the completeSubscription call will be different to the one that you got after calling the response's getTransactionReference() method at the end of the createSubscription call. The one that you get from completeSubscription is the correct one to use going forwards (e.g. for cancelling or updating the subscription). autotoc_md106 Request Sample This is from the PayPal web site: curl -v POST https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-0LN988D3JACS/re-activate \ -H 'Content-Type:application/json' \ -H 'Authorization: Bearer <Access-Token>' \ -d '{ "note": "Reactivating the agreement." }'
https://developer.paypal.com/docs/api/#reactivate-an-agreement RestCreateSubscriptionRequest Omnipay
Definition at line 69 of file lib/vendor/omnipay/paypal/src/Message/RestReactivateSubscriptionRequest.php.
Omnipay\PayPal\Message\RestReactivateSubscriptionRequest::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 71 of file lib/vendor/omnipay/paypal/src/Message/RestReactivateSubscriptionRequest.php.
References Omnipay\Common\Message\AbstractRequest\getDescription(), and Omnipay\Common\Message\AbstractRequest\validate().
Omnipay\PayPal\Message\RestReactivateSubscriptionRequest::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 71 of file vendor/omnipay/paypal/src/Message/RestReactivateSubscriptionRequest.php.
References Omnipay\Common\Message\AbstractRequest\getDescription(), and Omnipay\Common\Message\AbstractRequest\validate().
|
protected |
Get transaction endpoint.
Subscriptions are executed using the /billing-agreements resource.
Reimplemented from Omnipay\PayPal\Message\AbstractRestRequest.
Definition at line 88 of file vendor/omnipay/paypal/src/Message/RestReactivateSubscriptionRequest.php.
References Omnipay\Common\Message\AbstractRequest\getTransactionReference().
|
protected |
Get transaction endpoint.
Subscriptions are executed using the /billing-agreements resource.
Reimplemented from Omnipay\PayPal\Message\AbstractRestRequest.
Definition at line 88 of file lib/vendor/omnipay/paypal/src/Message/RestReactivateSubscriptionRequest.php.
References Omnipay\Common\Message\AbstractRequest\getTransactionReference().