#rups

1 messages · Page 1 of 1 (latest)

unkempt crowBOT
woeful jacinth
#

hello

granite vigil
#

Hi,
Could you please share more details ?

woeful jacinth
#

yes

#

I need to create subscription with couponcode and have 25% discound.

#

hope requirement is clear to you

#

there?

#

hello

granite vigil
#

I'm monitoring your thread.

woeful jacinth
#

ok

woeful jacinth
#

im not using checkout session.

#

on server level > php
creating subscription default incomplete. e.g.:
|$subscribe = \Stripe\Subscription::create([
"customer" => $user['stripeCustomerId'],
"items" => [
[
"plan" => $stripePlanId,
],
],
'coupon' => $couponCode,
'payment_behavior' => 'default_incomplete',
'expand' => ['latest_invoice.payment_intent'],
]);
$response = [
'stripePlanId' => $stripePlanId,
'subscriptionId' => $subscribe->id,
'clientSecret' => $subscribe->latest_invoice->payment_intent->client_secret,
'status' => $subscribe->status
];

granite vigil
woeful jacinth
#

yes as per your link subscription is created.

#

but 3d secure is asking for full amount and my invoice is also generated with full amount.

#

after subscription created in incomplete with coupon code
stripe.confirmCardPayment(clientSecret, {
payment_method: {
card: cardElement,
billing_details: {
name: customer_name,
},
},
return_url: "<?php echo base_url('paymentreturn.html'); ?>"
})

#

on fron side im calling above method

granite vigil
#

Could you please share a Subscription Id ?

woeful jacinth
#

actually currently it is working well

granite vigil
#

Ah cool.