#Aruljothi-payments
1 messages · Page 1 of 1 (latest)
@thick musk hi! Can you elaborate on "shall i use offsession for recurrsion"? What docs or API calls are you thinking about exactly?
i need after applepay paymen tcreate subscrption
var prButton = elements.create('paymentRequestButton', { paymentRequest: paymentRequest, });
// Check the availability of the Payment Request API first.
paymentRequest.canMakePayment().then(function(result) {
if (result) {
prButton.mount('#payment-request-button');
} else {
document.getElementById('payment-request-button').style.display = 'block';
}
});
used element for applepay butrton
paymentRequest.on('paymentmethod', function(ev) { stripe.confirmCardPayment(clientSecret,{payment_method: ev.paymentMethod.id,setup_future_usage:off_session},{handleActions: false})
.then(function(confirmResult) {
stripe confirmcardpayment working fine
but i need to create subscrption
that is possible to do!
it's the same thing, but the clientSecret should be from the PaymentIntent you get from the Invoice when creating a Subscription, instead of manually creating the PaymentIntent directly
so the first step would be to work with https://stripe.com/docs/billing/subscriptions/elements to create subscriptions and understand how Invoices/PaymentIntents interact and then you can incorporate Apple Pay into it.