#xuan.zhao

1 messages · Page 1 of 1 (latest)

young pagodaBOT
turbid stump
#

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?

elfin heart
#

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

turbid stump
#

no, there's no such parameter for you to set on the SetupIntent such that metadata is also set on the created PaymentMethod automatically

elfin heart
#

oh, that's pity,any suggest with this question

turbid stump
#

i'm sorry, but i don't understand the question, can you try rephrasing?

elfin heart
#

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

turbid stump
#

i don't understand why you need metadata on the PaymentMethod object. Logically, having it on the SetupIntent should be sufficient.

elfin heart
#

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

turbid stump
#

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

elfin heart
#

yes, this is a good answer, can once request such as expanding so on

turbid stump
#

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

elfin heart
#

emmmm, this is aws, i can use payment method id with bridge, both payment_method.attached and setup_intent.successed have this key

turbid stump
#

i'm not familiar with aws

elfin heart
#

thanks a lot😀

#

awesome~