#hchen
1 messages · Page 1 of 1 (latest)
Hello! Not sure what you mean by "trying to migrate these to PaymentMethod". Can you provide more details about what you're doing?
So, for attached Sources (like regular credit cards) we can do things like
PaymentMethod.retrieve("src_123").
For the native Sources like Apple pay, that doesn't work because those Sources don't get attached to a Customer.
You can attach an Apple Pay Source to a Customer... sorry, I'm not sure I follow. Can you give me a request ID showing the problem or something like that? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
I see...I was under the impression that apple/google pay do not get attached to Customers because they are one time tokenized payment methods.
Here's an example request ID:
req_GHDOQUTRyhK4kS
You should still be able to retrieve this Source using the Sources API. Will that work for your use case?
We can retrieve it using the Sources API, but since that API is now deprecated, we are trying to migrate to the PaymentMethods API.
As the error indicates, you can only retrieve a Source as a Payment Method if it's attached to a Customer. What's your use case for retrieving a Source which isn't attached to a Customer?
Our use case is getting that underlying type of that Source, because we handle different payment method types differently.
Right, but why? If it's not attached to a Customer you can only use it once, so wouldn't these already be used up?
So two example use cases:
- During checkout, we want to know the type of the Source to proceed differently (i.e. Authorize fully, partially, etc).
- When creating a PaymentIntent, we need to put a different parameter for types like Apple/Google pay.
You should create Payment Methods, not Sources. Then you'll be able to retrieve them with the Payment Methods API regardless of them being attached to a Customer.
That is the eventual goal, but we are migrating incrementally and are trying to be as safe as possible. Right now, we're just trying to read Sources as PaymentMethods, because we thought it would be a relatively easy change.
We can't get front end, android, ios, and our backend to all migrate to PaymentMethod in one go
Gotcha. In that case you'll need to use the Sources API to retrieve the Sources not attached to a Customer.
Right, so my questions are:
- Is there any advice from Stripe's side for doing this migration?
- I guess I'm also a little unclear what's stopping us from being able to retrieve an unattached Source as PaymentMethod?