I am working on an E-Commerce market place called foodsy. I am using stripe connect for the purpose. Connected accounts are created using stripe-connect-omniauth. And foodsy has several customers. An order for an Sku is created in rails controller by
Stripe.api_key = "sk_test_o9YlLXk88Df4N2dmsdQtPEqZ"
Stripe::Order.create(
{:currency => 'usd',
:items => [
{
:type => 'sku',
:parent => "sku_7QKrhZJcqcuWBN"
}
] },
{ :stripe_account => "acct_17BTxDCioT3wKMvR" }
)
It creates an order with id or_17BUNHCioT3wKMvREWdDBagG .
The customer who exist on the foodsy platform buys it ,
order=Stripe::Order.retrieve("or_17BUNHCioT3wKMvREWdDBagG",stripe_account: "acct_17BTxDCioT3wKMvR")
order.pay(customer: "cus_7QLGXg0dkUYWmK")
But this code returns an error No such customer: cus_7QLGXg0dkUYWmK (Stripe::InvalidRequestError).
The customer exist as I can see him on dashboard and source attribute is set on stripe. So why is it going wrong ?