I am trying to customize the following with Stripe:
- Primary Account
- Several sub-accounts (i.e. connected to the Master account through the Stripe Connect application)
- Include payments that must be made to the sub-account, with the interest rate charged to the main account for the transaction.
I created a primary account and a child account. I connected the child account to the master account through Stripe Connect. I received and saved access_token and refresh_token at the end of the Stripe Connect process.
When payments are made, one payment may cover several elements. I have the following code (PHP) for processing a payment:
Stripe_Charge::create(array( "amount" => $amt, "currency" => "EUR", "source" => $stripeCardToken, "description" => $description), "application_fee_percent" => 0.5 ), $stripeAccessToken );
This is put in a loop for each billable item. It is also in a try / catch block with many Stripe exception exceptions. However, this method fails without any error.
Is this the correct class method? Source field for credit card token? Is there a way to track amounts paid against multiple items without using a loop? Is $stripeAccessToken sub-account access_token returned from a Connect or refresh_token process? Or is it the main public / private key? Or something different? Can I use this format for $ stripeAccessToken, or do I need to use Stripe::setApiKey($stripeAccessToken) before the loop?
Both Master and sub-accounts currently use a test environment and a fake card, but I would also like to test direct transactions.
source share