Create a transactions
To create a PayTo transaction, set themethod
to payto
and the redirect_url
to the endpoint of your application that can handle the customer returning once they’ve completed approving the transaction on payto.wpay.io
.
See the POST /transactions
API endpoint for more details.
Please note that, when using PayTo, the
intent
must be set to capture
.status
set to buyer_approval_pending
as well as a payment_method.approval_url
.
Handle redirect to PayTo
Your application will need to redirect your customer to Wpay where they will be required to set up the PayTo instrument and approve the payment. To do so, redirect the customer to thepayment_method.approval_url
. After they’ve
authenticated themselves, the customer will be redirected back to the redirect_url
that you set when creating the transaction.
Handle the return to your app
When the customer is redirected back to your app, the transaction status is not known. Your application will therefore need to call our API to get the latest transaction status. To do this, yourredirect_url
will be appended with the transaction_id
.
Although we also provide the
transaction_status
in this callback, it’s
recommended to also fetch the latest status via the API, as the status may
have changed since.Fetch the latest status
Finally, after the transaction has been created your application can get the latest details and status using the transaction ID received via the callback to the redirect URL, or on direct callback from the API.Visit the API reference documentation for full details about the
transaction resource, and any other API.
Webhooks
In order to receive timely updates regarding the status of your PayTo transactions please set up a PayTo webhook URL. In the PayTo Merchant Dashboard create a webhook with that URL. Once set up you will be given a webhook ID by PayTo, provide this back to the team.About tokenization
You can pass thestore=true
parameter to each request to vault a PayTo agreement for future use.
Once stored, you can use the vaulted PayTo instrument for future transactions.
Store a payment method
To create a PayTo instrument without paying and save it in the customer’s wallet for future use, set the method topayto
and the redirect_url
to the endpoint
of your application that can handle the customer returning once they’ve completed setting up PayTo.
Please note that when using PayTo intent must be set to capture as delayed capture is not supported by PayTo.
See the POST /payment-methods
API endpoint for more details.
status
set to buyer_approval_pending
as well as a payment_method.approval_url
.
Redirect to Wpay
Your application will need to redirect your customer to Wpay where they will be required to set up and authorize the PayTo agreement. To do so, redirect the customer to theapproval_url
.
After they’ve completed the required steps, the customer will be redirected back to the redirect_url
that
you set when creating the payment method.
Handle the return to your app
When the customer is redirected back to your app, depending on your checkout customer experience your application might need to call our API to get the latest list of payment methods for the customer. To do this, see theGET /payment-methods
API endpoint for more details.