Hi Bruce,
The code you are using to create a charge:
charge = Stripe::Charge.create({
:amount => amount, # amount in cents, again
:currency => "usd",
:customer => CUSTOMER_ID
:card => CARD_ID,
:description => params[:email]
}, ACCESS_TOKEN)
should not be using the CUSTOMER_ID and CARD_ID from account A. You can only
use CUSTOMER_ID and CARD_ID to create a Token in the connected account
B, but you cannot use CUSTOMER_ID and CARD_ID directly in account B (since
that customer only exists in account A).
If you want to make a copy of the Customer in account B, you should
create a Customer in account B from the token you created (which copies over
details from the shared customer):
customerInAccountB = Stripe::Customer.create({
card:
token.id
}, ACCESS_KEY)
and then charge that customer:
Stripe::Charge.create({
:amount => amount, # amount in cents, again
:currency => "usd",
:customer => customerInAccountB.id,
:description => params[:email]
}, ACCESS_KEY)
Otherwise, if you just want to do a one-off Charge without
saving a copy of the shared Customer, use the token directly:
Stripe::Charge.create({
:amount => amount, # amount in cents, again
:currency => "usd",
:card =>
token.id,
:description => params[:email]
}, ACCESS_KEY)
Hope this helps clear things up!
Cheers,
Vlad