#papiwablo - additional cards

1 messages ยท Page 1 of 1 (latest)

dapper bobcat
#

Hi.

harsh jay
#

hey again

#

ive got the setup intent stuff working with my backend folks. we want to test multiple card scenarios, so we need to add multiple cards

#

whats the recommended best practice to add multiple cards for future use?

dapper bobcat
#

Hmmmm...I think I read something on that just this morning. Let me check.

#

Sorry that was related to Checkout Sessions.

#

So what is the scenario you are wanting to test? A single customer with multiple cards?

#

All saved for future use?

harsh jay
#

Yes!

#

Sorry for the delay

#

Had to drive home ๐Ÿ™‚

dapper bobcat
#

Hi okay, looking into this.

harsh jay
#

i was hoping a setupintent over and over again would do

dapper bobcat
#

I was just about to test that.

#

I don't see anything specifically saying you can't

#

Actually I'm pretty sure you can based on one of my test customers

harsh jay
#

does it override the default card?

dapper bobcat
#

It does not.

harsh jay
#

then its gotta be failing on the ios side with the drop in code examples

#

ill have to pull the error for ya -- but it says somethign to the effect of "setupintent has already happened so it cant happen again"

#

when clearly you just did a bunch of setup intents

dapper bobcat
#

Okay but that error sounds like the code may be trying to re-use the setup Intent.

#

BTW I just created another one with a different expiration date to double check the overwrite on the default. Default is still the same:

harsh jay
#

ok great

#

so i think this points me in the correct direction to start

#

at least i know the best practice for setup intent over and over is the best practice for adding additional cards

dapper bobcat
#

Yeah, I would just make sure a new SetupIntent is being created for each new card.

harsh jay
#

can we keep this thread open and let me get back to you with the error?

dapper bobcat
#

I'll be hopping off but @lethal grove will be here

lethal grove
#

๐Ÿ‘‹

harsh jay
#

hi there -- ill pop open ye macbook here shortly

lethal grove
#

Sure

#

At a quick glance, I think your error occurred when you retried a SetupIntent. SetupIntent only can be confirmed once (it's one time object), but you def can create multiple SetupIntent to add multiple Card to a same Customer

#

And it is not overriding default for sure

harsh jay
#

so i think you are correct

#

2022-01-26 17:39:22.428360-0600 nom[50885:691221] LOG ANALYTICS: ["bindings_version": "21.7.0", "event": "mc_complete_init_customer", "os_version": "14.4", "additional_info": [], "apple_pay_enabled": 1, "device_type": "x86_64", "app_version": "1.0", "publishable_key": "pk_test_51JDWTTL6jsOpWNAQGXADflKOrNobu3QpR1vyc3Hsdy84K16G9NGBfnTcfK2HMYMF3y8LSpuuPhWWJxLHxWi8F34V00YvPoRlf9", "ui_usage_level": "partial", "analytics_ua": "analytics.stripeios-1.0", "app_name": "nom", "is_development": true, "ocr_type": "none", "product_usage": ["PaymentSheet"]]
Payment failed: unknown(debugDescription: "PaymentSheet received SetupIntent that is already completed!")

#

the reason for this, is when a new user logs in, we auth with Cognito, and then automatically kick off a setupintent on the back end and those credentials are forwarded to me and then i capture the card info and send it to you guys so my back end guys can set it up to charge once an order has been verified complete

#

so each setup intent requires a new setupIntentClientSecret, customerEphemeralKeySecret

lethal grove
#

Yes

harsh jay
#

well then i think my issue has been handled

#

i appreciate your time

lethal grove
#

np and good luck ๐Ÿ™‚