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
Automatización contable
Plataformas y marketplaces
Gestión del dinero
Herramientas para desarrolladores
Empieza ahora
Pagos
Automatización contable
Empieza ahora
Pagos
Automatización contable
Plataformas y marketplaces
Gestión del dinero
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
    Débitos bancarios
    Redireccionamientos bancarios
    Transferencias bancarias
    Transferencias de crédito (API Sources)
    Compra ahora, paga después
    Pagos en tiempo real
    Vales
      Boleto
      Konbini
      Multibanco
      OXXO
        Acepta un pago
    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
Flujos de pago personalizados
Capacidad adquirente flexible
Orquestación
Pagos en persona
Terminal
Otros productos de Stripe
Financial Connections
Criptomonedas
Climate
InicioPagosAdd payment methodsVouchersOXXO

Nota

Esta página aún no está disponible en este idioma. Estamos trabajando intensamente para que nuestra documentación esté disponible en más idiomas. Ofreceremos la traducción en cuanto esté disponible.

Accept an OXXO payment

Learn how to accept OXXO, a common payment method in Mexico.

Copiar página

Precaución

We recommend that you follow the Accept a payment guide unless you need to use manual server-side confirmation, or your integration requires presenting payment methods separately. If you’ve already integrated with Elements, see the Payment Element migration guide.

Accepting OXXO in your app consists of displaying a webview to show the OXXO voucher. Customers pay by providing an OXXO voucher with a generated number and cash payment at an OXXO convenience store. Stripe notifies you when the payment is completed.

Set up Stripe
Server-side
Client-side

First, you need a Stripe account. Register now.

Server-side

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

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'

Client-side

The Stripe Android SDK is open source and fully documented.

To install the SDK, add stripe-android to the dependencies block of your app/build.gradle file:

build.gradle.kts
Kotlin
plugins { id("com.android.application") } android { ... } dependencies { // ... // Stripe Android SDK implementation("com.stripe:stripe-android:21.14.0") // Include the financial connections SDK to support US bank account as a payment method implementation("com.stripe:financial-connections:21.14.0") }

Nota

For details on the latest SDK release and past versions, see the Releases page on GitHub. To receive notifications when a new release is published, watch releases for the repository.

Configure the SDK with your Stripe publishable key so that it can make requests to the Stripe API, such as in your Application subclass:

Kotlin
import com.stripe.android.PaymentConfiguration class MyApp : Application() { override fun onCreate() { super.onCreate() PaymentConfiguration.init( applicationContext,
"pk_test_TYooMQauvdEDq54NiTphI7jx"
) } }

Nota

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

Stripe samples also use OkHttp and GSON to make HTTP requests to a server.

Create a PaymentIntent
Server-side
Client-side

A PaymentIntent is an object that represents your intent to collect payment from a customer and tracks the lifecycle of the payment process through each stage.

Server-side

Create a PaymentIntent on your server with an amount and the mxn currency (OXXO does not support other currencies). If you already have an integration using the Payment Intents API, add oxxo to the list of payment method types for your PaymentIntent.

Command Line
curl
curl https://api.stripe.com/v1/payment_intents \ -u
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:
\ -d "amount"=1099 \ -d "currency"="mxn" \ -d "payment_method_types[]"="oxxo"

Additional payment method options

You can specify an optional expires_after_days parameter in the payment method options for your PaymentIntent that sets the number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO voucher will expire on Wednesday at 23:59 America/Mexico_City (UTC-6) time. The expires_after_days parameter can be set from 1 to 7 days. The default is 3 days.

Client-side

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

Kotlin
class OXXOActivity: AppCompatActivity() { private lateinit var paymentIntentClientSecret: String private fun startCheckout() { // Request a PaymentIntent from your server and store its client secret } }

Collect payment method details
Client-side

In your app, collect the following required billing details from the customer. Create a PaymentMethodCreateParams with the billing details.

FieldValue
nameThe full name (first and last) of the customer. The first name and last name must each be a minimum of two characters.
emailThe full email address of the customer.
Kotlin
val billingDetails = PaymentMethod.BillingDetails(email = "email@email.com", name = "Jenny Rosen") val paymentMethodCreateParams = PaymentMethodCreateParams.createOxxo(billingDetails)

Submit the payment to Stripe
Client-side

Retrieve the client secret from the PaymentIntent you created in step 2 and call PaymentLauncher confirm. This presents a webview to display the OXXO voucher. Afterwards, onPaymentResult is called with the result of the payment.

Kotlin
class OXXOActivity : AppCompatActivity() { // ... private lateinit var paymentIntentClientSecret: String private val paymentLauncher: PaymentLauncher by lazy { val paymentConfiguration = PaymentConfiguration.getInstance(applicationContext) PaymentLauncher.Companion.create( this, paymentConfiguration.publishableKey, paymentConfiguration.stripeAccountId, ::onPaymentResult ) } private fun startCheckout() { // ... val confirmParams = ConfirmPaymentIntentParams .createWithPaymentMethodCreateParams( paymentMethodCreateParams = paymentMethodCreateParams, clientSecret = paymentIntentClientSecret ) paymentLauncher.confirm(confirmParams) } private fun onPaymentResult(paymentResult: PaymentResult) { when (paymentResult) { is PaymentResult.Completed -> { // The OXXO voucher was displayed successfully. // The customer can now pay the OXXO voucher at the OXXO convenience store. } is PaymentResult.Canceled -> { // handle cancel flow } is PaymentResult.Failed -> { // handle failures // (for example, the customer may need to choose a new payment // method) } } } }

Optional: Email voucher link to your customer

Stripe sends a payment_intent.requires_action event when an OXXO voucher is created successfully. If you need to email your customers the voucher link, you can retrieve the PaymentIntent to get the link upon receiving the event. The hosted_voucher_url field in payment_intent.next_action.oxxo_display_details contains the link to the voucher.

Optional: Customize your voucher

Stripe allows customization of customer-facing UIs on the Branding Settings page.

The following brand settings can be applied to the voucher:

  • Icon—your brand image and public business name
  • Accent color—used as the color of the Copy Number button
  • Brand color—used as the background color

Handle post-payment events
Server-side

OXXO is a delayed notification payment method, so funds are not immediately available. Customers might not pay for the OXXO voucher at an OXXO convenience store immediately after checking out.

Stripe sends a payment_intent.succeeded event on the next business day (Monday through Friday excluding Mexican holidays) for each OXXO voucher that was paid. Use the Dashboard or build a webhook handler to receive these events and run actions (for example, sending an order confirmation email to your customer, logging the sale in a database, or starting a shipping workflow).

After the expiry date, the PaymentIntent’s status transitions to processing and the customer can no longer pay for the expired OXXO voucher. If the OXXO voucher was not paid for before 23:59 America/Mexico_City (UTC-6) on the expiry date, Stripe sends a payment_intent.payment_failed event within 10 calendar days after the expiry date (in most cases, this event is sent within 7 calendar days). For example, if the OXXO voucher expires on September 1, this event is sent by September 10 at the latest.

EventDescriptionNext steps
payment_intent.requires_actionThe OXXO voucher is created successfully.Wait for the customer to pay for the OXXO voucher.
payment_intent.processingThe customer can no longer pay for the OXXO voucher.Wait for the payment to succeed or fail.
payment_intent.succeededThe customer paid for the OXXO voucher before expiration.Fulfill the goods or services that the customer purchased.
payment_intent.payment_failedThe customer did not pay for the OXXO voucher before expiration.Contact the customer through email or push notification and request another payment method.

Receive events and run business actions

Manually

Use the Stripe Dashboard to view all your Stripe payments, send email receipts, handle payouts, or retry failed payments.

  • View your test payments in the Dashboard

Custom Code

Build a webhook handler to listen for events and build custom asynchronous payment flows. Test and debug your webhook integration locally with the Stripe CLI.

  • Build a custom webhook

Test the integration

In a sandbox, set PaymentMethod.BillingDetails#email to the following values when you call Stripe# confirmPayment() to test different scenarios.

EmailDescription

{any_prefix}@{any_domain}

Simulates an OXXO voucher which a customer pays after 3 minutes and the payment_intent.succeeded webhook arrives after about 3 minutes. In production, this webhook arrives after 1 business day.

Example: fulano@test.com

{any_prefix}succeed_immediately@{any_domain}

Simulates an OXXO voucher which a customer pays immediately and the payment_intent.succeeded webhook arrives within several seconds. In production, this webhook arrives after 1 business day.

Example: succeed_immediately@test.com

{any_prefix}expire_immediately@{any_domain}

Simulates an OXXO voucher which expires before a customer pays and the payment_intent.payment_failed webhook arrives within several seconds.

The expires_after field in next_action.oxxo_display_details is set to the current time regardless of what the expires_after_days parameter in payment method options is set to.

Example: expire_immediately@test.com

{any_prefix}expire_with_delay@{any_domain}

Simulates an OXXO voucher which expires before a customer pays and the payment_intent.payment_failed webhook arrives after about 3 minutes.

The expires_after field in next_action.oxxo_display_details is set to 3 minutes in the future regardless of what the expires_after_days parameter in payment method options is set to.

Example: expire_with_delay@test.com

{any_prefix}fill_never@{any_domain}

Simulates an OXXO voucher which expires before a customer pays and the payment_intent.payment_failed webhook arrives after 1 business day and 2 calendar days. In production, this webhook arrives at the same time as in testmode.

Example: fill_never@test.com

Expiration and cancellation

OXXO vouchers expire after the expires_after UNIX timestamp and a customer can’t pay an OXXO voucher once it has expired. OXXO vouchers can’t be canceled before expiration.

After an OXXO voucher expires, the PaymentIntent’s status changes to requires_payment_method. At this point, you can confirm the PaymentIntent with another payment method or cancel.

¿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