#tobin_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1343519103712755742
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- tobin_code, 3 days ago, 16 messages
- tobin_webhooks, 4 days ago, 75 messages
- tobin_webhooks, 5 days ago, 16 messages
ok wait
am a wordpress plugin developer this issue reported by our client.
i can't do the live test how can replicate the issue using test mode
I don't understand. you mendionned failed payments. can you share an example PaymentIntent ID so I can look into it?
my client experience the issue who is stripe plugin by webtoffee he is experiencing issue in checkout page as in screenshot
when will this error raise? how to fix it?
the error you shared is pretty clear, and contains a link to learn more about this. have you read that doc?
ys already done the changes as per documentation still issue exists
I would need a specific PaymentIntent ID (pi_xxx) with this issue to look into it
this issue is experienced by my client he won't share it
this is my code
public function save_cards_for_later($payment_details, $my_account_page = false) {
if ($payment_details) {
if (!$my_account_page) {
$response = $payment_details->payment_method_details;
$token = $payment_details->payment_method;
} else {
$response = $payment_details;
$token = $payment_details->id;
}
// Get the logged-in user's Stripe customer ID
$user_id = get_current_user_id();
$customer = get_user_meta($user_id, '_stripe_customer_id', true);
// If no customer ID is found, create a new Stripe customer
if (!$customer) {
$user = get_userdata($user_id);
$customer_data = [
"email" => $user->user_email,
"name" => $user->first_name . " " . $user->last_name,
];
// Search for existing Stripe customer
$existing_customers = \Stripe\Customer::all([
'email' => $customer_data['email'],
'limit' => 1,
]);
if (!empty($existing_customers->data)) {
$stripe_customer = $existing_customers->data[0];
} else {
// Create a new Stripe customer if none exists
$stripe_customer = \Stripe\Customer::create($customer_data);
}
if (!$stripe_customer || empty($stripe_customer->id)) {
throw new Exception(__('Failed to create or retrieve Stripe customer.', 'eh-stripe-gateway'));
}
$customer = $stripe_customer->id;
update_user_meta($user_id, '_stripe_customer_id', $customer);
}
// Check if the card is issued in India
$is_indian_card = ($response->card->country === 'IN');
// Create a SetupIntent for Indian cards
if ($is_indian_card) {
$intent_args = [
'payment_method' => $token,
'customer' => $customer,
'confirm' => true,
'payment_method_types' => ['card'],
'usage' => 'off_session', // Required for saving cards in India
];
$setup_intent = \Stripe\SetupIntent::create($intent_args);
if ($setup_intent->status !== 'succeeded') {
throw new Exception(__('3DS authentication required for Indian cards.', 'eh-stripe-gateway'));
}
$wc_token = new WC_Payment_Token_CC( );
$wc_token->set_token( $token );
$wc_token->set_gateway_id( $this->id );
$wc_token->set_card_type( strtolower( $response->card->brand ) );
$wc_token->set_last4( $response->card->last4 );
$wc_token->set_expiry_month( $response->card->exp_month );
$wc_token->set_expiry_year( $response->card->exp_year );
$wc_token->set_user_id( get_current_user_id() );
$wc_token->save();
}
}
return true;
}
this is my code
hi can u check my code fix the issue
๐ taking over for my colleague. Let me catch up.
for RBI reasons you need to create mandates for recurring payments for customers in India https://docs.stripe.com/india-recurring-payments#integration
this is happening in normal payment not sure about recuring
would you mind sharing a PaymentIntent ID then?
you need to look into the dashboard for the request ID https://support.stripe.com/questions/finding-the-id-for-an-api-request or for the PaymentIntent ID
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
this issue is reported by client they don't shate PaymentIntent ID
you can search for the PaymentIntent ID on the dashboard
do u have any other suggestion to fix the issue without knowing PaymentIntent ID
I can't know what the issue is without the PaymentIntent ID or the request ID or the Charge ID
anything that references that particular payment
i will share this with my client let me know what all things need for u to debug the issue?
PaymentIntent ID or the request ID or the Charge ID
just that would be enough
I'm not sure what the issue is to be able to know whether you can replicate it or not
I think you need to update the way you're integrating with Stripe
it seems you're using tokens and PaymentMethods
you need to change the integration to https://docs.stripe.com/payments/save-and-reuse