apple / app-store-server-library-node

MIT License
159 stars 29 forks source link

Getting an error in verifyAndDecodeNotification method #176

Closed Arshadshaykh closed 1 month ago

Arshadshaykh commented 1 month ago

I am trying to verify and decode notification with verifyAndDecodeNotification method And I am getting status: 1 VERIFICATION_FAILURE,

this was the error stack

at SignedDataVerifier.verifyCertificateChain (/rater-qa/node_modules/@apple/app-store-server-library/dist/jws_verification.js:217:19) at SignedDataVerifier.verifyJWT (/rater-qa/node_modules/@apple/app-store-server-library/dist/jws_verification.js:181:42) at SignedDataVerifier.verifyAndDecodeNotification (/rater-qa/node_modules/@apple/app-store-server-library/dist/jws_verification.js:97:39)

alexanderjordanbaker commented 1 month ago

That would be expected if the certificate was not from Apple. Could you paste the contents of the x5c header chain here? And to confirm, these are not Xcode transactions, but Sandbox or Production transactions?

Arshadshaykh commented 1 month ago

Thanks for the reply @alexanderjordanbaker but the issue is solved the buffer which I was passing was not correct.

Arshadshaykh commented 1 month ago

I'm unsure whether I should implement the backend logic for updating transactions within the same API that App Store Connect uses to send notifications. Could you clarify the process?

alexanderjordanbaker commented 1 month ago

@Arshadshaykh are you talking about App Store Server Notifications? App Store Connect is used for managing products, not transaction data?

Arshadshaykh commented 1 month ago

are you talking about App Store Server Notifications?

Yes

App Store Connect is used for managing products, not transaction data

Sorry for the confusion, I just want to know the further process after verifying notification.