Open Monograph Press  3.3.0
Omnipay\PayPal\Message\RestUpdatePlanRequest Class Reference
Inheritance diagram for Omnipay\PayPal\Message\RestUpdatePlanRequest:
Omnipay\PayPal\Message\AbstractRestRequest Omnipay\Common\Message\AbstractRequest Omnipay\Common\Message\RequestInterface Omnipay\Common\Message\MessageInterface

Public Member Functions

 getData ()
 
 getData ()
 
 getState ()
 
 getState ()
 
 setState ($value)
 
 setState ($value)
 
- Public Member Functions inherited from Omnipay\PayPal\Message\AbstractRestRequest
 getClientId ()
 
 getClientId ()
 
 getPayerId ()
 
 getPayerId ()
 
 getSecret ()
 
 getSecret ()
 
 getToken ()
 
 getToken ()
 
 sendData ($data)
 
 sendData ($data)
 
 setClientId ($value)
 
 setClientId ($value)
 
 setPayerId ($value)
 
 setPayerId ($value)
 
 setSecret ($value)
 
 setSecret ($value)
 
 setToken ($value)
 
 setToken ($value)
 
 toJSON ($data, $options=0)
 
 toJSON ($data, $options=0)
 
- Public Member Functions inherited from Omnipay\Common\Message\AbstractRequest
 __construct (ClientInterface $httpClient, HttpRequest $httpRequest)
 
 __construct (ClientInterface $httpClient, HttpRequest $httpRequest)
 
 formatCurrency ($amount)
 
 formatCurrency ($amount)
 
 getAmount ()
 
 getAmount ()
 
 getAmountInteger ()
 
 getAmountInteger ()
 
 getCancelUrl ()
 
 getCancelUrl ()
 
 getCard ()
 
 getCard ()
 
 getCardReference ()
 
 getCardReference ()
 
 getClientIp ()
 
 getClientIp ()
 
 getCurrency ()
 
 getCurrency ()
 
 getCurrencyDecimalPlaces ()
 
 getCurrencyDecimalPlaces ()
 
 getCurrencyNumeric ()
 
 getCurrencyNumeric ()
 
 getDescription ()
 
 getDescription ()
 
 getIssuer ()
 
 getIssuer ()
 
 getItems ()
 
 getItems ()
 
 getNotifyUrl ()
 
 getNotifyUrl ()
 
 getParameters ()
 
 getPaymentMethod ()
 
 getPaymentMethod ()
 
 getResponse ()
 
 getResponse ()
 
 getReturnUrl ()
 
 getReturnUrl ()
 
 getTestMode ()
 
 getTestMode ()
 
 getTransactionId ()
 
 getTransactionId ()
 
 getTransactionReference ()
 
 getTransactionReference ()
 
 initialize (array $parameters=array())
 
 initialize (array $parameters=array())
 
 send ()
 
 send ()
 
 setAmount ($value)
 
 setAmount ($value)
 
 setAmountInteger ($value)
 
 setCancelUrl ($value)
 
 setCancelUrl ($value)
 
 setCard ($value)
 
 setCard ($value)
 
 setCardReference ($value)
 
 setCardReference ($value)
 
 setClientIp ($value)
 
 setClientIp ($value)
 
 setCurrency ($value)
 
 setCurrency ($value)
 
 setDescription ($value)
 
 setDescription ($value)
 
 setIssuer ($value)
 
 setIssuer ($value)
 
 setItems ($items)
 
 setItems ($items)
 
 setMoney (Money $value)
 
 setNotifyUrl ($value)
 
 setNotifyUrl ($value)
 
 setPaymentMethod ($value)
 
 setPaymentMethod ($value)
 
 setReturnUrl ($value)
 
 setReturnUrl ($value)
 
 setTestMode ($value)
 
 setTestMode ($value)
 
 setTransactionId ($value)
 
 setTransactionId ($value)
 
 setTransactionReference ($value)
 
 setTransactionReference ($value)
 
 toFloat ($value)
 
 validate ()
 

Protected Member Functions

 getEndpoint ()
 
 getEndpoint ()
 
 getHttpMethod ()
 
 getHttpMethod ()
 
- Protected Member Functions inherited from Omnipay\PayPal\Message\AbstractRestRequest
 createResponse ($data, $statusCode)
 
 createResponse ($data, $statusCode)
 
- Protected Member Functions inherited from Omnipay\Common\Message\AbstractRequest
 getCurrencies ()
 
 getParameter ($key)
 
 setParameter ($key, $value)
 
 setParameter ($key, $value)
 

Additional Inherited Members

- Data Fields inherited from Omnipay\PayPal\Message\AbstractRestRequest
const API_VERSION = 'v1'
 
- Protected Attributes inherited from Omnipay\PayPal\Message\AbstractRestRequest
 $liveEndpoint = 'https://api.paypal.com'
 
 $payerId = null
 
 $testEndpoint = 'https://api.sandbox.paypal.com'
 
- Protected Attributes inherited from Omnipay\Common\Message\AbstractRequest
 $currencies
 
 $httpClient
 
 $httpRequest
 
 $negativeAmountAllowed = false
 
 $parameters
 
 $response
 
 $zeroAmountAllowed = true
 

Detailed Description

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.

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.

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"; }

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" } ]'

Response

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.

Member Function Documentation

◆ getData() [1/2]

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.

Returns
mixed

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().

◆ getData() [2/2]

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.

Returns
mixed

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().

◆ getEndpoint() [1/2]

Omnipay\PayPal\Message\RestUpdatePlanRequest::getEndpoint ( )
protected

Get transaction endpoint.

Billing plans are managed using the /billing-plans resource.

Returns
string

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().

◆ getEndpoint() [2/2]

Omnipay\PayPal\Message\RestUpdatePlanRequest::getEndpoint ( )
protected

Get transaction endpoint.

Billing plans are managed using the /billing-plans resource.

Returns
string

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().

◆ getHttpMethod() [1/2]

Omnipay\PayPal\Message\RestUpdatePlanRequest::getHttpMethod ( )
protected

Get HTTP Method.

This is nearly always POST but can be over-ridden in sub classes.

Returns
string

Reimplemented from Omnipay\PayPal\Message\AbstractRestRequest.

Definition at line 123 of file vendor/omnipay/paypal/src/Message/RestUpdatePlanRequest.php.

◆ getHttpMethod() [2/2]

Omnipay\PayPal\Message\RestUpdatePlanRequest::getHttpMethod ( )
protected

Get HTTP Method.

This is nearly always POST but can be over-ridden in sub classes.

Returns
string

Reimplemented from Omnipay\PayPal\Message\AbstractRestRequest.

Definition at line 123 of file lib/vendor/omnipay/paypal/src/Message/RestUpdatePlanRequest.php.

◆ getState() [1/2]

Omnipay\PayPal\Message\RestUpdatePlanRequest::getState ( )

Get the plan state

Returns
string

Definition at line 81 of file vendor/omnipay/paypal/src/Message/RestUpdatePlanRequest.php.

References Omnipay\Common\Message\AbstractRequest\getParameter().

◆ getState() [2/2]

Omnipay\PayPal\Message\RestUpdatePlanRequest::getState ( )

◆ setState() [1/2]

Omnipay\PayPal\Message\RestUpdatePlanRequest::setState (   $value)

Set the plan state

Parameters
string$value
Returns
RestUpdatePlanRequest provides a fluent interface.

Definition at line 92 of file lib/vendor/omnipay/paypal/src/Message/RestUpdatePlanRequest.php.

References Omnipay\Common\Message\AbstractRequest\setParameter().

◆ setState() [2/2]

Omnipay\PayPal\Message\RestUpdatePlanRequest::setState (   $value)

Set the plan state

Parameters
string$value
Returns
RestUpdatePlanRequest provides a fluent interface.

Definition at line 92 of file vendor/omnipay/paypal/src/Message/RestUpdatePlanRequest.php.

References Omnipay\Common\Message\AbstractRequest\setParameter().


The documentation for this class was generated from the following file: