#xuan.zhao
1 messages · Page 1 of 1 (latest)
hello! firstly, is there a reason why you're creating the SetupIntent with raw card details, and not using one of the Stripe components to collect card details instead?
sorry, i use setupintent collect card info , and i want save payment method id & customer id & fingerprint into my database, but i want save once with my account id, so i add this id in setupinent metadata, and i received setup_intent.created callback event with metadata success, but payment_method.attached missing that id
so
so, is any way can save metadata both setupintent metadata and payment method metadata
i learn from this https://stackoverflow.com/questions/60798579/stripe-metadata-not-in-response-webhook-net-core?rq=1 , can set checkoutsession and paymentintent so i gust this work for this scense
no, there's no such parameter for you to set on the SetupIntent such that metadata is also set on the created PaymentMethod automatically
oh, that's pity,any suggest with this question
i can save payment_method.attached without my id, and use setup_intent.successed metadata id update ,but i learn from this https://stripe.com/docs/webhooks/best-practices#event-ordering ,
i'm sorry, but i don't understand the question, can you try rephrasing?
yes ,please wait second
i have own my account id, and map with stripe customer id, then when list user card on my web site, i should get card info(egexpire year, ) from my database,
this have my account id <-> stripe customer <-> payment method id(i use for card id),this map i want from payment_method.attached callback event , now i have stripe customer <-> payment method id
because setupintent create payment method without setupintent meta
i don't understand why you need metadata on the PaymentMethod object. Logically, having it on the SetupIntent should be sufficient.
yes, i set metadata on setupintent already. but i want get all data from one callbak event , most data in payment_method.attached, except setupintent meatdata
i can post example , wait~
{
"object": {
"id": "pm_1MZREJJO74IH3aRdtF2dZImg",
"object": "payment_method",
"billing_details": {
"address": {
"city": null,
"country": "US",
"line1": null,
"line2": null,
"postal_code": "94080",
"state": null
},
"email": null,
"name": null,
"phone": null
},
"card": {
"brand": "visa",
"checks": {
"address_line1_check": null,
"address_postal_code_check": "pass",
"cvc_check": "pass"
},
"country": "US",
"exp_month": 1,
"exp_year": 2029,
"fingerprint": "7oaFBuaN5Crq0Z7z",
"funding": "credit",
"generated_from": null,
"last4": "4242",
"networks": {
"available": [
"visa"
],
"preferred": null
},
"three_d_secure_usage": {
"supported": true
},
"wallet": null
},
"created": 1675914927,
"customer": "cus_NGkUSmqw29gHpk",
"livemode": false,
"metadata": {
},
"type": "card"
}
}
this have card info & customer & payment method id, but metadata empty
{
"object": {
"id": "seti_1MZRDuJO74IH3aRdcsRzpjFJ",
"object": "setup_intent",
"application": null,
"cancellation_reason": null,
"client_secret": "seti_1MZRDuJO74IH3aRdcsRzpjFJ_secret_NK5O16fK5xepcXF6Yc46op8YFiK7n1D",
"created": 1675914902,
"customer": "cus_NGkUSmqw29gHpk",
"description": null,
"flow_directions": null,
"last_setup_error": null,
"latest_attempt": "setatt_1MZREJJO74IH3aRd4yoYipO2",
"livemode": false,
"mandate": null,
"metadata": {
"account_id": "123",
"uuid": "123"
},
"next_action": null,
"on_behalf_of": null,
"payment_method": "pm_1MZREJJO74IH3aRdtF2dZImg",
"payment_method_options": {
"card": {
"mandate_options": null,
"network": null,
"request_three_d_secure": "automatic"
}
},
"payment_method_types": [
"card"
],
"single_use_mandate": null,
"status": "succeeded",
"usage": "off_session"
}
}
this have metadata but no card info
it's not possible at the moment like i mentioned
you can retrieve the PaymentMethod upon receipt of the setup_intent.succeeded event if that works for you
yes, this is a good answer, can once request such as expanding so on
but you don't really need to imo. Whether you receive either event first is not important
when you receive the setup_intent.succeeded event first, you can log whatever info you have on hand to your DB first
later on, when you receive the payment_method.attached event, save the other details to your DB
and vice versa
emmmm, this is aws, i can use payment method id with bridge, both payment_method.attached and setup_intent.successed have this key
i'm not familiar with aws