w3c / payment-request

Payment Request API
https://www.w3.org/TR/payment-request-1.1/
Other
482 stars 183 forks source link

PaymentRequest api on Safari/IOS v15.6.4 #1006

Closed asma1402 closed 1 year ago

asma1402 commented 1 year ago

Hello, I tried to test paymentRequest api on Safari/IOS v15.6.4 , the code is as follow :

function testPrr() { function buildSupportedPaymentMethodData() { // Example supported payment methods: return [{ supportedMethods: "https://itest/payment-manifest.json" }]; } function buildShoppingCartDetails() { // Hardcoded for demo purposes: return { id: "order-123", displayItems: [ { label: "Example item", amount: { currency: "USD", value: "1.00" }, }, ], total: { label: "Total", amount: { currency: "USD", value: "1.00" }, }, }; } const request = new PaymentRequest( buildSupportedPaymentMethodData(), buildShoppingCartDetails() ); request.show().then((paymentResponse) => { // Here we would process the payment. For this demo, simulate immediate success: paymentResponse.complete("success").then(() => { alert('success') }) }).catch(function(e){ alert(e) }); }

I get an error on show method, saying that the operation is not supported ! @rsolomakhin @ianbjacobs @stephenmcgruer

ianbjacobs commented 1 year ago

@asma1402, although Webkit supports Payment Request, to my knowledge it only supports the Apple Pay payment method.

I'm going to close this issue, as there is no action for the Working Group to take.