$transaction_id, ) ); } /** * Refunds a captured PayPal payment via the PayPal REST API. * * @param string $capture_id PayPal capture ID to refund. */ public static function paypal_refund( $capture_id ) { $token = AIMSLMS_Gateway_PayPal::access_token(); wp_remote_post( AIMSLMS_Gateway_PayPal::api_base() . "/v2/payments/captures/{$capture_id}/refund", array( 'headers' => array( 'Authorization' => "Bearer {$token}", 'Content-Type' => 'application/json', ), ) ); } }