#.fallenblade

1 messages · Page 1 of 1 (latest)

torn shellBOT
frozen herald
#

hello! did you create and attach a card to the customer?

wind crown
#

How do you attach a card to the customer? I thought it will be automatically attached once the payment succeeded?

frozen herald
#

then can you share the PaymentIntent id where you collected payment? I'll be able to take a closer look at what you're doing from that

wind crown
#

Okay, here:

{
  "id": "pi_3O60dgDbxJ8mKm370G0qa6Jr",
  "object": "payment_intent",
  "amount": 100,
  "amount_details": {
    "tip": {
    }
  },
  "automatic_payment_methods": null,
  "canceled_at": null,
  "cancellation_reason": null,
  "capture_method": "automatic",
  "client_secret": "pi_3O**********************_******_*********************CxvN",
  "confirmation_method": "automatic",
  "created": 1698453872,
  "currency": "usd",
  "description": "Subscription creation",
  "last_payment_error": null,
  "livemode": false,
  "next_action": null,
  "payment_method": "pm_1O60diDbxJ8mKm37X7rR7HFr",
  "payment_method_configuration_details": null,
  "payment_method_options": {
    "us_bank_account": {
      "verification_method": "automatic"
    }
  },
  "payment_method_types": [
    "card",
    "cashapp",
    "link",
    "us_bank_account"
  ],
  "processing": null,
  "receipt_email": "******@gmail.com",
  "setup_future_usage": "off_session",
  "shipping": null,
  "source": null,
  "status": "succeeded"
}
frozen herald
#

The PaymentMethod is already attached to the customer. It's saved as the default_payment_method on the Subscription because you set payment_settings.save_default_payment_method = on_subscription [0]

[0] https://stripe.com/docs/api/subscriptions/object#subscription_object-payment_settings-save_default_payment_methodpay