WC_Gateway_Paypal_API_Handler
in package
Handles Refunds and other API requests such as capture.
Tags
Table of Contents
- $api_password : string
- API Password
- $api_signature : string
- API Signature
- $api_username : string
- API Username
- $sandbox : bool
- Sandbox
- do_capture() : object
- Capture an authorization.
- get_capture_request() : array<string|int, mixed>
- Get capture request args.
- get_refund_request() : array<string|int, mixed>
- Get refund request args.
- refund_transaction() : object
- Refund an order via PayPal.
Properties
$api_password
API Password
public
static string
$api_password
$api_signature
API Signature
public
static string
$api_signature
$api_username
API Username
public
static string
$api_username
$sandbox
Sandbox
public
static bool
$sandbox
= alse
Methods
do_capture()
Capture an authorization.
public
static do_capture(WC_Order $order[, float $amount = null ]) : object
Parameters
- $order : WC_Order
-
Order object.
- $amount : float = null
-
Amount.
Return values
object — Either an object of name value pairs for a success, or a WP_ERROR object.get_capture_request()
Get capture request args.
public
static get_capture_request(WC_Order $order[, float $amount = null ]) : array<string|int, mixed>
See https://developer.paypal.com/docs/classic/api/merchant/DoCapture_API_Operation_NVP/.
Parameters
- $order : WC_Order
-
Order object.
- $amount : float = null
-
Amount.
Return values
array<string|int, mixed> —get_refund_request()
Get refund request args.
public
static get_refund_request(WC_Order $order[, float $amount = null ][, string $reason = '' ]) : array<string|int, mixed>
Parameters
- $order : WC_Order
-
Order object.
- $amount : float = null
-
Refund amount.
- $reason : string = ''
-
Refund reason.
Return values
array<string|int, mixed> —refund_transaction()
Refund an order via PayPal.
public
static refund_transaction(WC_Order $order[, float $amount = null ][, string $reason = '' ]) : object
Parameters
- $order : WC_Order
-
Order object.
- $amount : float = null
-
Refund amount.
- $reason : string = ''
-
Refund reason.