Reputation: 101
I'm trying to create my own custom online payment gateway plugin to allow clients to make payments through our bank payment gateway API.
So when the client clicks on "proceed to checkout" button, a RESTful exchange happens between our Woocommerce website and the bank payment gateway API to redirect the client to the payment page hosted in the bank platform to make the payment.
I've read most of the tutorials but they were not helpful and I'm getting lost: https://www.sitepoint.com/building-a-woocommerce-payment-extension/ https://docs.woocommerce.com/document/payment-gateway-api/
My question is How can manage to make Woocommerce work with the payment API ?
Upvotes: 1
Views: 1976
Reputation: 11
In your function process_payment at the end you have that :
return array(
'result' => 'success',
'redirect' => $payment_url
);
$payment_url
is the way where your order was redirected, so set it with your API response url, to redirect the client to the payment page hosted in the bank platform to make the payment.
Upvotes: 1