Apple Pay on the Web

RSS for tag

Apple Pay on the Web allows you to accept Apple Pay on your website using JavaScript-based APIs.

Posts under Apple Pay on the Web tag

109 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

ApplePay Payment Session without Private Key
I am adding ApplePay using Chase. Chase provided me with the certificate signing request and we created the certificate, but they say they cant provide us with the private key used to create the .csr, so every time I try to create the ApplePay Payment Session (https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_js_api/requesting_an_apple_pay_payment_session), I got an error as I am passing only the certificate. If I create the .csr then I can sucessfully create the ApplePay Payment Session because I also have the private key, but as it wasnt created by Chase, it doesnt contain their info and they reject it. So, It is possible to request the ApplePay Payment Session without the private key? I tried creating an p12 file, but I dont get that option as it doesnt find the private key in the pc and I tried to install the certificate in the store, but when I read it, it doesnt have the private key and it fails in Apple
7
0
2.7k
Sep ’23
Apple pay - Showing shipping methods in an array
We have had this issue for nearly 1 year now - and any help would be greatly appreciated. When a customer arrives at the cart they see the Apple pay option and various shipping methods. Orders over £25 qualify for free 48 hrs delivery and orders over £50 its 24 hrs shipping option. These are manual shipping methods we have in place and set up for all UK customers. Our issue is that we also have calculated rates for UPS via Shipstation and easypost and for some reason these appear 1st (Due to the way the ecom platform core code functions) in the apple pay prompt and it auto selects the 1st option and it is a UPS at around £10. As it is an express payment method our customers are maybe in a hurry and they do not notice this and the fact that the shipping method needs to be manually selected even if your order qualifies for free shipping. We are aware that this causes frustration for our customers and a very time consuming process for us as we refund the difference many times a week. Our developers are stuck and provided the following notes - I have implemented this sorting using different approaches, but it looks like changing the order of the shipping options is causing an issue with apple pay. I can't properly test the apple pay button. I can reorder the shipping options on the cart page, this seems to work for the regular checkout but it creates a problem with apple pay. I've tried multiple ways to reorder the list here, but it breaks apple pay. Re the stripe code that the client mentioned - I could be wrong here - but I think shipping options never actually get passed to stripe - only the cart total and the cart items - that's it - null variable for shipping options. There is a changeShippingOptions function in the Stripe code, but i've tested updating the address and shipping options during the cart/checkout process but that part of the code doesn't get called. Regarding the last point raised, all the shipping methods available do show in the apple pay prompt as they would in the regular checkout, so I am not sure what they mean by this. This is in contrast to what stripe have advised - Apologies for the delay in our response on this one, but the shipping options are sequential in the sense that they display in order of how they were passed with the code. Changing your code to include the "free" option first will then make that the default when a customer enters your payment form: shippingOptions: [ // The first shipping option in this list appears as the default // option in the browser payment interface. { ^^ the code above is an example of this. A huge show of appreciation to anyone that can provide any advice or suggestions on this. https://www.waterstreetgallery.co.uk/ This is the stripe script that enables Apple pay In particular the line - var firstShippingOption = shippingOptions[0]; - I think is what is pulling in the options, we just need to tell it to prioritise Some methods over others. An alteration to the code below was written by our developers that showed the shipping methods in an array but when they replaced it the Apple pay would not complete and after about 25 seconds payment not complete. Any suggestions would be much appreciated 😀 `
5
0
2.4k
Sep ’23
Apple Pay on the Web localhost testing
I'm wanting to implement and test Apple Pay on the Web using my localhost instance. I've managed to set everything up correctly and so I'm able to get a merchant session from the Apple Pay API, but the client code immediately calls oncancel after calling session.completeMerchantValidation. After following this I'm seeing the following in the terminal: com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitCore) [com.apple.passkit:Payment] Evaluating merchant session using PROD trust policy. com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitCore) [com.apple.passkit:Payment] Application failed to provide a valid merchant session. We can't proceed to authorize the transaction. From reading various online sources, including the documentation referenced above, it seems like this might be happening because localhost isn't a validated/verified domain under our merchant account which also means using localhost seems to be out of the question for local development. I was hoping that using the sandbox account would have been enough to maybe loosen up the domain requirement, but not so. Anything that can be set either on the account or in code to allow for the use of localhost with Sandbox accounts or is there some tool that I need to use for this or is this really only test-able under our sandbox domain?
2
0
2.6k
Sep ’23
Apple Pay, domain verification automatic renewal not working
Hi everyone, We are integrating Apple Pay on the Web, and we're trying to get the automatic renewal of the domain verification working according to the documentation: https://developer.apple.com/documentation/apple_pay_on_the_web/maintaining_your_environment Initially the domain verification is successful, but then the automatic renewal does not work. We keep getting the emails with the subject "Your domain will expire soon.", but they only say "We were unable to automatically to reverify your domain." without any further details. We confirmed that the site's SSL certificate has already been renewed by the time Apple attempted the renewal of verification, the certs are renewed 30 days before their expiry (using Let's Encrypt). So according to the docs, at least the renewal attempts 15, and then 7 days before the expiry should be successful. One example domain is this one: https://www.kayak.com/.well-known/apple-developer-merchantid-domain-association.txt, but we have the same issue for all our other domains as well. Does anyone have suggestions how to troubleshoot this further? (I tried creating a support ticket, but they basically replied that they're non-technical, and just linked me to the documentation. I've seen others complaining about this too, but couldn't find a conclusive solution, so I thought I'd signal boost and create a fresh topic to see if there are any more recent findings about this problem.) Thanks! Regards, Mark
6
3
3.0k
May ’24
Apple pay is not available for this website Error
I'm getting "Apple pay is not available for this website" error on SB after the onpaymentmethodselected event (not getting error onvalidatemerchant event) and the onPaymentAuthorised doesn't get hit at all. Here's my session data { "epochTimestamp":1652440219969, "expiresAt":1652443819969, "merchantSessionIdentifier":"SSH37EBB5A957294F0FBBD4F9C496317E1E_916523AAED1343F5BC5815E12BEE9250AFFDC1A17C46B0DE5A943F0F94927C24", "nonce":"51b5b6b1", "merchantIdentifier":"1B0FD6FCF62FBDA91A08BA2A18F4283AC1FFF6B69FC191B9F886482370BFC729", "domainName":"d176lcemp34qxj.cloudfront.net", "displayName":"Shamim", "signature":"308006092a864886f70d010702a0803080020101310f300d06096086480165030402010500308006092a864886f70d0107010000a080308203e43082038ba003020102020859d8a1bcaaf4e3cd300a06082a8648ce3d040302307a312e302c06035504030c254170706c65204170706c69636174696f6e20496e746567726174696f6e204341202d20473331263024060355040b0c1d4170706c652043657274696669636174696f6e20417574686f7269747931133011060355040a0c0a4170706c6520496e632e310b3009060355040613025553301e170d3231303432303139333730305a170d3236303431393139333635395a30623128302606035504030c1f6563632d736d702d62726f6b65722d7369676e5f5543342d53414e44424f5831143012060355040b0c0b694f532053797374656d7331133011060355040a0c0a4170706c6520496e632e310b30090603550406130255533059301306072a8648ce3d020106082a8648ce3d030107034200048230fdabc39cf75e202c50d99b4512e637e2a901dd6cb3e0b1cd4b526798f8cf4ebde81a25a8c21e4c33ddce8e2a96c2f6afa1930345c4e87a4426ce951b1295a38202113082020d300c0603551d130101ff04023000301f0603551d2304183016801423f249c44f93e4ef27e6c4f6286c3fa2bbfd2e4b304506082b0601050507010104393037303506082b060105050730018629687474703a2f2f6f6373702e6170706c652e636f6d2f6f63737030342d6170706c65616963613330323082011d0603551d2004820114308201103082010c06092a864886f7636405013081fe3081c306082b060105050702023081b60c81b352656c69616e6365206f6e207468697320636572746966696361746520627920616e7920706172747920617373756d657320616363657074616e6365206f6620746865207468656e206170706c696361626c65207374616e64617264207465726d7320616e6420636f6e646974696f6e73206f66207573652c20636572746966696361746520706f6c69637920616e642063657274696669636174696f6e2070726163746963652073746174656d656e74732e303606082b06010505070201162a687474703a2f2f7777772e6170706c652e636f6d2f6365727469666963617465617574686f726974792f30340603551d1f042d302b3029a027a0258623687474703a2f2f63726c2e6170706c652e636f6d2f6170706c6561696361332e63726c301d0603551d0e041604140224300b9aeeed463197a4a65a299e4271821c45300e0603551d0f0101ff040403020780300f06092a864886f76364061d04020500300a06082a8648ce3d0403020347003044022074a1b324db4249430dd3274c5074c4808d9a1f480e3a85c5c1362566325fbca3022069369053abf50b5a52f9f6004dc58aad6c50a7d608683790e0a73ad01e4ad981308202ee30820275a0030201020208496d2fbf3a98da97300a06082a8648ce3d0403023067311b301906035504030c124170706c6520526f6f74204341202d20473331263024060355040b0c1d4170706c652043657274696669636174696f6e20417574686f7269747931133011060355040a0c0a4170706c6520496e632e310b3009060355040613025553301e170d3134303530363233343633305a170d3239303530363233343633305a307a312e302c06035504030c254170706c65204170706c69636174696f6e20496e746567726174696f6e204341202d20473331263024060355040b0c1d4170706c652043657274696669636174696f6e20417574686f7269747931133011060355040a0c0a4170706c6520496e632e310b30090603550406130255533059301306072a8648ce3d020106082a8648ce3d03010703420004f017118419d76485d51a5e25810776e880a2efde7bae4de08dfc4b93e13356d5665b35ae22d097760d224e7bba08fd7617ce88cb76bb6670bec8e82984ff5445a381f73081f4304606082b06010505070101043a3038303606082b06010505073001862a687474703a2f2f6f6373702e6170706c652e636f6d2f6f63737030342d6170706c65726f6f7463616733301d0603551d0e0416041423f249c44f93e4ef27e6c4f6286c3fa2bbfd2e4b300f0603551d130101ff040530030101ff301f0603551d23041830168014bbb0dea15833889aa48a99debebdebafdacb24ab30370603551d1f0430302e302ca02aa0288626687474703a2f2f63726c2e6170706c652e636f6d2f6170706c65726f6f74636167332e63726c300e0603551d0f0101ff0404030201063010060a2a864886f7636406020e04020500300a06082a8648ce3d040302036700306402303acf7283511699b186fb35c356ca62bff417edd90f754da28ebef19c815e42b789f898f79b599f98d5410d8f9de9c2fe0230322dd54421b0a305776c5df3383b9067fd177c2c216d964fc6726982126f54f87a7d1b99cb9b0989216106990f09921d00003182018d30820189020101308186307a312e302c06035504030c254170706c65204170706c69636174696f6e20496e746567726174696f6e204341202d20473331263024060355040b0c1d4170706c652043657274696669636174696f6e20417574686f7269747931133011060355040a0c0a4170706c6520496e632e310b3009060355040613025553020859d8a1bcaaf4e3cd300d06096086480165030402010500a08195301806092a864886f70d010903310b06092a864886f70d010701301c06092a864886f70d010905310f170d3232303531333131313031395a302a06092a864886f70d010934311d301b300d06096086480165030402010500a10a06082a8648ce3d040302302f06092a864886f70d01090431220420463e324ef2a67be4caad2196e90cd77e4a215ee2e2dee5ebb37bc5f18d4f0e76300a06082a8648ce3d04030204483046022100b1aef11ea8f5940eef195c13d0879528ff6ddd59a671aaede8bdb0a4a0aafc290221009257a1f32bfea292d8cd819682343d840b75a1d332c3154c33b701a3b8c0166b000000000000", "operationalAnalyticsIdentifier":"Shamim:1B0FD6FCF62FBDA91A08BA2A18F4283AC1FFF6B69FC191B9F886482370BFC729", "retries":0, "pspId":"1D867D2918895F195CF99A0BCCA8B3E63C0AB3FC997F254501617482BBCF21F9" } and this is the url that i'm testing with https://d176lcemp34qxj.cloudfront.net/MerchantSiteSB.html Can somebody please assist to find the issue? or how should i get more details on the error?
6
0
2k
Oct ’23
Apple Pay/NMI - Recurring Charges
Hi, I am currently integrating Apple Pay into a subscription web app. Our payment processor is NMI. Everything is working for individual charges. However, I am unable to get recurring payments to work. I tried to re-charge the initial token but NMI returns "DO NOT HONOR". How do I get access to a rechargeable token? The .onpaymentmethodselected event listener is only returning PaymentMethod: {type: "Credit"}. No token there. I tried to utilize tokenNotificationURL but it seems like the webhook is never being triggered. I setup a custom endpoint on my node.js server and I utilzed Ngrok to tunnel to my localhost. I also tried webhook.site but none of these solutions received anything from apple pay. I also changed the recurring payment interval to "minute" to test if the token would become chargeable again after 60 seconds - which didn't work either. How do I get access to a token that I can re-charge on a monthly basis?
1
0
963
Oct ’23
What is x-request-id in Apple Pay Merchant Token Management API
I'm currently implementing recurring donations for our Apple Pay on the Web integration and I'm trying to figure out what the x-request-id header is on the Get Details of a Merchant Token Event HTTP request. I'm not sure if that's an existing value I'm throwing in there or if it's a generic id I'm just putting in the header for Apple to use. the documentation in question is: Get Details of Merchant Token Event
1
0
648
Aug ’23
iOS - Cash APP options API Error Code : 8447435879
Hi, We have a iOS app where users can purchase videos from others. Purchasing happens through In-app purchasing and our client get the money. So when the owner of the videos need to cashout the money he gets from the video selling, we need to implement an option for that. Currently we have a manual process for that. Our major mode of receiving payments is CashApp but when automating it with custom API it is giving error code : 8447435879 , 18447435879 Can Anyone tell me what exactly is this error code about? Note : we are synchronising the API with REST API
1
0
790
Aug ’23
Problem in logo display of Apple Pay Later visual merchandising widget only on Safari browser
While implementing Apple Pay Later visual merchandising widget on my website it is displaying on every browser except safari without debug attribute. On safari it only works when debug attribute is set to be true, when we implemented custom css for display property value as inline-block it is showing none only in safari. Is there any other approach other than debug=true for safari, as we can not use debug property in production.
2
0
605
Jul ’23
How to get access to Apple Pay Register Merchant APIs?
Hi, We’re trying to use the Apple Pay Register Merchant API and are getting an unauthorised error when we try to access the the Request for API form Error Message: Sorry, you cannot view this page. The Apple ID you signed in with does not have permission to view this page. If you’re currently a member of the Apple Developer Program, you or your Account Holder may need to update your account by agreeing to the latest license agreement in order to access this page. To view your current membership status and benefits, visit your account. But our account is already a part of Apple Developer Program.
0
0
322
Jul ’23
What is latest Apple Pay APIVersion?
Hello All, I apologize in advance if this is a dumb question. I am helping some Front End Devs out in our coding of Apple Pay integration for our ecommerce site. Currently we have in our js code the following: created: function() { this.ApplePay = { APIVersion: 3 }, this.checkApplePayAvailability() However: We have learned that we must have at least APIVersion 4 to allow totals to be 0 RE: https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentrequest/1916119-total Note In versions of Apple Pay JS prior to version 4, the amount of the total must be greater than zero. Check for version availability using supportsVersion before setting a zero amount. So, I thought of just hard coding to use APIVersion 4. YET: I am wondering what the latest APIVersion is. https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_on_the_web_version_history Thank you so much, in advance, for your feedback. Regards, 🌻Anne
0
0
288
Jul ’23
I want to integrate ApplePay in our Angular application.
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.
1
0
1.3k
Oct ’23
Apple pay merchant validation fails without key file
Last month our certificate key expired for Apple Pay, For generating new certificate Followed this document TN3103: Apple Pay on the Web troubleshooting guide | Apple Developer Documentation ) My payment service provider created certificate signing request (CSR).(Not provided key) Uploaded this CSR to the Merchant Configuration page to generate a Payment Processing Certificate Downloaded payment processing certificate Downloaded Merchant Identity Certificate Both certificated installed in key chain, But the key file is not found so can't create Certificate.key.pem ` public function apple_pay_session(Request $request) { $certificatePassphrase = ""; $merchantIdentifier = "merchant.name.com"; $displayName = "merchant name"; $initiative = "web"; $initiativeContext = "www.merchant.co.uk"; $certPass = ""; $certFile = public_path('merchant_id.pem'); $keyFile = public_path('Certificate.key.pem'); $data = '{"merchantIdentifier":"'.$merchantIdentifier.'","displayName":"'.$displayName.'","initiative":"'.$initiative.'","initiativeContext":"'.$initiativeContext.'"}'; try { $ch1 = curl_init(); Storage::put('computop_applpay_try_session_'.time().'.txt', "In session"); // Check if initialization had gone wrong* if ($ch1 === false) { throw new Exception('failed to initialize'); } curl_setopt($ch1, CURLOPT_URL, $request->validationUrl); curl_setopt($ch1, CURLOPT_SSLCERT, $certFile); curl_setopt($ch1, CURLOPT_SSLKEY, $keyFile); curl_setopt($ch1, CURLOPT_SSLKEYPASSWD, $certPass); curl_setopt($ch1, CURLOPT_POST, 1); curl_setopt($ch1, CURLOPT_POSTFIELDS,$data); curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1); $merchantSession = curl_exec($ch1); // Check the return value of curl_exec(), too if ($merchantSession === false) { throw new Exception(curl_error($ch1), curl_errno($ch1)); } return response()->json([ "merchantSession"=>$merchantSession, "certFile" => $certFile ]); } catch(Exception $e) { Storage::put('computop_applpay_catch_session_'.time().'.txt', $e->getMessage()); return response()->json([ "code"=>$e->getCode(), "msg" => $e->getMessage() ]); } }` We only have apple_pay.cer ,merchant_id.cer, certificate signing request (CSR) provide by the payment service provider." How to create merchant_id.pem,Certificate.key.pem from It..? Or is it possible to do payment validation in PHP without these files?
0
0
579
Aug ’23
ApplePay how to create merchant tokens in sandbox
Hi, I'm trying to create merchant tokens in ApplePay sandbox environment, so then I can use them to invalidate token API call and lifecycle notifications testing. When processing test payment I use Apple Pay payment request taken directly from Apple's demo website (I skipped non important part of JSON) { ... "recurringPaymentRequest": { "paymentDescription": "A description of the recurring payment to display to the user in the payment sheet.", "regularBilling": { "label": "Recurring", "amount": "4.99", "paymentTiming": "recurring", "recurringPaymentStartDate": "2023-08-11T11:20:32.369Z" }, "trialBilling": { "label": "7 Day Trial", "amount": "0.00", "paymentTiming": "recurring", "recurringPaymentEndDate": "2023-08-11T11:20:32.369Z" }, "billingAgreement": "A localized billing agreement displayed to the user in the payment sheet prior to the payment authorization.", "managementURL": "https://applepaydemo.apple.com", "tokenNotificationURL": "https://applepaydemo.apple.com" }, ... } Payment is successful, but merchantTokenIdentifier in decrypted ApplePay token is always empty, regardless of test card used, I tried Visa, MasterCard, Amex. Anyone have an idea what I'm missing and how to get that merchant token? Is it even possible to test merchant tokens (lifecycle notifications) in sandbox?
1
0
491
Aug ’23
Apple Pay Domain Verification
I've come across seemingly conflicting information regarding the necessity of domain verification and looking for clarification. I am currently developing a solution that integrates Apple Pay capabilities on a web page and when I attempt to make my merchant verification call I receive an error stating that the supplied merchant Id is not registered with the supplied domain. The certs are all still far from expiration so the only other answer I'm finding through the Google machine is that it's because I have not performed my domain verification. The development host is only accessible internally and I've gone back and forth with security stating it must be exposed at least long enough to perform the verification. I was provided with this article which conveys that domain verification is not required in the sandbox environment. On the contrary, here under Developer Account and Website, it is stated that domain verification IS required. The sandbox appears to be for apps when I'm developing a website. So which one is it? I may have found my answer is rooted in not being logged into a sandbox account from the MacBook but rather using an iCloud account? I have dismissed this a number of times seeing as it references the app store when I'm developing website. Perhaps a sandbox account is used for both? This could explain why the URL returned during the verification callback does not convey a development/test endpoint. I'm currently sharing a laptop for testing so I'll have to try this out once I retake possession. Until that time comes, the conflict and the question still stand as any feedback may be useful to other individuals facing a similar situation. Someone really needs to write up a paper on Apple Pay integration for the Windows person developing within an environment that's tighter than a submarine.
1
0
857
Aug ’23