We were try to call Apple Pay startSession, but we are getting an following error,
exception: Error: Error: socket hang up at SCAwsPay.validateSessiont (D:\projects\amazon_payment_nodejs\routes\controllers\secondaryControllers\SCAwsPay.js:158:19) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async D:\projects\amazon_payment_nodejs\routes\awsPay.js:56:18,
const { merchantIdentifier, domainName, initiativeContext, initiative, displayName } = payload;
const httpsAgent = new https.Agent({
rejectUnauthorized: false,
cert: certificate,
key: key,
passphrase: 'team123'
});
const headers = {
'Content-Type': 'application/json',
};
let response = await axios.post("https://apple-pay-gateway.apple.com/paymentservices/startSession", {
merchantIdentifier,
domainName,
displayName,
}, {
// headers,
httpsAgent
});
I kindly request your support in resolving this issue as soon as possible. Apple Pay is an essential feature for me, and I would greatly appreciate any guidance or solutions you can provide.
Thank you for your attention to this matter. I look forward to your prompt response and assistance in resolving this issue.
Hi @PradeepRaj,
Please ensure your server is properly configured for TLS 1.2 or later, and that you have a trusted root certificate. You can learn more about this info below:
TN3173: Troubleshooting issues with your Apple Pay merchant identifier configuration https://developer.apple.com/documentation/technotes/tn3173-troubleshooting-issues-with-your-apple-pay-merchant-id-configuration
Cheers,
Paris X Pinkney | WWDR | DTS Engineer