Skip to content

Instantly share code, notes, and snippets.

@appsgenii
Created January 26, 2016 01:40
Show Gist options
  • Select an option

  • Save appsgenii/8e34024073cdd2d9468f to your computer and use it in GitHub Desktop.

Select an option

Save appsgenii/8e34024073cdd2d9468f to your computer and use it in GitHub Desktop.
# 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