I want to implement ApplePay on Angular. There are two ways to implement it (JS API and Payment Request API) and I would like to use the API method as I want to do as much as processing in server side. By looking at the following page, it's hard to understand the difference between JS API and Payment Request API. https://applepaydemo.apple.com/
Surprisingly I can't find any example code for Angular to use ApplePay. I can't believe no one has used ApplePay on Angular before. May be there is another/better way to do it?
In Angular it's even tricky to get the window instance. I have tried the solutions in this question and managed to inject window instance using a service provider. I can display the ApplePay button on appropriate devices but I am getting the following error when calling the ApplePaySession object. Apparenlty the injected window is not the top level one.