Hello, we are developing in app provisioning of our American Express network cards.
After clicking add to apple wallet in our app, I launch the PKAddPaymentPassViewController and click next.
It loads for a few seconds and then I get:
[<private>] ProvisioningOperationComposer: Step '<private>' failed with error Error Domain=PKProvisioningErrorDomain Code=5 UserInfo={PKErrorHTTPResponseStatusCodeKey=500}
Does anyone have any insight on what this error means?
Apple Pay
RSS for tagDiscuss how to integrate Apple Pay into your app for secure and convenient payments.
Post
Replies
Boosts
Views
Activity
This error occurs in Apple Pay Wallet In-App Provisioning Flow for Credit / Debit Cards
When the data received from the PNO (Visa) is passed to PKAddPaymentPassRequest this error is seen in addPaymentPassViewController, in the finalize stage.
Docs provide no clue as to what could be wrong.
iOS 18.2.1
XCode 15.2
Error description mentions "unsupportedVersionError"
Is the pass version not supported?
Is the wallet version not supported?
Is it an app implementation error or error in the data received from the PNO?
Hi,
Please refer the info graphic .
I'm an issuer Bank App, who wants to add a card to phone's Digital Wallet.
When I hit add to Apple or Google wallet, my API call goes to a Token Requester server and then to Token Service provider.
In this process, I do get a JWT token back, but when I try to add token to Digital Wallet, I always get the message "The pass cannot be read because it is not valid".
So few question:
Is there a way to debug the token that is received by the app?
Is there any kind of API console that I can look to see what is happening and why the pass is not valid?
I, being the Issuer Bank App, a Token Service Requester and A Token Service Provider, who should be communicating with Apple servers?
Are there any documents that explicitly shows (example) the flow of adding a credit card to Digital Wallet from iOS perspective?
Any other help is appreciated.
On my end, I have done this:
public void AddToDeviceAsync(string data)
{
try
{
var dataArray = Encoding.UTF8.GetBytes(data);
if (data.Length > 0)
{
if (PKAddPassesViewController.CanAddPasses && PKPassLibrary.IsAvailable)
{
_nsData = NSData.FromArray(dataArray);
ObjCRuntime.Class.ThrowOnInitFailure = false;
_pkPass = new PKPass(_nsData, out NSError e);
if (!string.IsNullOrWhiteSpace(e?.LocalizedDescription))
{
UserDialogs.Instance.AlertAsync(e.LocalizedDescription, AppResources.Alert);
return;
}
if (!PkLibrary.Contains(_pkPass))
{
var controller = new PKAddPassesViewController(_pkPass);
var rootViewController = UIApplication.SharedApplication.Delegate.GetWindow().RootViewController;
if (rootViewController != null)
{
var topController = TopViewControllerWithRootViewController(rootViewController);
topController?.PresentViewController(controller, true, null);
}
}
else
{
UserDialogs.Instance.AlertAsync(AppResources.Pass_Already_Present, AppResources.Alert);
}
}
}
else
{
UserDialogs.Instance.AlertAsync(AppResources.Invalid_Pass_Data, AppResources.Alert);
}
}
catch (Exception e)
{
UserDialogs.Instance.AlertAsync(e.Message, AppResources.Alert);
}
}
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.
We have recently begun testing in our production environment and have been unable to push provision any cards, receiving a 500 error:
default 11:15:59.136742-0300 PassbookUIService Response:
https://pr-pod9-smp-device.apple.com:443/broker/v4/devices/SEID_NUMBER/cards 500 Time profile: 0.486102 seconds
{
x-conversation-id = "52463d9f488e428f829633a1518ea72d"
Vary = "accept-language"
Content-Type = "application/json"
x-pod = "pr-pod9"
x-keystone-correlationid = "058F11DE-839F-47AC-A623-741BF32CEA80"
Date = "Thu, 16 Jan 2025 14:15:58 GMT"
x-apay-service-response-details = "via_upstream"
Content-Length = "81"
x-envoy-upstream-service-time = "172"
x-pod-region = "paymentpass.com.apple"
}
{
statusCode = 500;
statusMessage = "Broker Service Response exception";
}
In 05/2024 we received an e-mail from applepayentitlementsapple.com confirming the granting of in-app provisioning entitlements for our production apps.
We've already sent a feedback on Feedback Assistant. Here is the code to track: FB16344669.
Also, we sent another e-mail to applepayentitlementsapple.com, Case-ID: 11317916, but we haven't received a reply yet.
Can you help us? We are concerned, since our pre-certification starts on January 27th.
Thanks in advance.
Hello Everyone,
I am trying to integrate apple pay on my website and have followed the following steps.
Created a merchant identifier in my apple developer account.
Generated a payment processing certificate using Certificate signing Request generated through keychain.
Downloaded the certificate and converted that to pem file using the following command
openssl x509 -inform DER -in apple_pay.cer -out apple_pay.pem
Imported the cer file into keychain and exported .p12 file and generated private key using the following command.
openssl pkcs12 -in Certificates.p12 -out private_key.pem -nocerts
Utilizing apple_pay.pem and private_key.pem files for merchant verification call and getting the following response.
cURL Error: OpenSSL SSL_read: error:14094418:SSL routines:ssl3_read_bytes:tlsv1 alert unknown ca, errno 0
Trying 17.141.128.7:443...\n* TCP_NODELAY set\n* Connected to apple-pay-gateway.apple.com (17.141.128.7) port 443 (#0)\n* ALPN, offering h2\n* ALPN, offering http/1.1\n* successfully set certificate verify locations:\n* CAfile: /etc/ssl/certs/ca-certificates.crt\n CApath: /etc/ssl/certs\n* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256\n* ALPN, server accepted to use http/1.1\n* Server certificate:\n* subject: businessCategory=Private Organization; jurisdictionC=US; jurisdictionST=California; serialNumber=C0806592; C=US; ST=California; L=Cupertino; O=Apple Inc.; CN=apple-pay-gateway.apple.com\n* start date: Dec 19 00:22:44 2024 GMT\n* expire date: Mar 12 19:42:00 2025 GMT\n* issuer: C=US; O=Apple Inc.; CN=Apple Public EV Server RSA CA 1 - G1\n* SSL certificate verify ok.\n> POST /paymentservices/startSession HTTP/1.1\r\nHost: apple-pay-gateway.apple.com\r\nAccept: /\r\nContent-Type: application/json\r\nContent-Length: 143\r\n\r\n* upload completely sent off: 143 out of 143 bytes\n* OpenSSL SSL_read: error:14094418:SSL routines:ssl3_read_bytes:tlsv1 alert unknown ca, errno 0\n* Closing connection
I also tried to include AppleWWDRCAG2 and AppleRootCA-G2 certificated but same response every time.
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.
I'm trying to create an Apple Pay session for my website. I'm starting with curl for now, just to get proof of concept.
curl --cert cert.pem --pass {passphrase} --header "Content-Type: application/json" --request POST --data '{"merchantIdentifier":"{merchantIdentifier}","displayName":"testDisplayName", "initiative": "web", "initiativeContext": "{domain}"}' https://apple-pay-gateway.apple.com/paymentservices/paymentSession
This is the response I get back
{
"statusMessage": "Payment Services Exception merchantId={VERY-LONG-ID} not registered for domain={domain}",
"statusCode": "400"
}
I'm not sure why this is happening. {domain} is in the form of sub.site.tld with no protocol, such as https, which matches what I see in the list of the domains in the merchant identity dashboard. The {merchantIdentifier} also matches what I see in the top right, but the merchantId in the response is something I don't recognize. It's a long string of characters that appears to be hexadecimal.
I added the apple-developer-merchantid-domain-association file to my .well-known directory and the dashboard does report that the domain is verified.
I am making the request from the web server that the domain resolves to, if that matters.
I can't think of any reason this would be happening.
I'm not sure where the long merchantId in the response is coming from. Does it matter that it doesn't match what I supplied in the request? As far as I can tell, I am using the correct merchantIdentifier. It matches the dashboard and the CN field of the certificate.
I found this other post that seems to have a similar error: https://forums.developer.apple.com/forums/thread/671227
The main difference is a 417 status code instead of the 400 I got. But the problem here was that there was no payment processing certificate and I do have one of those.
I haven't checked with my processor to verify that the certificate is published, but I will do that soon. I wouldn't expect that to matter. Maybe it does?
What other reason could I be getting this error?
Could it be a problem with my merchant identity certificate? It took a lot of effort to make it work. But I suspect it's fine, otherwise I wouldn't be getting a response from Apple at all. I can't think of any other possible problems.
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?
I am implementing apple pay and the merchant validation is failing with error (error request failed with status code 417). I am using react js in the frontend and node js in backend, this is my code
const httpsAgent = new https.Agent({
rejectUnauthorized: false,
cert: fs.readFileSync(
path.join(__dirname, "../../../certificates/merchant_id_prod.pem")
),
key: fs.readFileSync(
path.join(__dirname, "../../../certificates/merchant_id_prod.key")
),
});
const data = {
merchantIdentifier: "merchantId",
displayName: "Check",
initiative: "web",
initiativeContext: "domain.com",
};
const response = await axios.post(validationURL, data, { httpsAgent });
I can’t send or receive money with Apple Cash My account is restricted but only Apple Cash everything else works fine help
All the cards seem to have expired in Dec 2024:
https://developer.apple.com/apple-pay/sandbox-testing/
Are there updated cards? Some gateways only support Mastercard and Discover which all appear expired.
Dear Team,
we are from Austria and want to test our apple pay on the web implementation via Apple Sandbox. As far as we can see Austria is not on the list that sandbox supports Apple Pay testing for. Can you please advise how can we move forward with testing?
We have already created and also tried out our Sandbox account on iPhone 11 and successfully added test cards to the Wallet. Can we expect please in later stage some restrictions due to our region?
Thank you in advance.
Iveta
Hello everyone, I have a small error 23. I wanted to know if you also already have this error so in the simulator it works, I have no error, but once I do in the TestFlight I have the error that appears error 23, can anyone help me on this? Thanks a lot.
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
Hello, we re developing a loyalty platform for end users and as such emit Apple wallet store cards. Problem we're facing is that the HTTP POST /v1/devices/:deviceLibraryIdentifier/registrations/:passTypeIdentifier/:serialNumber in some cases doesn't come through and we have no idea why.
This only happens to a small percentage of customers, others work just fine.
Does anyone have an idea why this might happen? I believe our setup is correct when 90% of customers work and we receive these HTTP requests to our server.
We have implemented In-App Provisioning, but when I start the tokenization process, I receive an error before the terms and conditions.
We are testing with a version of the app on TestFlight.
The error message is: Could not add card. Try again later or contact your card issuer for more information.
Could you please help me?
Hello,
I am developing a mobile application focused on helping users centralize and analyze their expenses. The app's key feature is to track transactions made through Apple Pay, providing users with a consolidated view of their spending across all linked bank cards or accounts.
I have a few specific questions regarding the feasibility of this integration:
Does Apple provide any official APIs or tools to access Apple Pay transaction data for third-party applications?
Are there restrictions or guidelines for apps that aim to use Apple Pay to support expense tracking?
What would be the best way to initiate a partnership or obtain further support from Apple for such a project?
Your insights or direction on how to proceed would be greatly appreciated.
Thank you for your time and guidance!
Best regards,
Amine
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!
Hi, I purchased an account for the app's developer on 18/12/2024. But somehow, it appears that the processing takes 48 hours after the purchase. I received an email about the order. The Apple developer membership account shows, “To continue your enrolment, complete the purchase now.” When I click and fill it out, I wonder if it's the same command.
However, I already filled out all the details of the payment twice on 21/11/2024, but I haven't received a response from the teams. Could you please help me with this matter? TQVM for your concerns.