Created
January 26, 2016 01:40
-
-
Save appsgenii/8e34024073cdd2d9468f to your computer and use it in GitHub Desktop.
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
| # I am using Stripe Connect and stroing Customers to my account | |
| # Get Customer from Stripe | |
| stripe_customer = Stripe::Customer.retrieve(stripe_customer_id) | |
| # From AliPay Checkout I got stripeToken e.g. atok_asjdasalkj | |
| strip_alipay = stripe_customer.sources.create({ source: params[:stripeToken] }) | |
| # I saved strip_alipay.id for future use | |
| stripe_token = Stripe::Token.create( | |
| { | |
| customer: member_profile.stripe_customer_id, | |
| card: strip_alipay.id | |
| }, | |
| payment_gateway.stripe_access_token | |
| ) | |
| # Stripe::InvalidRequestError (Customer cus_7ms8Ht5jfgvgNE does not have card with ID aliacc_17XLipA0l6PwmVzerLmnijth): |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment