Open Journal Systems
3.3.0
|
Additional Inherited Members | |
![]() | |
const | API_VERSION = 'v1' |
![]() | |
createResponse ($data, $statusCode) | |
createResponse ($data, $statusCode) | |
getHttpMethod () | |
getHttpMethod () | |
![]() | |
getCurrencies () | |
getParameter ($key) | |
setParameter ($key, $value) | |
setParameter ($key, $value) | |
![]() | |
$liveEndpoint = 'https://api.paypal.com' | |
$payerId = null | |
$testEndpoint = 'https://api.sandbox.paypal.com' | |
![]() | |
$currencies | |
$httpClient | |
$httpRequest | |
$negativeAmountAllowed = false | |
$parameters | |
$response | |
$zeroAmountAllowed = true | |
To get details about completed payments (sale transaction) created by a payment request or to refund a direct sale transaction, PayPal provides the /sale resource and related sub-resources.
TODO: There might be a problem here, in that refunding a capture requires a different URL.
TODO: Yes I know. The gateway doesn't yet support looking up or refunding captured transactions. That will require adding additional message classes because the URLs are all different.
A non-zero amount can be provided for the refund using setAmount(), if this is not provided (or is zero) then a full refund is made.
Example – note this example assumes that the purchase has been successful and that the transaction ID returned from the purchase is held in $sale_id. See RestPurchaseRequest for the first part of this example transaction:
$transaction = $gateway->refund(array( 'amount' => '10.00', 'currency' => 'AUD', )); $transaction->setTransactionReference($sale_id); $response = $transaction->send(); if ($response->isSuccessful()) { echo "Refund transaction was successful!\n"; $data = $response->getData(); echo "Gateway refund response data == " . print_r($data, true) . "\n"; }
PayPal subscription payments cannot be refunded. PayPal is working on this functionality for their future API release. In order to refund a PayPal subscription payment, you will need to use the PayPal web interface to refund it manually.
To get details about completed payments (sale transaction) created by a payment request or to refund a direct sale transaction, PayPal provides the /sale resource and related sub-resources.
TODO: There might be a problem here, in that refunding a capture requires a different URL.
TODO: Yes I know. The gateway doesn't yet support looking up or refunding captured transactions. That will require adding additional message classes because the URLs are all different.
A non-zero amount can be provided for the refund using setAmount(), if this is not provided (or is zero) then a full refund is made.
Example – note this example assumes that the purchase has been successful and that the transaction ID returned from the purchase is held in $sale_id. See RestPurchaseRequest for the first part of this example transaction:
$transaction = $gateway->refund(array( 'amount' => '10.00', 'currency' => 'AUD', )); $transaction->setTransactionReference($sale_id); $response = $transaction->send(); if ($response->isSuccessful()) { echo "Refund transaction was successful!\n"; $data = $response->getData(); echo "Gateway refund response data == " . print_r($data, true) . "\n"; }
PayPal subscription payments cannot be refunded. PayPal is working on this functionality for their future API release. In order to refund a PayPal subscription payment, you will need to use the PayPal web interface to refund it manually.
Definition at line 50 of file lib/vendor/omnipay/paypal/src/Message/RestRefundRequest.php.
Omnipay\PayPal\Message\RestRefundRequest::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 52 of file lib/vendor/omnipay/paypal/src/Message/RestRefundRequest.php.
References Omnipay\Common\Message\AbstractRequest\getAmount(), Omnipay\Common\Message\AbstractRequest\getCurrency(), Omnipay\Common\Message\AbstractRequest\getDescription(), and Omnipay\Common\Message\AbstractRequest\validate().
Omnipay\PayPal\Message\RestRefundRequest::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 52 of file vendor/omnipay/paypal/src/Message/RestRefundRequest.php.
References Omnipay\Common\Message\AbstractRequest\getAmount(), Omnipay\Common\Message\AbstractRequest\getCurrency(), Omnipay\Common\Message\AbstractRequest\getDescription(), and Omnipay\Common\Message\AbstractRequest\validate().
Omnipay\PayPal\Message\RestRefundRequest::getEndpoint | ( | ) |
Reimplemented from Omnipay\PayPal\Message\AbstractRestRequest.
Definition at line 69 of file vendor/omnipay/paypal/src/Message/RestRefundRequest.php.
References Omnipay\Common\Message\AbstractRequest\getTransactionReference().
Omnipay\PayPal\Message\RestRefundRequest::getEndpoint | ( | ) |
Reimplemented from Omnipay\PayPal\Message\AbstractRestRequest.
Definition at line 69 of file lib/vendor/omnipay/paypal/src/Message/RestRefundRequest.php.
References Omnipay\Common\Message\AbstractRequest\getTransactionReference().