Contains helper class to work with PayPal REST API.
Copyright: | 2020 Shamim Rezaie <shamim@moodle.com> |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 196 lines (6 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
paypal_helper:: (5 methods):
__construct()
capture_authorization()
capture_order()
get_order_details()
get_token()
Class: paypal_helper - X-Ref
__construct(string $clientid, string $secret, bool $sandbox) X-Ref |
helper constructor. param: string $clientid The client id. param: string $secret PayPal secret. param: bool $sandbox Whether we are working with the sandbox environment or not. |
capture_authorization(string $authorizationid, float $amount, string $currency, bool $final = true) X-Ref |
Captures an authorized payment, by ID. param: string $authorizationid The PayPal-generated ID for the authorized payment to capture. param: float $amount The amount to capture. param: string $currency The currency code for the amount. param: bool $final Indicates whether this is the final captures against the authorized payment. return: array|null Formatted API response. |
capture_order(string $orderid) X-Ref |
Captures order details from PayPal. param: string $orderid The order we want to capture. return: array|null Formatted API response. |
get_order_details(string $orderid) X-Ref |
No description |
get_token() X-Ref |
Request for PayPal REST oath bearer token. return: string |