|
Open Journal Systems
3.3.0
|
Protected Member Functions | |
| getEndpoint () | |
| getEndpoint () | |
Protected Member Functions inherited from Omnipay\PayPal\Message\AbstractRestRequest | |
| createResponse ($data, $statusCode) | |
| createResponse ($data, $statusCode) | |
| getHttpMethod () | |
| getHttpMethod () | |
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 | |
PayPal REST Create Card Request
PayPal offers merchants a /vault API to store sensitive details like credit card related details.
You can currently use the /vault API to store credit card details with PayPal instead of storing them on your own server. After storing a credit card, you can then pass the credit card id instead of the related credit card details to complete a payment.
Direct credit card payment and related features are restricted in some countries. As of January 2015 these transactions are only supported in the UK and in the USA.
Example:
// 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 ));
// Create a credit card object // DO NOT USE THESE CARD VALUES – substitute your own // see the documentation in the class header. $card = new CreditCard(array( 'firstName' => 'Example', 'lastName' => 'User', 'number' => '4111111111111111', 'expiryMonth' => '01', 'expiryYear' => '2020', 'cvv' => '123', 'billingAddress1' => '1 Scrubby Creek Road', 'billingCountry' => 'AU', 'billingCity' => 'Scrubby Creek', 'billingPostcode' => '4999', 'billingState' => 'QLD', ));
// Do a create card transaction on the gateway $transaction = $gateway->createCard(array( 'card' => $card, )); $response = $transaction->send(); if ($response->isSuccessful()) { echo "Create card transaction was successful!\n"; // Find the card ID $card_id = $response->getTransactionReference(); }
https://developer.paypal.com/docs/api/#store-a-credit-card http://bit.ly/1wUQ33R
Definition at line 71 of file lib/vendor/omnipay/paypal/src/Message/RestCreateCardRequest.php.
| Omnipay\PayPal\Message\RestCreateCardRequest::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 73 of file lib/vendor/omnipay/paypal/src/Message/RestCreateCardRequest.php.
References Omnipay\Common\Message\AbstractRequest\getCard(), and Omnipay\Common\Message\AbstractRequest\validate().
| Omnipay\PayPal\Message\RestCreateCardRequest::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 73 of file vendor/omnipay/paypal/src/Message/RestCreateCardRequest.php.
References Omnipay\Common\Message\AbstractRequest\getCard(), and Omnipay\Common\Message\AbstractRequest\validate().
|
protected |
Reimplemented from Omnipay\PayPal\Message\AbstractRestRequest.
Definition at line 106 of file vendor/omnipay/paypal/src/Message/RestCreateCardRequest.php.
|
protected |
Reimplemented from Omnipay\PayPal\Message\AbstractRestRequest.
Definition at line 106 of file lib/vendor/omnipay/paypal/src/Message/RestCreateCardRequest.php.