#sarvesh3742

1 messages · Page 1 of 1 (latest)

distant wingBOT
#

Hello! We'll be with you shortly. 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.

silent tartan
#

How can I help?

stray mantle
#

I have subscribed to basic plan and then tried to update the plan to premium but on payment getting some error
v3/?ver=1.1:1 Uncaught IntegrationError: Invalid value for elements(): clientSecret should be a client secret of the form ${id}secret${secret}.

#

but on stripe I can see Premuim subscription is already active without taking card details from user

#

sub_1OWD81HbAvQl6Cwug5bb2ygB

silent tartan
#

Looks like you didn't specify a client secret to elements.

#

I'd suggest you check your code and make sure it uses a valid client secret

stray mantle
#

<script src="https://js.stripe.com/v3/?ver=1.1"></script>

var stripeSecret = "<?php echo $data['stripeSecret']; ?>";
var stripeKey = "<?php echo $data['stripeKey']; ?>";
const stripe = Stripe(stripeKey);
const options = {
clientSecret: "<?php echo $data['paymentIntentClientSecret']; ?>",
// Fully customizable with appearance API.
appearance: {
/.../
theme: 'stripe',
},
locale: 'en',
};

#

client secret is already provided and already subscribed to basic subscription, when I try to update the subscription with another plan that time this error comes and without taking payment data, stripe showing that plan is active in dashboard

silent tartan
#

The subscription can still use its default payment method after being updated. So there's no need to collect a payment method after subscription update.

stray mantle
#

oh i see, so instead of sending user to payment data page, what should show? that we are processing your update plan request and once the webhook event is received, process and directly update it?

#

$subscription = $stripe->subscriptions->update($subscriptionData['stripe_subscription_id'],[
'items' => [[
'id' => $subscriptionData['subscription_item_id'],
'price' => $stripePriceId,
]],
'metadata' => $metaData,
'billing_cycle_anchor'=>'unchanged',
'payment_behavior' => 'default_incomplete',
]);

#

this is update subscription call, is this fine or need any changes in it?

stray mantle
#

?

silent tartan
#

Thanks for waiting, discord is busy today.