Apple Pay

RSS for tag

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

Apple Pay Documentation

Post

Replies

Boosts

Views

Activity

Apple Pay SDK Payload Decryption Sometimes Fails on Occation
Good day, A few months ago, we started noticing that we are getting occasional ApplePay SDK Data decryption errors when we attempt to decrypt the SDK Data payload that comes back from the ApplePay SDK. We are using the C# BouncyCastle Dotnet package to handle the EllipticCurve decryption. We find on average that about 2% of all our deposits are failing because the library fails to decrypt the ApplePay SDK Data payload with the error: "Mac check in GCM failed". It appears like ApplePay is maybe sending faulty payloads to us on occasion? Unless there is an issue with the BouncyCastle library? This is causing only a few transactions to fail per day, but we still need a solution for this. Is anyone having the same issue or is there a contact from Apple I can get in touch with directly to share examples to assist with troubleshooting this? Kind regards, Reon Fourie
0
0
42
2d
Not able to make payment to apple using test cards.
Im trying to do the payment using authorize.net through react native framework. I have registered the merchant ID in application and replaced merchant identifier in below code. Below i have posted my code that I'm trying to do the payment and I'm using the cards that are provided in this link. I can able to add one card and at the end step its trying for payment and its failing.Please help me out .Thanks.
1
0
44
2d
apple pay and in app purchases
Hello, I‘m a developer and I want to integrate apple pay to my app but I don’t want to pay the 30% charges (in fact I can’t because if apple does I’m in deficit i’ll explain below) My app is a ticketing app for events like parties, gigs, etc… and I don’t know if it is eligible for not using iap but apple pay (like that I’m not charged 30%). I’m also using a third party payment provider. In my case is it authorized by apple? I was saying I’m in deficit if apples charges me 30% because when a user buys a ticket I keep around 3% of the ticket and the rest goes for the organization of the event. If apple takes 30% I’ll not be able to fit in my prices. Lastly, if I’m eligible to using only apple pay and not iap, how do I say to apple « hey I don’t want to use iap but just apple pay ». Is it in the apple store connect panel? Or it has to be declared somewhere else?
0
0
87
3d
Apple pay web authentication failed (SSL connection)
I have setup the server settings TLS, HTTPS I have performed the following steps but not working for me: 1. I have validated my domain 2. Generate Certificate Signing Request (CSR) using keychain. It created public and private key in MAC keychain 3. Uploaded CSR (from point 2) to apple Pay Merchant Identity Certificate. It gave me merchant_id.cer 4. Generated .p12 with merchant_id.cer, public and private key using keychain Now I am using this .p12 to create the ApplePaySession (paymentSession) using server side code in C# but getting error from apple side. Exception: The SSL connection could not be established Inner Exception: Authentication failed, The credentials supplied to the package were not recognized at System.Net.SSPIWrapper.AcquireCredentialsHandle Sample Code: var request = new MerchantSessionRequest() { DisplayName = "StoreName", Initiative = "web", InitiativeContext = "applepaypoc.xxxxxx.com", MerchantIdentifier = "merchant.com.xxxxxx.applepaypoc", }; string certPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot\\files", "NewP12.pfx"); X509Certificate2 certificate = new X509Certificate2(certPath, "xxxxx"); HttpClientHandler handler = new HttpClientHandler(); handler.ClientCertificates.Add(certificate); handler.SslProtocols = System.Security.Authentication.SslProtocols.Tls12; var resCode = string.Empty; using (HttpClient client = new HttpClient(handler)) { try { HttpResponseMessage response = await client.PostAsJsonAsync(request.ValidationURL, validationPayload); response.EnsureSuccessStatusCode(); resCode = response.StatusCode.ToString(); string responseBody = await response.Content.ReadAsStringAsync(); return responseBody; } catch (HttpRequestException e) { return $"resCode = {resCode} ///// Response Message: {e.Message} ///// Response Inner Exception: {e.InnerException.Message}"; } } **Ref: ** https://developer.apple.com/documentation/technotes/tn3103-apple-pay-on-the-web-troubleshooting-guide https://tech.justeattakeaway.com/2016/10/10/bringing-apple-pay-to-the-web/
1
0
103
5d
merchant : Verification failed for domain
Hi , I'm trying to verify my domain , I uploaded the verification file and when I open the file by browser it works.But the verification status remains “Pending”. My domain has a firewall and is whitelisted, perhaps the request from Apple was intercepted? 17.0.0.0/8 has already been activated in the whitelist. How can solve this problem?
0
0
53
5d
Payment Services Exception
调用 API 时,返回以下错误:Apple Pay 处理证书、Apple Pay 商家身份证书和商家域均已设置 { “statusMessage”: “支付服务异常 merchantId=1A9569E9792DB13B9BEE22EDB30515DE75D512B91A2C86C54D4065AD1ECC712E 未经授权代表 merchantId=4D08091EACD9C0D2E25CB94895D1B0DAE73970D6A517EF2988D6D929D1336DA1 reason=4D08091EACD9C0D2E25CB94895D1B0DAE73970D6A517EF2988D6D929D1336DA1 不是 WWDR 的注册商家,也没有通过 Mass Enabling 获得适当授权。 “状态代码”: “417” 连接到主机的 #0 apple-pay-gateway.apple.com 完好无损 }
0
0
53
6d
Custom Push Notifications for Apple Wallet Pass Not Received
Hello everyone, I'm having trouble with sending custom push notifications for Apple Wallet passes. Here's what I've done so far: Registered a new pass: I receive a deviceToken for the pass. Enabled Push Notifications: Push notifications for the Apple Wallet app and the specific pass are enabled on my phone. Added the Key for Push Notifications: I've added the necessary key for push notifications. I use following code to send the message via APNS: const tokenKey = fs.readFileSync(options.tokenPath).toString(); jwtToken = sign({}, tokenKey, { algorithm: 'ES256', expiresIn: '1h', issuer: options.teamId, header: { alg: 'ES256', kid: options.keyId } }); const client = http2.connect('https://api.push.apple.com:443'); const notificationPayload = JSON.stringify({ aps: { "alert" : "Hello" } }); // and try //{ // "aps": { // "alert": "Your pass has been updated!", // "sound": "default" // }, // "pass-type-identifier": "pass.com.example.myPass", // "serial-number": "123456789", // "device-token": "<deviceToken>" //} const request = client.request({ ':method': 'POST', ':path': `/3/device/${deviceToken}`, 'apns-topic': topicId, 'apns-push-type': 'alert', 'authorization': `bearer ${jwtToken}`, 'apns-priority': 10, 'content-type': 'application/json', 'content-length': Buffer.byteLength(notificationPayload) }); return new Promise((resolve, reject) => { request.on('response', (headers, flags) => { for (const name in headers) { console.log(`${name}: ${headers[name]}`); } }); request.on('data', (chunk: string) => console.log(chunk)); request.on('end', () => { client.close(); resolve(); }); request.on('error', (err) => { console.error('Error sending push notification:', err); reject(err); }); request.write(notificationPayload); request.end(); }); When I send the message, I receive a :status:200 and a apns-ID, indicating that the message has been sent. However, I do not receive the custom push notifications on my phone. The pass updates are received without any issues, but the notifications are not. Has anyone encountered this issue or know if it's possible to send custom push notifications for Apple Wallet passes in this manner? Any guidance on how to resolve this issue would be greatly appreciated.
0
0
104
1w
Tap to Cash Documentation?
Is there any documentation on the annouced Tap to Cash feature from WWDC24? Will there be a way for developers to tap into this feature from within their own apps? I've searched around the documentation and info released during the conference and I haven't found anything.
2
0
107
1w
Need Apple Pay test cards for failed cases (insufficient balance, etc.) on sandbox environment
I am currently testing Apple Pay integration on my sandbox environment and I am in need of test cards for failed cases such as insufficient balance. Does anyone have access to or know where I can find Apple Pay test cards specifically for scenarios where transactions fail due to reasons like insufficient balance? Any help or guidance on this matter would be greatly appreciated. Thank you.
0
0
99
1w
How to determine if a user is eligible for an introductory offer or promotional offer?
How to determine if a user is eligible for an introductory offer or promotional offer or neither when they just view the subscription page in APP without submitting a subscription? We are using apple server notifications V2. My goal is to display different offer pages to different users on the subscription page according to their eligibility. But currently, we can only recognize the user's eligibility after they have submitted a subscription order.
1
0
151
2w
How developer will get to know which card type user (Amex, visa, discovery) has selected in swift?
is am using This delegate method, but i am getting type of card(debit/credit) info i want to know this card is from mastercard / visa or amex. func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod) async -> PKPaymentRequestPaymentMethodUpdate { print(paymentMethod.displayName ?? "") return PKPaymentRequestPaymentMethodUpdate(paymentSummaryItems: payemntRequest.paymentSummaryItems) }
0
0
119
1w
Multiple Apple pass bundles
I have an online booking website that have a button to Add the Passes to the wallet, my problem is sometimes the bundle can have more than 10 passes, which is a limitation as shown in: https://developer.apple.com/documentation/walletpasses/distributing_and_updating_a_pass what is the best practice to handle multiple bundles on web or more than 10 passes and is there websites that provide pass bundles, that i can check ?
1
0
119
1w
Apple pay - determine active card
The documentation states canMakePaymentsWithActiveCard is deprecated but will continue to work on Safari browsers. The suggested method to use applePayCapabilities is in Beta. This is confusing for a developer! which method should be used. I do not want to use a 'Beta' version in a Production environment. On the other hand, I also don't want to use a method which is deprecated. Any help or guidance would be welcome. Thank you
0
0
109
2w
Shortcuts | Transaction Automation | IOS 18
Hello forum, Hope all is great! I have a shortcut automation which uses the transaction trigger. Since updating to ios 18 the transaction trigger does not work anymore. Whenever a transaction is done, the “Running your automation” notification does not show up and the automation does not work. To share with you the steps I’ve done so far: 1.Remove the automation and do it again 2.Remove the card from apple pay 3. Delete and install again the shortcut app 4. Turned on and off the phone I can confirm the automation works on my other iPhone with the latest version of IOS 17. Would really appreciate if anyone has any insights about that, or if this happened to you as well. Cheers! Dorin
0
0
137
2w
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; }
0
0
127
2w
Getting Error when verifying merchant
I want to integrate an apple pay account on the website, but on the point where I am validating merchant that return "false" responses . I already followed the documentation and tried many times but still did not resolve it. Please help me to resolve this issue. so that i can integrate apple pay for heartland. here i mentioned my block of code where i am verifying merchant, please help to fix this. server side code: (PHP): $merchantSession = fetchAppleMerchantSession($validationURL); echo json_encode($merchantSession); function fetchAppleMerchantSession($validationUrl){ $cert_url = base_path('cert/merchant.pem'); $cert_key = base_path('cert/merchant.key'); $data = [ 'merchantIdentifier' => 'domain.com', 'domainName' => 'domain.com', 'displayName' => 'Disp Name', 'initiative' => 'web', 'initiativeContext' => 'domain.com' ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $validationUrl); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_CERTINFO, true); curl_setopt($ch, CURLOPT_VERBOSE, true); curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2); curl_setopt($ch, CURLOPT_SSLCERT, $cert_url); curl_setopt($ch, CURLOPT_SSLKEY, $cert_key); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json")); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $res = curl_exec($ch); curl_close($ch); $result = json_encode($res); return ['data' => $result, 'status' => false]; } client side code (JS): // Create Apple Pay session within the user gesture handler const session = new ApplePaySession(6, paymentRequest); // Handle merchant validation session.onvalidatemerchant = (event) => { console.log("event", {event, session}); const validationURL = event.validationURL; fetch('gp_applepay_validate.php', { // Replace with your server-side validation endpoint method: 'POST', headers: { 'Content-Type': 'application/json', 'Access-Control-Allow-Headers': "*" }, body: JSON.stringify({ validationURL }), }) .then((response) => { console.log("response.json()", response); return response.json(); }) .then((data) => { console.log("datappp", data); if (data.status) { event.completeMerchantValidation(data.data); } else { console.error('Merchant validation failed:', data.data); session.abort(); alert('Payment failed: ' + data.data); // Improve error message } }) .catch((error) => { console.error('Error during merchant validation:', error); session.abort(); alert('An error occurred during payment. Please try again later.'); // Generic error message for user }); };
2
0
317
May ’24
Apple Pay Registration Error
We are getting this error when processing our registration. Payment Services Exception Domain check failed with the following errors. No domains were registered.\nDomain verification failed for pspId=1A014B2EC09DB380EE1D51FE4D116C801F62F29D74F2D93269FE554CA2E34656 domain=patient.moolah.cc url=/.well-known/apple-developer-merchantid-domain-association errorMessage=com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 4559 path $", "statusCode": "400"}
1
0
377
Apr ’24
Apple Pay Sandbox with Payment Not Completed
Team, When I try using Apple pay for Japan, we are getting Payment Not Completed error for a merchant with Japanese character as the displayName at completeMerchantValidation. The same works well if the merchant has name in English. log from com.apple.passkit as explained in Apple Pay on the Web Debugging Guide 2024-04-30 12:12:21.441231+0530 0xb6bd16 Default 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitCore) [com.apple.passkit:Payment] Received <private> status: PKPaymentAuthorizationStatusSuccess 2024-04-30 12:12:21.441336+0530 0xb6bd16 Default 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitCore) [com.apple.passkit:Payment] Evaluating merchant session using PROD trust policy. 2024-04-30 12:12:21.448371+0530 0xb6bd16 Default 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitCore) [com.apple.passkit:Payment] State machine change state from PKPaymentAuthorizationStateClientCallback to PKPaymentAuthorizationStatePrepareTransactionDetails with param: <private> 2024-04-30 12:12:21.448393+0530 0xb6bd16 Default 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitMacHelper) [com.apple.passkit:PaymentUI] State change: PKPaymentAuthorizationStatePrepareTransactionDetails 2024-04-30 12:12:21.448444+0530 0xb6bd16 Error 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitMacHelper) [com.apple.passkit:PaymentUI] State change not implemented: PKPaymentAuthorizationStatePrepareTransactionDetails 2024-04-30 12:12:21.450878+0530 0xb6bd16 Default 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitCore) [com.apple.passkit:Payment] Performing request: POST <private> { 7 <private> fields } 500 bytes 2024-04-30 12:12:22.642216+0530 0xbaa237 Default 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitCore) [com.apple.passkit:Payment] Task Completed: <private> 2024-04-30 12:12:22.642348+0530 0xbaa237 Default 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitCore) [com.apple.passkit:Payment] Response: <private> 400 Time profile: 1.19145 seconds { 6 <private> fields } 232 bytes 2024-04-30 12:12:22.642571+0530 0xb6bd16 Default 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitCore) [com.apple.passkit:Payment] State machine change state from PKPaymentAuthorizationStatePrepareTransactionDetails to PKPaymentAuthorizationStateFatalError with param: <private> 2024-04-30 12:12:22.642617+0530 0xb6bd16 Default 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitMacHelper) [com.apple.passkit:PaymentUI] State change: PKPaymentAuthorizationStateFatalError 2024-04-30 12:12:22.642757+0530 0xb6bd16 Error 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitMacHelper) [com.apple.passkit:PaymentUI] Payment failed with fatal error <private> 2024-04-30 12:12:22.643288+0530 0xb6bd16 Default 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitCore) [com.apple.passkit:Analytics] subject: inApp event: <private> 2024-04-30 12:12:22.659154+0530 0xb6bd16 Default 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitMacHelper) [com.apple.passkit:PaymentUI] glyphView - revealedErrorAction() 2024-04-30 12:12:24.633308+0530 0xb6bad7 Default 0x0 55529 0 Safari: (PassKitMacHelperTemp) [com.apple.passkit:Payment] Invalidate extension <private> identifier <private> 2024-04-30 12:12:24.653014+0530 0xb6bd16 Info 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitCore) [com.apple.passkit:Connections] PKInAppPaymentService:0x12bf1b660 (0x1290e2a80): Tearing down existing connection 2024-04-30 12:12:24.653173+0530 0xbaaa12 Info 0x0 68603 0 passd: [com.apple.passkit:Connections] PDXPCServiceListener 2 (0x127705150:55547): connection invalidated 2024-04-30 12:12:24.654891+0530 0xb6bd16 Default 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitCore) [com.apple.passkit:Analytics] subject: inApp event: <private> As we can see, com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitMacHelper) [com.apple.passkit:PaymentUI] Payment failed with fatal error <private>, how do we debug this further?
3
0
427
Apr ’24