WC_Gateway_Paypal_API_Handler::get_capture_request()
Get capture request args. See https://developer.paypal.com/docs/classic/api/merchant/DoCapture_API_Operation_NVP/.
Method of the class: WC_Gateway_Paypal_API_Handler{}
Hooks from the method
Return
Array
.
Usage
$result = WC_Gateway_Paypal_API_Handler::get_capture_request( $order, $amount );
- $order(WC_Order) (required)
- Order object.
- $amount(float)
- Amount.
Default: null
WC_Gateway_Paypal_API_Handler::get_capture_request() WC Gateway Paypal API Handler::get capture request code WC 9.6.0
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 ); }