#thesarimbhatti

1 messages · Page 1 of 1 (latest)

still oakBOT
crimson aspen
#

hi! what can I help with exactly?

true flame
#

$paymentIntent = \Stripe\PaymentIntent::create([ 'amount' => $cents, 'currency' => 'usd', 'customer' => $customer_id, 'payment_method_types' => ['card'], 'payment_method' => $payment_method->id, "statement_descriptor_suffix" => $item->stripe_statement_descriptor, 'application_fee_amount' => $connect_cents, 'confirm' => true, 'metadata' => ['reg_id' => $rp_id], 'setup_future_usage' => 'off_session' ], [ 'stripe_account' => $item->stripe_connect_account_id, ]);

#

this is how I am creating payment intent

#

but the declined payent with this message

#

"The payment method you provided is attached to a customer so for security purpose you must provide the customer in the request."

crimson aspen
#

log the value of $customer_id, it's probably null.

true flame
#

It give me that error sometimes

crimson aspen
#

the error is basically that you need to pass the cus_xxx ID of the customer that the PaymentMethod is attached to. So with that code you mention, it would happen if the $customer_id variable is null, so I imagine that's the problem.

true flame
#

ok let me see and one more thing

#

please guide me about this message

#

actually I am saving customer card token to use if for future payment and when I tried to charge that customer the payment remain incomplete

crimson aspen
#

that can happen, sometimes an off-session payment on a saved card can require 3D Secure.

true flame
#

how can I avoid the 3D Secure ?

crimson aspen