Anyone know how to deal with this? Ideally my Stripe account will be the base to take payments to use the service then I want to store users stripe keys to be able to their own stripe in order to collect payments.
Using Stripe as two instances....
Hi all,
I wanting to use Stripe to charge for a SaaS app, but also allow the users who have an account by able to use Stripe also to charge their customers. Is there a valid way to achieve this? With out having conflicting stripe keys :)
@theUnforgiven It sounds like a use case for Stripe Connect.
You would allow your SaaS customers to attach a Stripe account to their account (essentially an OAuth flow). You’ll then get publishable and secret keys for their accounts that’ll you need to use when initialising the Stripe SDK, so the end customer pays your customer’s Stripe account, and not your own Stripe account.
<script src="https://js.stripe.com/v3/"></script>
<script>
var stripe = Stripe('{{ $customer->stripe_publishable_key }}');
</script>
Alternatively, you can use your own publishable key when creating the token, but specify the customer’s account ID as the destination parameter when creating the charge and also optionally charging an application fee:
$charge = \Stripe\Charge::create([
'amount' => 1000, // £10.00
'currency' => 'gbp',
'application_fee' => 100, // Take £1.00 as an application fee
'destination' => $customer->stripe_account_id,
'source' => $request->input('stripe_token'),
]);
Please or to participate in this conversation.