#miggy-payment_elements
1 messages · Page 1 of 1 (latest)
hi there, you're referring to Google Pay and Apple Pay? Does this help - https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#apple-pay-and-google-pay
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
aggggghhhh, i didnt want to have to upgrade to payment element, but it doesnt seem like i have a choice
How can I use coupons with the newer payment method element?
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?
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/?
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?
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.
when you're creating the subscription, you can create it upfront with the coupon - https://stripe.com/docs/api/subscriptions/create#create_subscription-coupon, then get the customer to pay this newly created subscription
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.