Skip to content

Lesson 3 of 9 · 25m

Authentication, Payment Methods, and PayPal Edge Cases

Handle 3DS and next-action flows, understand payment-method-specific behavior, and avoid the approval-versus-capture mistakes that plague PayPal integrations.

A payment can be technically valid and still incomplete because the customer must authenticate it. Teams that test only the happy path interpret requires_action as failure, drop the user into a dead end, or worse, provision goods before authentication finishes. In production, payment state is asynchronous even when the API call looks synchronous.

requires_action is a continuation, not an error

Stripe confirmation can return a PaymentIntent requiring next action:

{
  "status": "requires_action",
  "next_action": {
    "type": "redirect_to_url",
    "redirect_to_url": {"url": "https://hooks.stripe.com/..."}
  }
}

Your client must complete that action, usually with Stripe.js or by redirecting. After authentication, the intent may become processing before it becomes succeeded. Bank redirects, 3DS, and some local payment methods are not instant.

Payment methods do not share one behavioral model

Cards, bank debits, wallets, buy-now-pay-later, and local methods differ in reversal windows, settlement timing, dispute rules, and synchronous guarantees:

cards             immediate authorization, possible later capture/settlement
SEPA/bank debit   delayed failure risk after apparent success
wallets           usually fast but still method-dependent
redirect methods  customer leaves and returns asynchronously
PayPal            approval then capture, with possible authorization expiry

The practical rule is simple: fulfillment follows final confirmed state, not a button press and not merely a created payment object. For delayed methods, use a pending entitlement or clear customer messaging until settlement risk is acceptable.

PayPal approval is not capture

The bad sequence looks like this:

customer approves in PayPal popup
frontend marks order paid
browser closes before capture request
customer thinks they paid; merchant has no capture

The safer sequence is server-side capture after approval, followed by webhook or capture verification. If capture returns INSTRUMENT_DECLINED, the user can often retry. If capture is interrupted, query the capture or order status before retrying with a new idempotency identity.

Save cards only when the product truly needs it

Saving payment methods increases scope, lifecycle complexity, and customer support burden. Use setup_future_usage or SetupIntents only for subscriptions, one-click purchasing, or genuinely expected reuse. Do not store payment methods merely because the API makes it possible.

Test authentication abandonment

The customer can close the tab during 3DS, fail authentication, lose connectivity on a bank redirect, or return after your order expired. Your UI should recover by querying server-side order state, not by trusting browser memory.

Field notes

  • processing is not failure; do not cancel or duplicate-charge merely because settlement is pending.
  • Bank-based methods can appear successful and later fail; fulfillment policy must match settlement risk.
  • A successful authorization is not the same thing as captured money.
  • PaymentMethod objects are not charge objects. Saving a card does not mean a payment happened.
  • Support staff need a timeline of provider status transitions, not just the current status.

Was this lesson helpful?

Sign in to rate