No such customer: cus_************ (Stripe::InvalidRequestError) when customer exists

The problem is that the customer exists on the platform's account, but not on the connected account you're trying to create the charge on.

You need to share the customer from the platform account to the connected account:

# Create a token from the customer on the platform account
token = Stripe::Token.create(
  {:customer => "cus_7QLGXg0dkUYWmK"},
  {:stripe_account => "acct_17BTxDCioT3wKMvR"}
)

# Retrieve the order on the connected account and pay it using the token
order = Stripe::Order.retrieve("or_17BUNHCioT3wKMvREWdDBagG",
  stripe_account: "acct_17BTxDCioT3wKMvR"
)
order.pay(source: token.id)

This can also happen if you use the wrong APiKey