Created
July 21, 2020 22:27
-
-
Save cjavilla-stripe/462b7e124b7b4a9bd602bd7ebe054d1e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$customer = \Stripe\Customer::create([ | |
'email' => '[email protected]', | |
'payment_method' => 'pm_card_visa', | |
'invoice_settings' => [ | |
'default_payment_method' => 'pm_card_visa', | |
], | |
]); | |
$connectCustomer = \Stripe\Customer::create([ | |
'email' => '[email protected]', | |
], ['stripe_account' => $acct]); | |
$connectPaymentMethod = \Stripe\PaymentMethod::create([ | |
'customer' => $customer->id, // ID of the customer on the platform account. | |
'payment_method' => $customer->invoice_settings->default_payment_method, // ID of the PaymentMethod on your platform account | |
], ['stripe_account' => $acct]); | |
$paymentIntent = \Stripe\PaymentIntent::create([ | |
'payment_method_types' => ['card'], | |
'amount' => 1000, | |
'currency' => 'usd', | |
'application_fee_amount' => 222, | |
'payment_method' => $connectPaymentMethod->id, | |
'customer' => $connectCustomer->id, | |
'setup_future_usage' => 'off_session', | |
'confirm' => true, | |
'metadata' => [ | |
'need_id' => 'x', | |
], | |
], ['stripe_account' => $acct]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment