Skip to content
Create account
or
Sign in
The Stripe Docs logo
/
Ask AI
Create account
Sign in
Get started
Payments
Revenue
Platforms and marketplaces
Money management
Developer tools
Overview
About Stripe payments
Upgrade your integration
Payments analytics
Online payments
OverviewFind your use caseManaged Payments
Use Payment Links
Build a checkout page
Build an advanced integration
Build an in-app integration
Payment methods
Add payment methods
    Overview
    Payment method integration options
    Manage default payment methods in the Dashboard
    Payment method types
    Cards
    Pay with Stripe balance
    Crypto
    Bank debits
    Bank redirects
    Bank transfers
    Credit transfers (Sources)
    Buy now, pay later
    Real-time payments
      Pay by Bank
      PayNow
      PayTo
        Accept a payment
        Save a mandate for future payments
        Setup future payments
      Pix
      PromptPay
      Swish
    Vouchers
    Wallets
    Enable local payment methods by country
    Custom payment methods
Manage payment methods
Faster checkout with Link
Payment interfaces
Payment Links
Checkout
Web Elements
In-app Elements
Payment scenarios
Custom payment flows
Flexible acquiring
Orchestration
In-person payments
Terminal
Other Stripe products
Financial Connections
Crypto
Climate
HomePaymentsAdd payment methodsReal-time paymentsPayTo

PayTo paymentsInvite only

Learn how to accept the PayTo payment method.

Copy page

PayTo is a real-time payment method in Australia for accepting one-time and recurring payments. When paying with PayTo, customers authenticate and approve agreements using their mobile banking app.

You get delayed notification on whether the payment succeeded or failed. Stripe typically sends a notification of the final status of the payment within 30 seconds of the agreement authorization.

Set up Stripe
Server-side

First, you need a Stripe account. Register now.

To access the Stripe API from your application, use our official libraries:

Command Line
Ruby
# Available as a gem sudo gem install stripe
Gemfile
Ruby
# If you use bundler, you can add this line to your Gemfile gem 'stripe'

Create a PaymentIntent
Server-side

A PaymentIntent is an object that represents your intent to collect a payment from a customer and tracks the payment process. To create a PaymentIntent that accepts a PayTo payment method, specify the amount to collect, aud as the currency, and payto in the payment_method_types list. If you maintain a list of payment method types that you pass when creating a PaymentIntent, add payto to it.

Command Line
cURL
curl https://api.stripe.com/v1/payment_intents \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d amount=1000 \ -d currency=aud \ -d "payment_method_types[]"=payto

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.

Retrieve the client secret from an endpoint on your server, using the browser’s fetch function. This approach is best if your client side is a single-page application, particularly one built with a modern frontend framework like React. Create the server endpoint that serves the client secret:

main.rb
Ruby
get '/secret' do intent = # ... Create or retrieve the PaymentIntent {client_secret: intent.client_secret}.to_json end

And then fetch the client secret with JavaScript on the client side:

(async () => { const response = await fetch('/secret'); const {client_secret: clientSecret} = await response.json(); // Render the form using the clientSecret })();

Collect payment method details and submit the payment
Client-side

When you confirm the payment, pass the client secret.

Caution

Handle the client secret carefully, because it allows access to the PaymentIntent. Don’t log it, embed it in URLs, or expose it to anyone but the customer.

Use stripe.confirmPayToPayment to initiate the payment authorization with your customer.

The customer receives a notification about the payment request, and authorizes or declines the request in their banking app.

script.js
// Inititates the payment request notification to the customer stripe.confirmPayToPayment( '{{PAYMENT_INTENT_CLIENT_SECRET}}', { payment_method: { billing_details: { // Name is required for all PayTo payments name: 'Jenny Rosen', // Email is required only for PayID payments, for refund processing email: 'jenny@example.com' }, payto: { // Either provide a PayID (typically an email or phone number) pay_id: 'jenny@example.com' // ...or provide bank account details account_number: '000123456', bsb_number: '000000' } } } ).then(function(result) { if (result.error) { // Inform the customer that there was an error. console.log(result.error.message); } });

By default, Stripe.js polls for updates to the PaymentIntent. The promise returned by confirmPayToPayment resolves when the PaymentIntent reaches the succeeded state, or when the payment fails and the PaymentIntent returns to the requires_payment_method state. See the PaymentIntent lifecycle for details on how these transitions happen.

To poll yourself, disable automatic polling by setting handleActions: false:

script.js
stripe.confirmPayToPayment( '{{PAYMENT_INTENT_CLIENT_SECRET}}', { payment_method: { payto: { account_number: '000123456', bsb_number: '000000' } } } { handleActions: false } // <---- Like this )

In this case, call the PaymentIntents API to fetch status of the PaymentIntent yourself.

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.

PayIDDescription
{any_prefix}+succeed@{any_domain}The PaymentIntent status transitions from requires_action to processing after 20 seconds, then transitions to succeeded after an additional 2 seconds.
{any_prefix}+decline@{any_domain}The PaymentIntent status transitions from requires_action to requires_payment_method after 20 seconds. Stripe returns the payment_method_provider_decline error code and an invalid_authorization decline code.
{any_prefix}+expire@{any_domain}The PaymentIntent status transitions from requires_action to requires_payment_method after 1 minute. Stripe returns the payment_method_provider_timeout error code and a generic_decline decline code.
{any_prefix}+insufficient_funds@{any_domain}The PaymentIntent status transitions from requires_action to processing after 20 seconds, then transitions to requires_payment_method after an additional 2 seconds. Stripe returns the payment_method_provider_decline error code and an insufficient_funds decline code.
{any_prefix}+agreement_type_not_supported@{any_domain}The PaymentIntent status transitions from requires_action to requires_payment_method after 20 seconds. Stripe returns the payment_method_provider_decline error code. The mandate enters an inactive state.

OptionalHandle post-payment events

Was this page helpful?
YesNo
Need help? Contact Support.
Join our early access program.
Check out our changelog.
Questions? Contact Sales.
LLM? Read llms.txt.
Powered by Markdoc