2
votes

I am trying to migrate customers and their saved CC data from one ecommerce platform to another (SquareSpace to WooCommerce). Both platforms are using Stripe as a payment Gateway. The ecommerce site sells subscription products, and we are hoping to be able to move our customer data over without having them having to re-enter their payment information.

In the legacy platform when a subscription order is placed by credit card, a customer is created in Stripe and a Payment Method Object is created and attached to the customer.

In the new platform when a subscription order is placed by credit card, a customer is created in Stripe and a Sources Object is created and attached to the customer.

I am trying to figure out a way to be able to take the old data we have (a customer and a payment method object), and from that create a source object and either attach it the existing customer, or if needed we can create a new customer and attach it to them.

Does anyone know the Stripe well enough to know if this is possible, and if possible could you point me in the right direction? I have read their docs several times but am still not sure if this is even possible or not.

1

1 Answers

1
votes

The PaymentMethod API is the newer abstraction from Stripe which launched in 2018. This unifies all the legacy objects such as Card or Source under a better abstraction that is more scalable. New payment method types have been exclusively built on PaymentMethod since 2019.

When the API was released, Stripe worked on a compatibility layer that ensured legacy Card or Source objects automatically worked as a PaymentMethod. This means that if you have a card_123 or src_123 object attached to a customer, you can access it as a PaymentMethod via the API and it just works the same and is compatible with PaymentIntent, SetupIntent and all future APIs.

Unfortunately, there is no way to convert a pm_123 object back into a Source or Card. This is just not something supported. You'd either need to collect card details again or work with WooCommerce to support the newer APIs since they have been released for over 2 years now.