We're trying to enable Apple Pay on the Web for a web application of ours, but getting this error when trying to construct the PaymentRequest object:
TypeError: Type error: PaymentRequest@[native code] startApplePay@https:-myurl-:319:47 onclick@https://-myurl-:606:14:undefined
For completeness/posterity, also added to StackOverflow:
The annoyingly tiny answer was that the first argument to the PaymentRequest constructor is supposed to be an array.
const request = new PaymentRequest([ applePayMethod ], paymentDetails);
(Or, make the variable an array from the start. The two examples I'd seen used different approaches, I missed the array brackets.)