Accéder directement au contenu
Créez un compte
ou
connecter-vous
Logo de la documentation Stripe
/
Demander à l'assistant IA
Créez un compte
Connectez-vous
Démarrer
Paiements
Revenus
Plateformes et places de marché
Gestion de fonds
Ressources pour les développeurs
Aperçu
À propos des paiements Stripe
Mettre votre intégration à niveau
Analyses des paiements
Paiements en ligne
PrésentationTrouver votre cas d'usageUse Managed Payments
Utiliser Payment Links
Utiliser une page de paiement préconfigurée
Build a custom integration with Elements
    Présentation
    Compare Checkout Sessions and PaymentIntents
    Quickstart guides
    Concevoir une intégration avancée
    Personnaliser l'apparence
    Gérer les moyens de paiement
      Accepter un paiement avec Express Checkout Element
      Ajouter des moyens de paiement personnalisés
      Personnaliser les moyens de paiement
      Migrer des moyens de paiement vers le Dashboard
    Collecter des informations supplémentaires
    Créer une intégration pour les abonnements
    Dynamic updates
    Ajouter des réductions
    Percevoir les taxes sur vos paiements
    Offrir aux clients la possibilité de payer dans leur devise locale
    Enregistrer et récupérer les moyens de paiement des clients
    Envoyer des reçus ou factures après paiement
    Approuver manuellement les paiements sur votre serveur
    Autoriser et capturer un paiement séparément
    Liste des modifications de la version bêta d'Elements avec l'API Checkout Sessions
Développer une intégration dans l'application
Moyens de paiement
Ajouter des moyens de paiement
Gérer les moyens de paiement
Paiement accéléré avec Link
Interfaces de paiement
Payment Links
Checkout
Elements pour le web
Paiements dans l'application
Scénarios de paiement
Gérer plusieurs devises
Tunnels de paiement personnalisés
Acquisition flexible
Orchestration
Paiements par TPE
Terminal
Au-delà des paiements
Constituez votre entreprise
Cryptomonnaies
Financial Connections
Climate
Comprendre la fraude
Radar pour la protection contre la fraude
Gestion des litiges
Vérifier l'identité
AccueilPaiementsBuild a custom integration with ElementsManage payment methods

Remarque

Cette page n'est pas encore disponible dans cette langue. Nous faisons tout notre possible pour proposer notre documentation dans davantage de langues et nous vous fournirons la version traduite dès qu'elle sera disponible.

Migrate payment methods to the Dashboard

Learn how to turn on payment methods for your Checkout Session in the Dashboard.

You can update your integration to use your payment method preferences from the Dashboard. This allows Stripe to display all compatible payment methods to your customers during checkout, depending on the chosen currency, location, or any payment method restrictions, such as maximum transaction amounts.

The checkout page shows payment methods known to increase conversion for your customer’s location, and hides other payment methods in an overflow menu. Customers can still choose from the payment methods in the overflow menu.

Update your integration

For existing Stripe Checkout integrations, you must remove the payment_method_types parameter to migrate payment methods preferences to the Dashboard. Doing so allows some payment methods to turn on automatically, including cards and wallets. The currency parameter restricts the payment methods your customers see in the Checkout Session.

Avertissement

When you upgrade your integration, non-default payment methods (such as bank redirects) are initially disabled. You must enable any payment methods you added to your Checkout integration from the payment methods settings page in the Dashboard.

server.rb
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
Stripe::Checkout::Session.create({ line_items: [ { price_data: { currency: 'eur', product_data: {name: 'T-shirt'}, unit_amount: 2000, }, quantity: 1, }, ], mode: 'payment', # Remove the payment_method_types parameter to manage payment methods in the Dashboard payment_method_types: ['card'], return_url: 'https://example.com/return', ui_mode: 'custom', })

View available payment methods in the Dashboard

You can view the payment methods that you currently accept from the payment methods settings in the Dashboard. The list includes payment methods that Stripe enables by default, such as cards.

You can also enable or disable individual payment methods, such as Apple Pay or Google Pay. With the Checkout Sessions API, Stripe evaluates the currency and any restrictions, then dynamically presents the supported payment methods to the customer.

For example, Apple Pay is enabled and Google Pay is disabled, by default. In some cases, Stripe might not show these payment methods, even if you enabled them. Stripe doesn’t show Google Pay if you enable automatic tax without collecting a shipping address.

To see how Stripe displays your payment methods to customers, enter a transaction ID or set an order amount and currency in the Dashboard.

Add or remove payment methods in your integration

Enable payment methods for your integration from the payment methods settings in the Dashboard. You can select Turn on to enable some payment methods. For payment methods that require additional steps, select Set up or Review terms.

Learn about which payment methods are right for your business from our payment methods guide.

(Recommended) Handle delayed notification payment methods

The payment method you integrate might have a delayed payment confirmation. If you set up webhooks to automatically fulfill orders, you might need to update your Checkout integration when you add your first payment method that has delayed notifications.

Mise en garde

This step is only required if you plan to use any of the following payment methods: Bacs Direct Debit, Bank transfers, Boleto, Canadian pre-authorized debits, Konbini, OXXO, Pay by Bank, SEPA Direct Debit, SOFORT, or ACH Direct Debit.

When receiving payments with a delayed notification payment method, funds aren’t immediately available. It can take multiple days for funds to process so you should delay order fulfillment until the funds are available in your account. After the payment succeeds, the underlying PaymentIntent status changes from processing to succeeded.

You’ll need to handle the following Checkout events:

Event NameDescriptionNext steps
checkout.session.completedThe customer has successfully authorized the debit payment by submitting the Checkout form.Wait for the payment to succeed or fail.
checkout.session.async_payment_succeededThe customer’s payment succeeded.Fulfill the purchased goods or services.
checkout.session.async_payment_failedThe payment was declined, or failed for some other reason.Contact the customer through email and request that they place a new order.

These events all include the Checkout Session object.

Update your event handler to fulfill the order:

Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
# Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys Stripe.api_key =
'sk_test_BQokikJOvBiI2HlWgH4olfQ2'
# You can find your endpoint's secret in the output of the `stripe listen` # command you ran earlier endpoint_secret = 'whsec_...' post '/webhook' do event = nil # Verify webhook signature and extract the event # See https://stripe.com/docs/webhooks#verify-events for more information. begin sig_header = request.env['HTTP_STRIPE_SIGNATURE'] payload = request.body.read event = Stripe::Webhook.construct_event(payload, sig_header, endpoint_secret) rescue JSON::ParserError => e # Invalid payload return status 400 rescue Stripe::SignatureVerificationError => e # Invalid signature return status 400 end case event['type'] if event['type'] == 'checkout.session.completed' checkout_session = event['data']['object'] fulfill_order(checkout_session) end when 'checkout.session.completed' checkout_session = event['data']['object'] # Save an order in your database, marked as 'awaiting payment' create_order(checkout_session) # Check if the order is already paid (for example, from a card payment) # # A delayed notification payment will have an `unpaid` status, as # you're still waiting for funds to be transferred from the customer's # account. if checkout_session.payment_status == 'paid' fulfill_order(checkout_session) end when 'checkout.session.async_payment_succeeded' checkout_session = event['data']['object'] # Fulfill the purchase... fulfill_order(checkout_session) when 'checkout.session.async_payment_failed' session = event['data']['object'] # Send an email to the customer asking them to retry their order email_customer_about_failed_payment(checkout_session) end status 200 end def fulfill_order(checkout_session) # TODO: fill in with your own logic puts "Fulfilling order for #{checkout_session.inspect}" end def create_order(checkout_session) # TODO: fill in with your own logic puts "Creating order for #{checkout_session.inspect}" end def email_customer_about_failed_payment(checkout_session) # TODO: fill in with your own logic puts "Emailing customer about payment failure for: #{checkout_session.inspect}" end

Testing

Ensure that stripe listen is still running. Go through Checkout as a test user, like you did in the prior steps. Your event handler should receive a checkout.session.completed event, and you should have successfully handled it.

Now that you’ve completed these steps, you’re ready to go live in production whenever you decide to do so.

Test your integration

Card numberScenarioHow to test
The card payment succeeds and doesn’t require authentication.Fill out the credit card form using the credit card number with any expiration, CVC, and postal code.
The card payment requires authentication.Fill out the credit card form using the credit card number with any expiration, CVC, and postal code.
The card is declined with a decline code like insufficient_funds.Fill out the credit card form using the credit card number with any expiration, CVC, and postal code.
The UnionPay card has a variable length of 13-19 digits.Fill out the credit card form using the credit card number with any expiration, CVC, and postal code.

See Testing for additional information to test your integration.

Cette page vous a-t-elle été utile ?
OuiNon
  • Besoin d'aide ? Contactez le service Support.
  • Rejoignez notre programme d'accès anticipé.
  • Consultez notre log des modifications.
  • Des questions ? Contactez l'équipe commerciale.
  • LLM ? Lire llms.txt.
  • Propulsé par Markdoc