Save a mandate for future PayTo paymentsInvite only
Learn how to collect a PayTo payment and authorize future payments.
PayTo allows customers in Australia to authenticate PayTo agreements for one-off and recurring payments in their banking apps. Customers pay with PayTo by receiving notification of a pending agreement request, authorizing the terms of the agreement, then returning to your app where you get delayed notification on whether the payment succeeded or failed.
Setting up a PayTo agreement for future payments allows you to collect future recurring payments without needing customer authorization again. Customers can view, manage, pause, and cancel their PayTo agreements in their banking apps.
Caution
Stripe doesn’t support modification or pausing of PayTo agreements by customers. If a customer attempts to pause or modify an agreement, we cancel the agreement and send you a mandate.
webhook. After receiving the webhook, you can reach out to your customer to find out why they adjusted their agreement, as well as setup a new agreement.
To accept PayTo payments, create a PaymentIntent object to track a payment, collect payment method details, then submit the payment to Stripe for processing. Stripe uses the PaymentIntent to track and handle all the states of the payment until the payment completes. Use the ID of the Mandate collected from your initial PayTo PaymentIntent to create future payments.
Caution
Stripe automatically presents your customers payment method options by evaluating their currency, payment method restrictions, and other parameters. We recommend that you configure your payment methods from the Stripe Dashboard using the instructions in Accept a payment.
If you want to continue manually configuring the payment methods you present to your customers with Checkout, use this guide. Otherwise, update your integration to configure payment methods in the Dashboard.
Set up StripeServer-side
First, you need a Stripe account. Register now.
To access the Stripe API from your application, use our official libraries:
Create a CustomerServer-side
Create a Customer after they create an account with your business and associate it with your internal representation of their account. This enables you to retrieve and use their saved payment method details later.
Create a PaymentIntentServer-side
Create a PaymentIntent on your server and specify the amount
to collect, the aud
currency, the customer ID, and off_
as an argument for setup future usage. The minimum charge amount is 0.50 AUD and PayTo doesn’t support other currencies. If you have an existing Payment Intents API integration, add payto
to the list of payment method types.
You can specify the terms of the agreement for your customer’s consent in the PayTo payment method options.
Common mistake
The payment method options amount
must match the PaymentIntent amount
unless you set the amount_
to maximum
, in which case you can set payment method options value that’s higher than the PaymentIntent.
The following code sample shows a PaymentIntent amount of 10 AUD and a payment method options amount of 1500 AUD because the amount_
is maximum
.
Stripe supports various types of agreements, with controls for the amount, duration, cadence, and purpose of the agreement. Specify agreement terms that match your requirements as closely as possible—customers see these precise terms at authorization time, so accuracy can improve your conversion rate.
Beta
The default purpose
is set to retail
. Override this field using any of the valid values if retail
doesn’t accurately represent the purpose of the agreement.
Retrieve the client secret
The PaymentIntent includes a client secret that the client side uses to securely complete the payment process. You can use different approaches to pass the client secret to the client side.
Collect payment method details and submit the paymentClient-side
Collect payment details on the client with the Payment Element. The Payment Element is a prebuilt UI component that simplifies collecting payment details for a variety of payment methods.
The Payment Element contains an iframe that securely sends payment information to Stripe over an HTTPS connection. Avoid placing the Payment Element within another iframe because some payment methods require redirecting to another page for payment confirmation.
The checkout page address must start with https://
rather than http://
for your integration to work. You can test your integration without using HTTPS, but remember to enable it when you’re ready to accept live payments.
Use stripe.confirmPayment to complete the payment using details from the Payment Element. This sends an authorization request to the buyer.
Note
stripe.
might take several seconds to complete while waiting for customers to authorize the payment. During that time, disable your form from being resubmitted and show a waiting indicator like a spinner. If you receive an error, show it to the customer, re-enable the form, and hide the waiting indicator.
Charge the PayTo PaymentMethod later
When you need to charge your customer again, create a new PaymentIntent. To find the mandate ID, customer ID, and payment method ID, retrieve the previous PaymentIntent and expand the latest_
field.
View the necessary IDs in the response below.
{ // ... "customer": "cus_PW6rQWRGAaBD7z", // <---- Here's the customer "latest_charge": { "payment_method": "pm_1Ok4l9A8DuEjWaGwhB4SGrWh", // <---- Here's the payment method "payment_method_details": { "payto": { "bsb_number": null, "last4": null, "mandate": "mandate_1Ok4lVA8DuEjWaGwu0uTwI94", // <----- Here's the mandate "pay_id": "jenny@example.com" }, "type": "payto" }, }, "payment_method_types": [ "payto" ], // ... }
Create a PaymentIntent with the PaymentMethod, Mandate, and Customer IDs.
Test your integration
Test your PayTo integration with your test API keys by using the various test PayIDs and bank account details below. Each set of details results in a different scenario your integration might commonly face in live mode.