WC_Gateway_Paypal_API_Handler::get_capture_request( WC_Order $order, float $amount = null )
Get capture request args.
Description Description
See https://developer.paypal.com/docs/classic/api/merchant/DoCapture_API_Operation_NVP/.
Parameters Parameters
- $order
-
(Required) Order object.
- $amount
-
(Optional) Amount.
Default value: null
Return Return
(array)
Source Source
File: includes/gateways/paypal/includes/class-wc-gateway-paypal-api-handler.php
public static function get_capture_request( $order, $amount = null ) {
$request = array(
'VERSION' => '84.0',
'SIGNATURE' => self::$api_signature,
'USER' => self::$api_username,
'PWD' => self::$api_password,
'METHOD' => 'DoCapture',
'AUTHORIZATIONID' => $order->get_transaction_id(),
'AMT' => number_format( is_null( $amount ) ? $order->get_total() : $amount, 2, '.', '' ),
'CURRENCYCODE' => $order->get_currency(),
'COMPLETETYPE' => 'Complete',
);
return apply_filters( 'woocommerce_paypal_capture_request', $request, $order, $amount );
}