Ir a contenido
Crea una cuenta
o
Inicia sesión
Logotipo de Stripe Docs
/
Pregúntale a la IA
Crear una cuenta
Iniciar sesión
Empieza ahora
Pagos
Ingresos
Plataformas y marketplaces
Gestión del dinero
Recursos para desarrolladores
Resumen
Acerca de Stripe Payments
Actualiza tu integración
Análisis de pagos
Pagos electrónicos
ResumenEncuentra tu caso de usoPagos administrados
Usa Payment Links
Crea una página del proceso de compra
Desarrolla una integración avanzada
Desarrolla una integración en la aplicación
Métodos de pago
Agrega métodos de pago
    Resumen
    Opciones de integración de métodos de pago
    Gestiona los métodos de pago predeterminados en el Dashboard
    Tipos de método de pago
    Tarjetas
    Paga con el saldo de Stripe
    Criptomonedas
    Débitos bancarios
      Débito directo ACH
      Débito directo Bacs
      Débito preautorizado en Canadá
      Débito directo BECS de Australia
        Acepta un pago
        Guardar datos bancarios
      Débito directo BECS de Nueva Zelanda
      Débito directo SEPA
    Redireccionamientos bancarios
    Transferencias bancarias
    Transferencias de crédito (API Sources)
    Compra ahora, paga después
    Pagos en tiempo real
    Vales
    Billeteras
    Habilita métodos de pago locales por país
    Métodos de pago personalizados
Gestiona los métodos de pago
Finalización de compra más rápida con Link
Interfaces de pago
Payment Links
Checkout
Elements para la web
Elements en la aplicación
Escenarios de pago
Administrar varias monedas
Flujos de pago personalizados
Capacidad adquirente flexible
Orquestación
Pagos en persona
Terminal
Más allá de los pagos
Constituye tu empresa
Criptomonedas
Financial Connections
Climate
Comprender el fraude
Protección contra fraudes de Radar
Gestionar disputas
Verificar identidades
InicioPagosAdd payment methodsBank debitsAustralia BECS Direct Debit

Save Australia BECS Direct Debit details for future payments

Use the Setup Intents API to save payment method details for future Australia BECS Direct Debit payments.

Use AuBECSDebitForm, Stripe’s prebuilt BECS payment details collection UI, to create a payment form that lets you securely collect bank details without handling sensitive customer data. You can use the Setup Intents API to collect BECS Direct Debit payment method details in advance, and determine the final amount or payment date later. Use it to:

  • Save payment methods to a wallet to streamline future purchases
  • Collect surcharges after fulfilling a service
  • Start a free trial for a subscription

Set up Stripe
Server-side
Client-side

Server-side

This integration requires endpoints on your server that talk to the Stripe API. Use our official libraries for access to the Stripe API from your server:

Command Line
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
# Available as a gem sudo gem install stripe
Gemfile
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
# If you use bundler, you can add this line to your Gemfile gem 'stripe'

Client-side

The React Native SDK is open source and fully documented. Internally, it uses the native iOS and Android SDKs. To install Stripe’s React Native SDK, run one of the following commands in your project’s directory (depending on which package manager you use):

Command Line
yarn add @stripe/stripe-react-native

Next, install some other necessary dependencies:

  • For iOS, go to the ios directory and run pod install to ensure that you also install the required native dependencies.
  • For Android, there are no more dependencies to install.

Nota

We recommend following the official TypeScript guide to add TypeScript support.

Stripe initialization

To initialize Stripe in your React Native app, either wrap your payment screen with the StripeProvider component, or use the initStripe initialization method. Only the API publishable key in publishableKey is required. The following example shows how to initialize Stripe using the StripeProvider component.

import { useState, useEffect } from 'react'; import { StripeProvider } from '@stripe/stripe-react-native'; function App() { const [publishableKey, setPublishableKey] = useState(''); const fetchPublishableKey = async () => { const key = await fetchKey(); // fetch key from your server here setPublishableKey(key); }; useEffect(() => { fetchPublishableKey(); }, []); return ( <StripeProvider publishableKey={publishableKey} merchantIdentifier="merchant.identifier" // required for Apple Pay urlScheme="your-url-scheme" // required for 3D Secure and bank redirects > {/* Your app code here */} </StripeProvider> ); }

Nota

Use your API test keys while you test and develop, and your live mode keys when you publish your app.

Create or retrieve a Customer
Server-side

To reuse a BECS Direct Debit account for future payments, you must attach it to a Customer.

Create a Customer object when your customer creates an account with your business. Associating the ID of the Customer object with your own internal representation of them enables you to retrieve and use the stored payment method details later.

Create a new Customer or retrieve an existing Customer to associate with this payment. Include the following code on your server to create a new Customer.

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
curl -X POST https://api.stripe.com/v1/customers \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"

Collect payment method details and mandate acknowledgment
Client-side

You can securely collect Australia BECS Direct Debit payment information with AuBECSDebitForm, a drop-in UI component provided by the SDK. AuBECSDebitForm provides a UI for customers to enter their name, email, BSB number, and account number in addition to displaying the Australia BECS Direct Debit Terms.

Add an AuBECSDebitForm component to the screen with your company name as a prop. You can also customize AuBECSDebitForm to match the look and feel of your app by providing the formStyle prop. Collect form details with the onComplete prop.

function BECSSetupFuturePaymentScreen() { const [formDetails, setFormDetails] = useState< AuBECSDebitFormComponent.FormDetails >(); return ( <View> <AuBECSDebitForm onComplete={(value) => setFormDetails(value)} companyName="Example Company Inc." formStyle={{ textColor: '#000000', fontSize: 22, placeholderColor: '#999999', }} /> <Button title="Save" variant="primary" onPress={handlePayPress} /> </View> ); }

Create a SetupIntent
Server-side
Client-side

Server-side

A SetupIntent is an object that represents your intent to set up a customer’s payment method for future payments. The SetupIntent will track the steps of this set-up process. For BECS Direct Debit, this includes collecting a mandate from the customer and tracking its validity throughout its lifecycle.

Create a SetupIntent on your server with payment_method_types set to au_becs_debit and specify the Customer’s id:

Command Line
curl
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
curl https://api.stripe.com/v1/setup_intents \ -u
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:
\ -d "payment_method_types[]"="au_becs_debit" \ -d "customer"="{{CUSTOMER_ID}}"

After creating a SetupIntent on your server, you can associate the SetupIntent ID with the current session’s customer in your application’s data model. Doing so allows you to retrieve the information after you have successfully collected a payment method.

The returned SetupIntent object contains a client_secret property. Pass the client secret to the client-side application to continue with the setup process.

Client-side

On the client, request a SetupIntent from your server and store its client secret.

const fetchSetupIntentClientSecret = async (customerEmail: string) => { const response = await fetch(`${API_URL}/create-setup-intent`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ email: customerEmail, payment_method_types: ['au_becs_debit'], }), }); const {clientSecret, error} = await response.json(); return {clientSecret, error}; };

Submit the payment method details to Stripe
Client-side

Retrieve the client secret from the SetupIntent you created and call confirmSetupIntent. This presents a webview where the customer can complete the setup on their bank’s website or app.

function BECSSetupFuturePaymentScreen() { const { confirmSetupIntent } = useConfirmSetupIntent(); const [formDetails, setFormDetails] = useState< AuBECSDebitFormComponent.FormDetails >(); const handlePayPress = async () => { const { error, setupIntent } = await confirmSetupIntent(clientSecret, { paymentMethodType: 'AuBecsDebit', paymentMethodData: { formDetails, } }); if (error) { Alert.alert(`Error code: ${error.code}`, error.message); console.log('Setup intent confirmation error', error.message); } else if (setupIntent) { Alert.alert( `Success: Setup intent created. Intent status: ${setupIntent.status}` ); } }; return ( <View> <AuBECSDebitForm onComplete={(value) => setFormDetails(value)} companyName="Example Company Inc." formStyle={{ textColor: '#000000', fontSize: 22, placeholderColor: '#999999', }} /> <Button title="Save" variant="primary" onPress={handlePayPress} /> </View> ); }

Test the integration

Test your form using the test BSB number 000000 and one of the test account numbers below when you call confirmSetupIntent.

BSB NumberAccount NumberDescription
000000000123456The PaymentIntent created with the resulting PaymentMethod transitions from processing to succeeded. The mandate status remains active.
000000900123456The PaymentIntent created with the resulting PaymentMethod transitions from processing to succeeded (with a three-minute delay). The mandate status remains active.
000000111111113The PaymentIntent created with the resulting PaymentMethod transitions from processing to requires_payment_method with an account_closed failure code. The mandate status becomes inactive at that point.
000000111111116The PaymentIntent created with the resulting PaymentMethod transitions from processing to requires_payment_method with a no_account failure code. The mandate status becomes inactive at that point.
000000222222227The PaymentIntent created with the resulting PaymentMethod transitions from processing to requires_payment_method with a refer_to_customer failure code. The mandate status remains active.
000000922222227The PaymentIntent created with the resulting PaymentMethod transitions from processing to requires_payment_method with a refer_to_customer failure code (with a three-minute delay). The mandate status remains active.
000000333333335The PaymentIntent created with the resulting PaymentMethod transitions from processing to requires_payment_method with a debit_not_authorized failure code. The mandate status becomes inactive at that point.
000000666666660The PaymentIntent created with the resulting PaymentMethod transitions from processing to succeeded, but a dispute is immediately created.
000000343434343The PaymentIntent that was created with the resulting PaymentMethod fails with a charge_exceeds_source_limit error due to the payment amount causing the account to exceed its weekly payment volume limit.
000000121212121The PaymentIntent that was created with the resulting PaymentMethod fails with a charge_exceeds_transaction_limit error due to the payment amount exceeding the account’s transaction volume limit.

Consulta también

  • Accept an Australia BECS Direct Debit payment
  • Connect payments
¿Te fue útil esta página?
SíNo
  • ¿Necesitas ayuda? Ponte en contacto con soporte.
  • Únete a nuestro programa de acceso anticipado.
  • Echa un vistazo a nuestro registro de cambios.
  • ¿Tienes alguna pregunta? Contacto.
  • ¿LLM? Lee llms.txt.
  • Con tecnología de Markdoc