Created
September 3, 2014 19:11
-
-
Save matthewarkin/8043e9a7f5d3ccf18f7f to your computer and use it in GitHub Desktop.
Stripe transfer customers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Read through the Stripe Connect Getting Started Guide. | |
https://stripe.com/docs/connect/getting-started | |
Create a Stripe Connect App in your dashboard. | |
Get a Stripe connect code from for the account you want to transfer customers to | |
Then get an access token using that account (instructions in the getting-started guide). | |
Sweet, now we can make API calls on the account we are transfering customers to. | |
Read through the Shared Customers doc. https://stripe.com/docs/connect/shared-customers | |
Here's some psuedo code: | |
foreach Stripe_Customer customer in CustomersIWantToTransfer | |
cardToken = Stripe::Token.create( | |
{:customer => customer.id}, | |
ACCESS_TOKEN # user's access token from the Stripe Connect flow | |
) | |
//create a new customer in the stripe account you are transfering to. | |
//link them with cardToken to transfer over the card | |
Stripe::Customer.create( | |
{:email=> customer.email, :description => customer.description, | |
:card=> cartToken}. | |
ACCESS_TOKEN | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment