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

Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..
I am getting error while await applePayClient.PostAsJsonAsync(validationUrl, validationPayload) I am testing it on local machine. Am I even can test this on local machine or not? Error: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.. validationUrl: https://apple-pay-gateway.apple.com/paymentservices/startSession JS C# code: var applePayClientHandler = new HttpClientHandler { SslProtocols = System.Security.Authentication.SslProtocols.Tls12 | System.Security.Authentication.SslProtocols.Tls13 }; var applePayClient = new HttpClient(applePayClientHandler); var merchantId = "merchant.com.xxxxxx.sandbox"; var _displayName = "Sandbox"; var domainName = "xxxxxx.co"; var validationUrl = request.ValidationURL; var validationPayload = new { MerchantIdentifier = merchantId, DisplayName = _displayName, Initiative = "web", InitiativeContext = domainName }; try { var response = await applePayClient.PostAsJsonAsync(validationUrl, validationPayload); var merchantSession = await response.Content.ReadAsStringAsync(); return merchantSession; } catch (HttpRequestException httpEx) { // Log detailed HTTP request/response information Console.WriteLine($"HttpRequestException: {httpEx.Message}"); if (httpEx.InnerException != null) { Console.WriteLine($"InnerException: {httpEx.InnerException.Message}"); } throw; }
2
1
961
Oct ’24
New apple pay in PC chrome dosn't work with iOS 18
I've encountered an issue with Apple Pay in PC Chrome with iOS 18. Below is the scenario and code for reference: Issue Scenario: A button is clicked to initiate the Apple Pay process. A QR code window pops up, which I scan with my phone. As soon as the session is established, the window closes immediately, not allowing the user to select a payment card. No errors appear in the console. Here's the code snippet for handling the Apple Pay button click: const onApplePayButtonClicked = () => { if (!window.ApplePaySession) { return; } log('Apple Pay button clicked'); const request = { countryCode: 'UA', currencyCode: 'UAH', merchantCapabilities: ['supports3DS'], supportedNetworks: ['visa', 'masterCard'], total: { label: 'PoC Merchant Apple Pay', type: 'final', amount: amount.toString(), }, }; const session = new window.ApplePaySession(3, request); session.onvalidatemerchant = async (event) => { try { log('Creating ApplePaySession'); const response = await fetchAppleSessionAPI(event.validationURL, applePayMercantId, { deviceId, refreshToken }); log('validateMerchantResponse', response); session.completeMerchantValidation(response.applePaySessionData); } catch (error) { log('validateMerchantError', error); } }; session.onshippingmethodselected = () => { const newTotal = { label: 'PoC Merchant Apple Pay', type: 'final', amount: amount.toString(), }; session.completeShippingMethodSelection(window.ApplePaySession.STATUS_SUCCESS, {}, newTotal); }; session.onpaymentauthorized = async (event) => { log('onpaymentauthorized', event); const result = { status: window.ApplePaySession.STATUS_SUCCESS, }; session.completePayment(result); log('TOKEN', event.payment.token); }; session.begin(); }; Troubleshooting Steps Taken: Verified that window.ApplePaySession is available. Checked for any console errors—none found. Confirmed that the QR code scanning and session initiation work as expected. Expected Behavior: After scanning the QR code and establishing the session, the user should be able to select a payment card and proceed with the payment flow. Current Behavior: The window closes immediately after the session is established, preventing card selection. Has anyone else faced this issue or has insights on how to resolve it? Thanks in advance!
2
0
599
Jan ’25
Unable to Add AMEX Card to Sandbox Account
I’m trying to test an AMEX card in the sandbox environment, but it’s not getting added. I have followed and verified the checks below to add the card to Wallet: Sandbox account is active. Sandbox user region is set to the US. Device region is also set to the US. AMEX card from the provided list is being added. Tested on iOS version 17.6.1 Devices tested include iPhone 13 and others. Steps followed to add the card to Wallet: Open Wallet and tap on "Add Card." Entered the required test data. Tapped "Agree" and waited. Received error: "Issuer does not support this card." Please let me know if you have any solutions.
2
0
416
Jan ’25
Apple Pay Is Not Available in "
We are encountering an issue where Apple Pay shows an unexpected popup with a message and an "OK" button when confirming a payment (after double-tapping the power button). This issue began appearing last week without any changes to the codebase or configurations. Steps to Reproduce: Open the app and initiate an Apple Pay payment. Add a valid card if not already present. Confirm the payment using the side button (double-tap). Instead of completing the transaction, a popup appears with a generic message and an "OK" button. Expected Behavior: Apple Pay should process the payment and provide a confirmation or error based on the transaction status. Actual Behavior: A popup appears with a generic title and an “OK” button. The transaction is not processed. Environment Details: Platform: iOS Apple Pay integration has been functioning correctly for years No recent updates to Apple Pay-related code or configuration Configurations Checked: App Identifier is correctly set with the bundle ID Apple Pay Payment Processing is enabled in the App ID configuration Correct Merchant ID is selected and matches in Xcode capabilities *.entitlements file contains correct Apple Pay entitlement Payment Processing Certificates are valid and in place Additional Notes: The issue appeared suddenly without any modifications to the app. We suspect it may be due to external changes (e.g., Apple system update or merchant validation issue). Please advise on any further steps we can take to diagnose or resolve this issue.
2
0
58
May ’25
Is HTTPS necessary for development with Apple Pay
I'm working on adding Apple Pay to my web site and I'm getting this error when the element loads. InvalidAccessError: Trying to start an Apple Pay session from an insecure document. Do I need HTTPS on my development site? I have it on my production site, but I've never enabled it for dev. If so, will it work with a self-signed certificate? If not, what does this error mean? How can I resolve it?
2
0
537
Dec ’24
The Future of the PaymentRequest API
I am adding Apple Pay to my eCommerce site and I am having a lot of difficulty with the PaymentsRequest API in Microsoft Edge browser. I have a partial implementation that displays the Apple Pay button and creates a PaymentRequest when the button is clicked. That's all. On Safari, this is enough to display the Apple Pay dialog. The process doesn't proceed further because I haven't implemented a handler for the merchantvalidation event. With Chrome on a Mac, the behavior is the same, I can scan the code and see the Apple Pay dialog. On Microsoft Edge, I never see the code to scan. In my web console, I'm seeing errors like InvalidStateError: Failed to execute 'canMakePayment' on 'PaymentRequest': Cannot query payment request and NotSupportedError: The payment method "https://apple.com/apple-pay" is not supported. No "Link: rel=payment-method-manifest" HTTP header found at "https://www.apple.com/apple-pay/" Is Apple Pay not supported on Windows? I see the demo site here, which gets farther than I have gotten. It does display the scan code, but payment still never completes. I see the same payment-method-manifest error in the console. If Apple Pay is not supported on any PCs other than Macs, is there any reason to use the PaymentRequest API instead of Apple Pay JS? I started digging into the W3C standards and it turns out that merchantvalidation event is deprecated. Chrome on Mac does catch it, so it seems like it's supported there. But I have concerns about the long term future. Is it going to remain supported? If so, I would imagine that the interface could change. It seems like the only benefit of the W3C PaymentRequest API is that Mac users with non-Safari browsers may still be able to use Apple Pay. In theory, that's something I'd still like to support, even if it's only a small number of users, but I only have time for one integration right now, and I need to pick the best one. How much faith should I have in the W3C PaymentRequest API? Is it reasonable to pursue it with the goal of including all Mac users regardless of browser? Or is it likely a dead API and I should stick to Apple Pay JS instead to provide a better experience to Safari users? It also looks like the PaymentRequest API isn't fully finalized yet, so maybe that's the source of my issues. Maybe I should just use Apple Pay JS for now with an eye to supporting PaymentRequest when the spec is finalized. I greatly appreciate your input.
2
0
698
Jan ’25
How do I get the last four digits of the real card number in apple Pay by "PKSecureElementPass.primaryAccountNumberSuffix"?
we want to get the last four digits of the real card number in apple Pay, and I found information about it in the document, link: https://developer.apple.com/documentation/passkit_apple_pay_and_wallet/pksecureelementpass/3543366-primaryaccountnumbersuffix?language=objc My question is how to use it,can you provide sample code? We are very anxious, thank you!
2
0
822
Oct ’24
Apple Pay JS 1.2.0 Saying NOT FOR PRODUCTION
Hi there, So we have upgraded our Apple Pay JS API to 1.2.0 to take advantage of the ability to pay with Apple Pay on 3rd party browsers. But we seem to be getting a red banner at the top of the scannable code that appears that says "NOT FOR PRODUCTION USE" even though we are using a production certificate and payments are going into checkout.com as expected. Is anyone else getting this and are we not doing something that we need to? Thanks.
2
1
422
Oct ’24
Credit card ICC Public Key Certificate retrieval
Hello! I have a requirement to read the ICC Public Key Certificate from an EMV credit card to implement a payment validation flow. Aa far as I understand, I can't use Core NFC for that task since it is not supposed to be used for reading sensitive credit card data and it might be rejected by Apple. I'm trying to use Tap To Pay as it seems to offer some general card details. Since Apple's documentation on this side is pretty limited, I'm struggling to understand what is a PaymentCardReader.Token and how can I create one? Can anyone please help me with setting up Tap to Pay?
2
0
505
Jan ’25
Request: Increase Merchant ID Creation Limit for Apple Pay Integrations
**Hi Apple Developer Community, I’m currently integrating Apple Pay across multiple merchants for my e-commerce solution, and I’ve run into a significant challenge. Apple enforces a limit of 100 Merchant IDs per Developer Account, which is creating a bottleneck for my project. My Questions: 1- Is there a way to increase the limit of Merchant IDs on a Developer Account? 2- Has anyone faced a similar challenge and found a workaround to handle integrations with more than 100 merchants? 3- Are there any plans from Apple to lift or adjust this restriction for businesses working with high volumes of merchants? I’d appreciate any guidance, advice, or information from those who’ve encountered and resolved this issue. Thank you for your help!
2
0
519
Dec ’24
Stability issues with Apple Pay Sandbox Cards
We are writing to report a recurring stability issue with the Apple Pay sandbox environment. We are using the official sandbox test cards provided on the Apple Developer website for our testing: https://developer.apple.com/apple-pay/sandbox-testing/ We are experiencing frequent, intermittent failures when attempting to add these sandbox cards to the Wallet for testing purposes. The issue typically occurs a couple of times per day. When the failure occurs, the card provisioning process fails unexpectedly. The issue is not limited to a single card; we have observed this behavior across all available card networks. In some instances, all cards (Visa, Mastercard, Discover, Amex) fail to provision simultaneously. At other times, the issue appears to be isolated to specific networks while others work correctly. Crucially, the issue appears to be temporary. After some time passes (ranging from minutes to an hour), we are able to add the exact same card successfully without making any changes to our test environment or configuration. We have diligently checked our setup to rule out configuration errors on our end. This includes verifying: The device is set to a supported region. We are signed in with a valid sandbox tester Apple ID. All other prerequisites for sandbox testing are met. The fact that the process works correctly at other times strongly suggests that this is a server-side stability issue within the Apple Pay sandbox environment rather than a persistent misconfiguration on our part. To help with your investigation, we have attached an image that demonstrates a failed attempt to add a card. Could you please investigate the stability of the sandbox card provisioning service? Please let us know if this is a known issue or if there is any further information we can provide. Thank you for your time and assistance.
2
0
155
13h
Apple Pay Test Environment - The Right Way
Hi team, We were wondering what's the correct way of configuring a test environment with Apple Pay. Not sure if this is explicitly mentioned in the documentation, but in order to avoid having the same certificates shared between test and production, should we have a different merchant identifier (and pair of certificates) for test purposes only? The above is the main question. However, two follow up questions: Do you know if payment processors usually allow the merchant ID to be configured, so that only payments generated with the prod certificates can be accepted? Is there any risk of someone getting hold of the certificates generated for the test environment (which are usually less safe than production) and using that to process payments in production?
2
0
516
Feb ’25
~15s Delay in startSession
Hello, We are experiencing a consistent delay when initiating Apple Pay sessions using the https://apple-pay-gateway.apple.com/paymentservices/startSession endpoint. Below is a detailed overview of our setup and the issue. Setup Our web service is hosted in AWS and there is a proxy server between our web service and Apple servers. We are passing the correct domain in the initiativeContext field of the startSession request. The .well-known/apple-developer-merchantid-domain-association file is hosted on a different domain, which is also correctly configured and associated with our merchant ID in the Apple Developer portal. Observed Behavior When the same request is made from a local development environment, Apple responds immediately (under 1 second). When the request is made from our AWS-hosted service, Apple responds with a valid session, but only after a consistent ~15-second delay. The content and response are otherwise identical — only the timing differs. We would appreciate any insights or suggestions from others who have faced similar behavior or from the Apple Pay team. Thank you in advance!
2
1
116
3w
profile doesnt support tap to pay iphone
I'm trying to upload my app with Tap to Pay on iPhone functionality. However, I'm getting error message "Profile doesn't include com.apple.developer.proximity-reader.payment.acceptance entitlement." I've confirmed many times that I have the distribution profile with this capability. Any idea what might be the issue? The development environment works perfectly.
2
0
1.1k
Dec ’24
Fundraising App
Hi everyone, I’m developing an iOS app for fundraising, similar to platforms like JustGiving. The app will allow multiple charities to register and receive donations directly into their Stripe accounts using Stripe Connect. Given Apple’s strict guidelines, I want to make sure I address the following: How can I ensure compliance with App Store guidelines for apps that facilitate donations to multiple charities? Are there specific requirements for verifying charities or disclosing fundraising information within the app? Any tips for providing sufficient documentation during the App Store submission to avoid delays or rejection? I’d really appreciate advice from anyone who has experience with similar projects or navigating Apple’s review process for apps involving fundraising and third-party payments. Thanks in advance!
2
0
340
Dec ’24
Transactions automations don't seem to work
Hello, I have had a problem with Transaction shortcut automation since last month, the automation does not work anymore. Whenever a transaction is done, I tap in the notification to run the automation but always gives the error "Automation failed". I can confirm the automation worked last month but suddenly it is not working anymore. Below is the screenshort of the error and the other image is how it appeared in numbers when running the automation. As you can see, in Jan 8th worked fine (that is why the full name of the card appears). Actually, the other rows are from another shortcut that I have. I would really appreciate if anyone has any insights about that, or if this happened to you as well. Thanks in advance! Arnold
2
2
425
Feb ’25
"Unexpected error" returned from PKPassLibrary.activate()
Hi, We have a bank app which can activate tokenized payment cards (in Requires Activation status) on Apple devices. In my case some customers tried to activate their card token on their Apple Watch. Our card system gathered all the required card data with the PNO and sent them to our app. Our app called the PKPassLibrary.activate() method, but got back the Swedish localizedDescription "Oväntat fel" which means "Unexpected error" in English. We checked our card system logs and contacted our PNO, both found no issue and no explanation to the unexpected error. How can we identify the issue here? Can we somehow find a more detailed error log from Apple Server? Best regards, Adrian Lui
2
0
473
Oct ’24