Accept a PayPal payment
Learn how to accept PayPal payment, a digital wallet popular with businesses in Europe.
Cuidado
A Stripe pode apresentar automaticamente as formas de pagamento relevantes aos seus clientes avaliando moedas, restrições de formas de pagamento e outros parâmetros.
- Siga o guia Aceitar um pagamento para elaborar uma integração de checkout que usa formas de pagamento dinâmicas.
- Se você não quiser usar o formas de pagamento dinâmico, siga as etapas abaixo para configurar manualmente as formas de pagamento em sua integração de checkout.
Stripe Checkout shows PayPal either as a standard payment method or as a standalone button, depending on which option is more likely to increase the conversion rate.
Verificar a compatibilidade
A Checkout Session must satisfy all of the following conditions to support PayPal payments:
- Os preços de todos os produtos incluídos no checkout precisam estar na mesma moeda. Se você tiver produtos em moedas diferentes, crie sessões do Checkout separadas para cada moeda.
Aceitar um pagamento
Nota
Crie uma integração para aceitar um pagamento com o Checkout antes de usar este guia.
This guides you through enabling PayPal and shows the differences between accepting payments using dynamic payment methods and manually configuring payment methods.
Enable PayPal as a payment method
When creating a new Checkout Session, do the following:
- Add
paypalto the list ofpayment_.method_ types - Make sure all your
line_use the same currency.items
Executar pedidos
After accepting a payment, learn how to fulfill orders.
Teste sua integração
You don’t need to connect your PayPal business account to test the integration. However, make sure to connect your PayPal and Stripe accounts when you’re ready to activate live mode payments.
When Checkout shows the PayPal button, you need a personal PayPal Sandbox account to complete the test payment. If Checkout lists PayPal as a payment method instead, select PayPal and click Pay—no PayPal Sandbox account is required.
To simulate the most common integration and failure scenarios for PayPal payments, pass email values that match the patterns described in these test scenarios.
Test scenarios
| Email pattern | Cenário | Explicação |
|---|---|---|
. | Merchant account restricted | Capturing or authorizing a payment fails with a payment_ error if your merchant account is restricted by PayPal. Provide an email matching this pattern at time of authorization to fail the authorization. |
. | Transaction refused | Capturing a payment fails with a payment_ error if the transaction is refused by PayPal. |
. | Payment instrument declined | Capturing a payment fails with a payment_ error if the instrument presented was either declined by the processor or bank, or it can’t be used for this payment. |
. | Manually capturing an authorized payment | Capturing an authorized payment fails with a capture_ error if the authorization has already expired. |