Apple Pay

RSS for tag

Discuss how to integrate Apple Pay into your app for secure and convenient payments.

Apple Pay Documentation

Posts under Apple Pay subtopic

Post

Replies

Boosts

Views

Activity

ApplePaySession.applePayCapabilities() started returning applePayUnsupported in third-party browsers
We rely on ApplePaySession.applePayCapabilities() to decide whether to show the Apple Pay button. We use two different merchant IDs for non-prod/prod environments, and encountered a change in behavior where this API now returns different results. These merchant IDs are generated from a third-party provider Adyen. However, Adyen has informed us that they are unable to identify the root cause of the issue and advised us to seek assistance directly from Apple Pay support. Timeline Last known working date: 13/08/2025 Issue first noticed: 18/08/2025 Environment Details Apple Pay JS API version 1.latest Browsers Tested: Third party browsers including Chrome/139.0.0.0, Firefox/141.0 Browsers with ApplePaySession built-in (like iOS Chrome, iOS Safari, and macOS Safari) are working fine Framework Stack: Angular v18.1.3 (important) no configuration setup in Apple dev account, merchantId is generated from a third-party provider Adyen. Current Execution Flow: Apple Pay JS API script element is injected <script type="text/javascript" async="" src="https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js"></script> Triggers below to check apple pay readiness, different ${merchantId_credential} is used: await window.ApplePaySession.applePayCapabilities(`${merchantId_credential}`); (**ApplePaySession is a valid object at this point) Observed that different paymentCredentialStatus is returned // nonprod env { "paymentCredentialStatus": "applePayUnsupported" // unexpected } // prod env { "paymentCredentialStatus": "paymentCredentialStatusUnknown" } The same code is executed in each environment and the behaviour was also the same, but has changed since then. Side notes By checking the SDK’s internal code, we saw that in third-party browsers it makes an extra call to the following endpoint. Responses from this call also come back differently depending on the merchantId. When invoking below: curl -X POST \ https://smp-paymentservices.apple.com/paymentservices/v3/checkStatus/merchant/{merchantId} \ -H 'Content-Type: application/json' \ -d '{ "initiative": "web", "initiativeContext": "env_specific_domain" }' Our non-prod environment returns {"registered":false} while using prod's merchantId and domain it returns {"registered":true}. We thought the issue might be domain-related since the environments are on different domains, but so far, no luck. The main questions we're looking to resolve are: Why did the behavior change at a certain point despite no code changes? How should we approach this investigation, and what specific requests should we be making to the Adyen team? Why does the response from the call to https://smp-paymentservices.apple.com/paymentservices/v3/checkStatus/merchant/{merchantId} return different results? Perhaps this could provide a clue regarding the question above? We noticed that canMakePayments() is returning true, so we could consider using that as a workaround. Would it be safe to change the source of truth relying on canMakePayments() for displaying Apple Pay? There is a concern that this issue may also occur in our production environment, so we would appreciate assistance in understanding what is happening and finding a resolution.
3
0
184
3w
Apple Pay questions
Hi team, just a few general questions about Apple Pay: If user removes card from wallet, then re-adds it, will it preserve its Merchant Token (MPAN) or will a new one be generated? Is the DPAN the same as applicationPrimaryAccountNumber in this page: https://developer.apple.com/documentation/passkit_apple_pay_and_wallet/apple_pay/payment_token_format_reference Can a user have the same card active simultaneously in two devices? Thank you
3
0
921
Oct ’24
Apple Pay on the web
When checking if the device supports Apple Pay and has an active card, a call is made to 'applePayCapabilities'. The documentation indicates this method asynchronously contacts the Apple Pay servers as part of the verification process. My understanding is that this is a client side call, from the device/OS to the Apple Server. The application (Apple pay on the web) is behind a firewall. What domain should I whitelist for this verification to be a success?
2
0
466
Sep ’24
Help with "500 Broker Service Response Exception" during Apple Pay In-App Provisioning
I tried to test In-App Provisioning in Production for our whitelisted app through TestFlight (Internal Testing Track) and we received the following error response from PassBook during the provisioning attempt, Could you please guide us? Error Response from sysdiagnose PassBookUIService during In-App Provisioning attempt: { statusCode = 500; statusMessage = "Broker Service Response exception"; } I reported the error in Feedback Assistant: ID: FB16112348 (500 Broker Service Response exception during Apple Pay In-App Provisioning ). Note:- I am reffering to Getting Started with Apple Pay: In-App Provisioning, Verification, Security, and Wallet Extensions
2
1
379
Jan ’25
Apple Pay Web Merchant Registration API
Hello, I am looking for some help on how to use the Apple Pay Web Merchant Registration API. Have been approved to use the API and attempted to test on a merchant ID set up for testing. Below are steps taken before the request. Create merchant ID com.test.merchant. Create Apple Pay Merchant Identity Certificate for using it with the request via p12. Create Platform Integrator platformintegrator.com.test With the below request, I am getting a 401. Any input would be much appreciated! curl --cert-type P12 --cert cert.p12:{password} -i -d '{\ "domainNames":["customer.test.com"],\ "partnerMerchantName": "customer.test.com",\ "partnerInternalMerchantIdentifier":"customer.test.com"}'\ "encryptTo":"com.test.merchant",\ https://apple-pay-gateway-cert.apple.com/paymentservices/registerMerchant The response: { "statusMessage": "Payment Services Exception Unauthorized", "statusCode": "401" } Also tried using the platformintegrator.com.test for the encryptTo but resulted in a 401 as well.
2
0
122
Jun ’25
[Apple Pay]how to update multiTokenContexts when PKPaymentRequestShippingContactUpdate method trigger
multiTokenContexts is defined as follows (https://developer.apple.com/documentation/passkit/pkpaymentrequest/multitokencontexts) You can assign a value when initializing PKPaymentRequest (https://developer.apple.com/documentation/passkit/pkpaymentrequest). However, in actual usage scenarios, when the Apple Pay address changes and PKPaymentRequestShippingContactUpdate (https://developer.apple.com/documentation/passkit/pkpaymentrequestshippingcontactupdate) is triggered, how to update multiTokenContexts? The documentation and code do not provide updates for this parameter. In contrast, Apple Pay on the Web provides newMultiTokenContexts as an update when ApplePayShippingContactUpdate (https://developer.apple.com/documentation/apple_pay_on_the_web/applepayshippingcontactupdate) is triggered. Has anyone encountered this problem? Would you happen to have any solutions? Thank you.
2
0
411
Jan ’25
Boarding pass relevant date and timezone issue
Hi everyone, I’m encountering a challenge while working with Apple's PKPass for boarding passes and would appreciate any guidance. We are generating boarding passes for users and want them to automatically display on the lock screen as the boarding time approaches. To do this, we are utilizing the relevantDate property. The issue arises because, when setting the relevantDate, the date and time are specified in Zulu time (UTC). However, iOS converts this to the device's local time zone (BST in my case), resulting in a one-hour shift. For instance, in pass.json, I set "relevantDate": "2024-10-03T14:35:00+00:00" (or "relevantDate": "2024-10-03T14:35Z"). While iOS does display the pass on the lock screen as expected, the notification shows the time as "Today at 15:25" instead of the correct "14:25." Expected behaviour: the notication text should display the exact time set in the relevantDate( i.e. Today at 14:25). Any insights on how to resolve this would be greatly appreciated! Thank you!
2
0
524
Oct ’24
Apple Pay JS v3 in Angular: postMessage origin mismatch and onpaymentauthorized never fires
Description: I’m integrating Apple Pay JS (version 3) into an Angular application. Here are the key details: Environment: Angular (latest) Apple Pay JS v3 Chrome (confirmed window.ApplePaySession is available) application region is in US. I'm in Taiwan and using my iPhone Taiwan account to scan the QR Code/ Implemented Handlers: onvalidatemerchant onpaymentmethodselected onpaymentauthorized oncancel Observed Behavior: When I click the Apple Pay button, the console logs: Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://applepay.cdn-apple.com') does not match the recipient window's origin ('https://{our-domain-name}') Despite this, the QR code still appears. Scanning the QR code with an iPhone 13 Pro running iOS 18.4.1 brings up the Apple Pay sheet with the correct amount, but payment never completes. In the browser, none of my Angular event handlers fire except oncancel. Questions: What causes the postMessage origin mismatch with Apple’s CDN frame, and how should my application handle it? Why doesn’t onpaymentauthorized ever fire, and how can I complete the payment flow so that session.completePayment() succeeds? Any guidance or sample code snippets for a proper merchant-validation and payment-completion sequence in this setup would be greatly appreciated. my code onApplePayButtonClicked() { if (!ApplePaySession) { console.error('[ApplePay] ApplePaySession is not supported'); return; } // Define ApplePayPaymentRequest const request : ApplePayJS.ApplePayPaymentRequest = { countryCode: this.currencyCode, currencyCode: Constants.CountryCodeUS, merchantCapabilities: this.merchantCapabilities, supportedNetworks: this.supportedNetworks, total: { label: this.label, type: "final" as ApplePayJS.ApplePayLineItemType, amount: this.orderAmount.toString(), }, }; // Create ApplePaySession const session = new ApplePaySession(3, request); session.onvalidatemerchant = async event => { console.info('[ApplePay] onvalidatemerchant', event); try { const merchantSession = await fetch(`${this.paymentUrl}/api/applepay/validatemerchant`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ PKeyCompany: this.paymentAppleMerchantId, ValidationUrl: event.validationURL }) }).then((r) => r.json()); session.completeMerchantValidation(merchantSession); } catch (error) { console.error('[ApplePay] onvalidatemerchant MerchantValidation error', error); session.abort(); } }; session.onpaymentauthorized = (event) => { console.info('[ApplePay] paymentauthorized', event); const token = event.payment.token; this.paymentTokenEmitted.emit({ token: JSON.stringify(token), paymentType: PaymentOptionType.ApplePay }); session.completePayment(ApplePaySession.STATUS_SUCCESS); }; session.onpaymentmethodselected = (event) => { console.info('[ApplePay] paymentmethodselected', event); const update: ApplePayJS.ApplePayPaymentMethodUpdate = { newTotal: request.total }; session.completePaymentMethodSelection(update); }; session.oncancel = (event) => { console.error('[ApplePay] oncancel', event); this.errorEmitted.emit({ error: 'Apple Pay cancel' }); }; session.begin(); }
2
1
106
1d
Wallet Extension show tips "Cannot Add Card"
When integrating the Wallet Extension, after clicking my app icon from the "From Apps on Your iPhone" list, I encountered the message: "Cannot Add Card. '***' is not responding. Wait a few minutes and try again. If the problem continues, contact the card issuer's customer service" instead of the configured login page appearing as expected. What could be causing this issue, and how should I resolve it?
2
0
350
Mar ’25
Apple Pay Integration Issue: Payment Sheet Closing Immediately After Merchant Validation
I am facing an issue while integrating Apple Pay in my React.js application. The onvalidatemerchant callback works perfectly, and the merchant validation is successfully completed. However, after the Apple Pay session is validated, the payment sheet appears briefly and then closes immediately without triggering the onpaymentauthorized event. I have provided the relevant code snippets and API implementation below. I would greatly appreciate your insights on resolving this issue. import React, { useEffect, useRef, useState } from "react"; // Relevant imports const ApplePayButton = ({ paymentType, handlePayment, cartSummary }) => { const [applePaySession, setApplePaySession] = useState(null); const cartSummaryRef = useRef(cartSummary); useEffect(() => { cartSummaryRef.current = cartSummary; }, [cartSummary]); const setupApplePaySession = async () => { if (!window.ApplePaySession || !ApplePaySession.canMakePayments()) { console.log("Apple Pay is not supported on this device/browser."); return; } const paymentRequest = { countryCode: "US", currencyCode: "USD", merchantCapabilities: ["supports3DS"], supportedNetworks: ["visa", "masterCard", "amex"], total: { label: "Total", amount: `${cartSummaryRef.current?.total?.amount || "10.00"}`, }, requiredBillingContactFields: ["postalAddress", "email", "phone", "name"], }; const session = new ApplePaySession(6, paymentRequest); setApplePaySession(session); session.onvalidatemerchant = async (event) => { try { const response = await createAndValidateApplePaySession({ validation_url: event.validationURL, provider: "APPLE_PAY", }); if (response?.status && response?.data?.applePaySession) { const merchantSession = JSON.parse( response.data.applePaySession.session_details ); session.completeMerchantValidation(merchantSession); } else { console.error("Merchant validation failed: Invalid response."); } } catch (error) { console.error(`Merchant validation error: ${JSON.stringify(error)}`); } }; session.onpaymentauthorized = (event) => { console.log("Payment authorized:", event.payment); }; session.oncancel = () => { console.log("Payment cancelled."); }; session.onerror = (event) => { console.error(`Apple Pay error: ${JSON.stringify(event)}`); }; session.begin(); }; return ( <> {paymentType === "APPLE_PAY" && ( )} </> ); }; export default ApplePayButton; createAndValidateApplePaySession = async (data) => { const { validation_url } = data; const apiUrl = ${this.finixUrl}/apple_pay_sessions; const base64Credentials = Buffer.from(this.credentials).toString("base64"); const body = { validation_url, merchant_identity: process.env.FINIX_APPLE_PAY_MERCHANT_ID, domain: process.env.FINIX_APPLE_PAY_DOMAIN, display_name: process.env.FINIX_APPLE_PAY_DISPLAY_NAME, }; const requestData = { url: apiUrl, data: body, headers: { "Content-Type": "application/json", Authorization: Basic ${base64Credentials}, }, }; try { const response = await axios.post(requestData.url, requestData.data, { headers: requestData.headers, }); return response?.data; } catch (error) { console.error("Merchant validation failed:", error); return error; } }; Current Behavior: Apple Pay button renders successfully. Clicking the button triggers the setupApplePaySession function. The merchant validation completes successfully via the onvalidatemerchant callback, and a valid merchant session is received from the API. The Apple Pay sheet appears briefly and then closes immediately. The onpaymentauthorized callback is never triggered. Expected Behavior: The payment sheet should remain open after merchant validation, allowing the user to select a payment method and authorize the payment. The onpaymentauthorized callback should then be triggered to handle the payment token.
2
1
535
Jan ’25
Receiving 401 since Friday 24th Jan 2025 from https://apple-pay-gateway-cert.apple.com/paymentservices/registerMerchant
we are experiencing an issue when making an HTTP call to: "https://apple-pay-gateway-cert.apple.com/paymentservices/registerMerchant". The response we are receiving back is HTTP Status Code 401 Unauthorized. We noticed the issues started around "Jan 24, 2025 at 9:51:46.327 am" and is still carrying on. Some other examples of when the calls failed: Jan 27, 2025 at 3:04:31.387 pm Jan 27, 2025 at 9:46:04.068 am Jan 27, 2025 at 3:36 pm All of the above dates and times are UK GMT +0 times. As the problem is around HTTP status code of 401 Unauthorised its tough to show what's actually happening. Like I stated above everything was working correctly before the 24th of Jan and nothing has changed or been modified on our side. I have even tried to do the following: Use the first set of Certs to perform a test Still returns 401 Delete a Cert and re generating them from scratch to perform a test with those set of Certs Still returns 401 I have just tried to process another HTTP call to the paymentservices/registerMerchant and I could inspect the headers of the request and im hoping this helps in your investigation. Headers: x-keystone-correlationid = 8f9a3c16-f78f-4f9b-9484-63190ef14a77 Date = Tue, 28 Jan 2025 10:00:43 GMT x-envoy-upstream-service-time = 4 x-apay-service-response-details = via_upstream We also found an article that has us a bit worried about this issue. Article here: https://developer.apple.com/news/?id=2x8awlvm States that Apple/Apple Pay will be making some changes to the ciphers in the coming months. With this article and the issues we seeing on Sandbox Environment we are worried that come the 4th of February as stated in the article that our Production Environment will be effected and we will stop being able to use Apple Pay so that gives us about a week to fix any issues/change code that might come out of it. Please could you come back with some information around the Article posted and if our Production Environment would be impacted.
2
1
467
Jan ’25
Hyperlink on Apple pass backfield does not work thru double tapping the power button
I'm encountering an issue with the Apple Pass Store card type backfield hyperlink not working when opened from double-clicking the power button. The value contains an HTML tag with a reference to our webpage. Everything works fine when we open it from the Wallet app, but the hyperlink doesn't seem to work when opened from the power button double-click. Has anyone else experienced this issue or have any suggestions for troubleshooting? Any help would be greatly appreciated. Thank you!
2
1
1.1k
Nov ’24
Is there a way to test apple pay recurring payment in sandbox?
Hello everyone Searching on the forums about the Mpan and the merchant Token Identifier I found there is no a good or clear way to get one of those, So I wonder if (without the risk to try it in production with a real payment) there is a way to test recurring payments by using an sandbox card or if the only solution is by on given from a bank or a card network for testing (but that solution is even more complex), it this last is the only way, what are the criteria to get the Mpan in the payment data? I know that the card network should support this feature is also a must, but how to know if the car network support Mpan? (is there a list?)
2
0
802
Oct ’24
Assistance with Adding Subdomain to Apple Sandbox Domain List
Hi team, I'm currently trying to add a specific subdomain (with a path) to Apple's Sandbox domain list, but it seems Apple only allows the main domain to be entered. Due to strict client security policies, we aren't allowed to use just the main domain, which is creating a roadblock in our implementation. Is there any way to add a full subdomain or URL path to the Sandbox configuration? I'm happy to join a call to explain the scenario further if that would help. Thanks in advance for your support!
2
0
69
Apr ’25