#hchen

1 messages · Page 1 of 1 (latest)

sweet grottoBOT
wheat swan
#

Hello! Not sure what you mean by "trying to migrate these to PaymentMethod". Can you provide more details about what you're doing?

floral robin
#

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.

wheat swan
floral robin
#

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

wheat swan
#

You should still be able to retrieve this Source using the Sources API. Will that work for your use case?

floral robin
#

We can retrieve it using the Sources API, but since that API is now deprecated, we are trying to migrate to the PaymentMethods API.

wheat swan
#

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?

floral robin
#

Our use case is getting that underlying type of that Source, because we handle different payment method types differently.

wheat swan
#

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?

floral robin
#

So two example use cases:

  1. During checkout, we want to know the type of the Source to proceed differently (i.e. Authorize fully, partially, etc).
  2. When creating a PaymentIntent, we need to put a different parameter for types like Apple/Google pay.
wheat swan
#

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.

floral robin
#

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

wheat swan
#

Gotcha. In that case you'll need to use the Sources API to retrieve the Sources not attached to a Customer.

floral robin
#

Right, so my questions are:

  1. Is there any advice from Stripe's side for doing this migration?
  2. I guess I'm also a little unclear what's stopping us from being able to retrieve an unattached Source as PaymentMethod?