#miggy-payment_elements

1 messages · Page 1 of 1 (latest)

indigo radish
#

an additional point to note is that to display Apple Pay and Google Pay as an option, you need to serve the page on https. You can make use of ngrok

steel lynx
#

aggggghhhh, i didnt want to have to upgrade to payment element, but it doesnt seem like i have a choice

steel lynx
#

How can I use coupons with the newer payment method element?

indigo radish
#

neither the old card element, or new Payment Element allows you to use Stripe coupons with it. Are you implementing your coupons with your own logic?

steel lynx
#

yes, i would have an input field that would be called coupon, they way it would work is that it would check if the coupon was valid, and if so, it would pass it with the subscription like so ... $subscription = $stripe->subscriptions->create([ 'customer' => '$customer->id', 'items' =>[ ['price' => $stripe_price] ], 'coupon' => 'Valid coupon', ]);

#

but i see that a subscription is now created BEFORE and the latest invoice client secret is used. that would be a problem if im creating subscriptions before i load up the element 'clientSecret' => $subscription->latest_invoice->payment_intent->client_secret
this would mean that multiple subscriptions intents will be created with the same customer id ( cause i would have to run the code twice with the coupon now attached)

#

is there a way around this?

#

does stripe delete the subscription that was created if a payment never went through/?

indigo radish
#

sorry, i'm a bit confused over this section this would mean that multiple subscriptions intents will be created with the same customer id ( cause i would have to run the code twice with the coupon now attached) - could you maybe share more about this?

steel lynx
#

yeah, i see that stripe has me create a subscription and it uses the client secret of that intent. that would mean that im creating a subscrition that has been unpaid by the customer. in order to add a coupon, i would have to run the code once again, but this time, with the coupon attached to it. so i would now have two subscriptions under that customer. one with the coupon attached and one that doesnt.

indigo radish