#davidl-direct-charges
1 messages · Page 1 of 1 (latest)
That's what I thought, however, when I go to charge the card is says customer not found
That is likely because the customer and the card aren't both on the Connected Account
Or, you aren't passing the Stripe Account header when creating the charge
`$stripe = new StripeClient( env( 'STRIPE_SECRET' ) );
$customer = $stripe->customers->create( [
'source' => $source,
'email' => $invoice->deal->customer->email
], [ 'stripe_account' => $invoice->deal->company->stripe_connect_id ] );
$charge = $stripe->charges->create( [
'amount' => $amount,
'currency' => 'usd',
'customer' => $invoice->deal->customer->stripe_id,
'transfer_group' => $transfer_group,
'receipt_email' => $invoice->deal->customer->email,
'statement_descriptor' => 'Sod Project',
], [ 'stripe_account' => $invoice->deal->stripe_connect_id ] );`
Feel free to provide a request ID and I can take a look
Is there a reason you are using the Charges API and the Sources API versus the PaymentIntents API and the PaymentMethods API?
The Charges/Sources API are deprecated... I'd highly recommend using PaymentIntents and PaymentMethods
Yeah let me try to duplicate it. I deleted all my test data because I thought there might be some duplicate customer issues or something
Payment intent flow is much more integrated and intense. Was hoping to avoid it haha
It isn't any more complex
In fact, if you are planning on using multiple types of payment methods then it is much simpler
But if you already have an integration built then I understand using Charges/Sources
is all that the same/
ACH is not yet released for PaymentMethods yet, but it will be soon
If you are interested for early access you can reach out to our Support team
should I hold off on migrating until then?
If you are interested in migrating then I'd recommend reaching out to Support and asking about ACH on PaymentMethods!
ok cool
will do
I also plan on dynamically changing between direct charge and separate charge and transfer depending on the user. Is that supported with PI
Yep.
You would write the logic on your end just like you would with Charges API
But PaymentIntents can do everything Charges can (and much more)
PaymentIntents still use Charges under the hood
👍
Can you do payment intent with our own checkout form?
Yep
I'd take a look at https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements