Open Journal Systems
3.3.0
|
Protected Member Functions | |
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 List Purchase Request
Use this call to get a list of payments in any state (created, approved, failed, etc.). The payments returned are the payments made to the merchant making the call.
See RestPurchaseRequest for the first part of this example transaction:
// Make some DateTimes for start and end times $start_time = new \DateTime('yesterday'); $end_time = new \DateTime('now');
// List the transaction so that details can be found for refund, etc. $transaction = $gateway->listPurchase( 'startTime' => $start_time, 'endTime => $end_time ); $response = $transaction->send(); $data = $response->getData(); echo "Gateway listPurchase response data == " . print_r($data, true) . "\n";
This is from the PayPal web site:
curl -v -X GET https://api.sandbox.paypal.com/v1/payments/payment? sort_order=asc&sort_by=update_time \ -H "Content-Type:application/json" \ -H "Authorization: Bearer <Access-Token>"
This is from the PayPal web site:
{ "payments": [ { "id": "PAY-4D099447DD202993VKEFMRJQ", "create_time": "2013-01-31T19:40:22Z", "update_time": "2013-01-31T19:40:24Z", "state": "approved", "intent": "sale", "payer": { "payment_method": "credit_card", "funding_instruments": [ { "credit_card": { "type": "visa", "number": "xxxxxxxxxxxx0331", "expire_month": "10", "expire_year": "2018", "first_name": "Betsy", "last_name": "Buyer", "billing_address": { "line1": "111 First Street", "city": "Saratoga", "state": "CA", "postal_code": "95070", "country_code": "US" } } } ] }, "transactions": [ { "amount": { "total": "110.54", "currency": "USD" }, "description": "This is the payment transaction description.", "related_resources": [ { "sale": { "id": "1D971400A7097562W", "create_time": "2013-01-31T19:40:23Z", "update_time": "2013-01-31T19:40:25Z", "state": "completed", "amount": { "total": "110.54", "currency": "USD" }, "parent_payment": "PAY-4D099447DD202993VKEFMRJQ", "links": [ { "href": "https://api.sandbox.paypal.com/v1/payments/sale/1D971400A7097562W", "rel": "self", "method": "GET" }, { "href": "https://api.sandbox.paypal.com/v1/payments/sale/1D971400A7097562W/refund", "rel": "refund", "method": "POST" }, { "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-4D099447DD202993VKEFMRJQ", "rel": "parent_payment", "method": "GET" } ] } } ] } ], "links": [ { "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-4D099447DD202993VKEFMRJQ", "rel": "self", "method": "GET" } ] } ] }
// Make some DateTimes for start and end times $start_time = new ('yesterday'); $end_time = new ('now'); // List the transaction so that details can be found for refund, etc. $transaction = $gateway->listPurchase( 'startTime' => $start_time, 'endTime => $end_time ); $response = $transaction->send(); $data = $response->getData(); echo "Gateway listPurchase response data == " . print_r($data, true) . "\n";
autotoc_md97 Request Sample This is from the PayPal web site: curl -v -X GET https://api.sandbox.paypal.com/v1/payments/payment? sort_order=asc&sort_by=update_time \ -H "Content-Type:application/json" \ -H "Authorization: Bearer <Access-Token>"
autotoc_md98 Response Sample This is from the PayPal web site: { "payments": [ { "id": "PAY-4D099447DD202993VKEFMRJQ", "create_time": "2013-01-31T19:40:22Z", "update_time": "2013-01-31T19:40:24Z", "state": "approved", "intent": "sale", "payer": { "payment_method": "credit_card", "funding_instruments": [ { "credit_card": { "type": "visa", "number": "xxxxxxxxxxxx0331", "expire_month": "10", "expire_year": "2018", "first_name": "Betsy", "last_name": "Buyer", "billing_address": { "line1": "111 First Street", "city": "Saratoga", "state": "CA", "postal_code": "95070", "country_code": "US" } } } ] }, "transactions": [ { "amount": { "total": "110.54", "currency": "USD" }, "description": "This is the payment transaction description.", "related_resources": [ { "sale": { "id": "1D971400A7097562W", "create_time": "2013-01-31T19:40:23Z", "update_time": "2013-01-31T19:40:25Z", "state": "completed", "amount": { "total": "110.54", "currency": "USD" }, "parent_payment": "PAY-4D099447DD202993VKEFMRJQ", "links": [ { "href": "https://api.sandbox.paypal.com/v1/payments/sale/1D971400A7097562W", "rel": "self", "method": "GET" }, { "href": "https://api.sandbox.paypal.com/v1/payments/sale/1D971400A7097562W/refund", "rel": "refund", "method": "POST" }, { "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-4D099447DD202993VKEFMRJQ", "rel": "parent_payment", "method": "GET" } ] } } ] } ], "links": [ { "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-4D099447DD202993VKEFMRJQ", "rel": "self", "method": "GET" } ] } ] }
RestPurchaseRequest https://developer.paypal.com/docs/api/#list-payment-resources Definition at line 140 of file lib/vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
Omnipay\PayPal\Message\RestListPurchaseRequest::getCount | ( | ) |
Get the request count
Definition at line 147 of file lib/vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
References Omnipay\Common\Message\AbstractRequest\getParameter().
Referenced by Omnipay\PayPal\Message\RestListPurchaseRequest\getData().
Omnipay\PayPal\Message\RestListPurchaseRequest::getCount | ( | ) |
Get the request count
Definition at line 147 of file vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
References Omnipay\Common\Message\AbstractRequest\getParameter().
Omnipay\PayPal\Message\RestListPurchaseRequest::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 255 of file lib/vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
References Omnipay\PayPal\Message\RestListPurchaseRequest\getCount(), Omnipay\PayPal\Message\RestListPurchaseRequest\getEndTime(), Omnipay\PayPal\Message\RestListPurchaseRequest\getStartId(), Omnipay\PayPal\Message\RestListPurchaseRequest\getStartIndex(), and Omnipay\PayPal\Message\RestListPurchaseRequest\getStartTime().
Omnipay\PayPal\Message\RestListPurchaseRequest::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 255 of file vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
References Omnipay\PayPal\Message\RestListPurchaseRequest\getCount(), Omnipay\PayPal\Message\RestListPurchaseRequest\getEndTime(), Omnipay\PayPal\Message\RestListPurchaseRequest\getStartId(), Omnipay\PayPal\Message\RestListPurchaseRequest\getStartIndex(), and Omnipay\PayPal\Message\RestListPurchaseRequest\getStartTime().
Omnipay\PayPal\Message\RestListPurchaseRequest::getEndpoint | ( | ) |
Reimplemented from Omnipay\PayPal\Message\AbstractRestRequest.
Definition at line 278 of file vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
Omnipay\PayPal\Message\RestListPurchaseRequest::getEndpoint | ( | ) |
Reimplemented from Omnipay\PayPal\Message\AbstractRestRequest.
Definition at line 278 of file lib/vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
Omnipay\PayPal\Message\RestListPurchaseRequest::getEndTime | ( | ) |
Get the request endTime
Definition at line 235 of file lib/vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
References Omnipay\Common\Message\AbstractRequest\getParameter().
Referenced by Omnipay\PayPal\Message\RestListPurchaseRequest\getData().
Omnipay\PayPal\Message\RestListPurchaseRequest::getEndTime | ( | ) |
Get the request endTime
Definition at line 235 of file vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
References Omnipay\Common\Message\AbstractRequest\getParameter().
|
protected |
Get HTTP Method.
The HTTP method for listPurchase requests must be GET.
Reimplemented from Omnipay\PayPal\Message\AbstractRestRequest.
Definition at line 273 of file vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
|
protected |
Get HTTP Method.
The HTTP method for listPurchase requests must be GET.
Reimplemented from Omnipay\PayPal\Message\AbstractRestRequest.
Definition at line 273 of file lib/vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
Omnipay\PayPal\Message\RestListPurchaseRequest::getStartId | ( | ) |
Get the request startId
Definition at line 168 of file vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
References Omnipay\Common\Message\AbstractRequest\getParameter().
Omnipay\PayPal\Message\RestListPurchaseRequest::getStartId | ( | ) |
Get the request startId
Definition at line 168 of file lib/vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
References Omnipay\Common\Message\AbstractRequest\getParameter().
Referenced by Omnipay\PayPal\Message\RestListPurchaseRequest\getData().
Omnipay\PayPal\Message\RestListPurchaseRequest::getStartIndex | ( | ) |
Get the request startIndex
Definition at line 189 of file lib/vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
References Omnipay\Common\Message\AbstractRequest\getParameter().
Referenced by Omnipay\PayPal\Message\RestListPurchaseRequest\getData().
Omnipay\PayPal\Message\RestListPurchaseRequest::getStartIndex | ( | ) |
Get the request startIndex
Definition at line 189 of file vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
References Omnipay\Common\Message\AbstractRequest\getParameter().
Omnipay\PayPal\Message\RestListPurchaseRequest::getStartTime | ( | ) |
Get the request startTime
Definition at line 210 of file vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
References Omnipay\Common\Message\AbstractRequest\getParameter().
Omnipay\PayPal\Message\RestListPurchaseRequest::getStartTime | ( | ) |
Get the request startTime
Definition at line 210 of file lib/vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
References Omnipay\Common\Message\AbstractRequest\getParameter().
Referenced by Omnipay\PayPal\Message\RestListPurchaseRequest\getData().
Omnipay\PayPal\Message\RestListPurchaseRequest::setCount | ( | $value | ) |
Set the request count
integer | $value |
Definition at line 158 of file lib/vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
References Omnipay\Common\Message\AbstractRequest\setParameter().
Omnipay\PayPal\Message\RestListPurchaseRequest::setCount | ( | $value | ) |
Set the request count
integer | $value |
Definition at line 158 of file vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
References Omnipay\Common\Message\AbstractRequest\setParameter().
Omnipay\PayPal\Message\RestListPurchaseRequest::setEndTime | ( | $value | ) |
Set the request endTime
string | \DateTime | $value |
Definition at line 246 of file vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
References Omnipay\Common\Message\AbstractRequest\setParameter().
Omnipay\PayPal\Message\RestListPurchaseRequest::setEndTime | ( | $value | ) |
Set the request endTime
string | \DateTime | $value |
Definition at line 246 of file lib/vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
References Omnipay\Common\Message\AbstractRequest\setParameter().
Omnipay\PayPal\Message\RestListPurchaseRequest::setStartId | ( | $value | ) |
Set the request startId
string | $value |
Definition at line 179 of file vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
References Omnipay\Common\Message\AbstractRequest\setParameter().
Omnipay\PayPal\Message\RestListPurchaseRequest::setStartId | ( | $value | ) |
Set the request startId
string | $value |
Definition at line 179 of file lib/vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
References Omnipay\Common\Message\AbstractRequest\setParameter().
Omnipay\PayPal\Message\RestListPurchaseRequest::setStartIndex | ( | $value | ) |
Set the request startIndex
integer | $value |
Definition at line 200 of file vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
References Omnipay\Common\Message\AbstractRequest\setParameter().
Omnipay\PayPal\Message\RestListPurchaseRequest::setStartIndex | ( | $value | ) |
Set the request startIndex
integer | $value |
Definition at line 200 of file lib/vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
References Omnipay\Common\Message\AbstractRequest\setParameter().
Omnipay\PayPal\Message\RestListPurchaseRequest::setStartTime | ( | $value | ) |
Set the request startTime
string | \DateTime | $value |
Definition at line 221 of file lib/vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
References Omnipay\Common\Message\AbstractRequest\setParameter().
Omnipay\PayPal\Message\RestListPurchaseRequest::setStartTime | ( | $value | ) |
Set the request startTime
string | \DateTime | $value |
Definition at line 221 of file vendor/omnipay/paypal/src/Message/RestListPurchaseRequest.php.
References Omnipay\Common\Message\AbstractRequest\setParameter().