I am trying to set up my server with appstore notification. So that I can get notification when users refund their in-app-purchase. https://developer.apple.com/documentation/appstoreservernotifications/receiving_app_store_server_notifications <- guide line that I am looking now.
The version 2 response body, responseBodyV2, contains a signedPayload that’s cryptographically signed by the App Store in JSON Web Signature (JWS) format. The JWS format increases security and enables you to decode and validate the signature on your server. The notification data contains transaction and subscription renewal information that the App Store signs in JWS. The App Store Server API and the StoreKit In-App Purchase API use the same JWS-signed format for transaction and subscription status information. For more information about JWS, see the IETF RFC 7515 specification.
according to article, seem like I have to hold a signedpayload code inside a url that I am shared with my App Store Connect.
https://gist.github.com/atpons/5279af568cb7d1b101247c02f0a022af
<- thinking code would be look like this
So my question is,
Do I need to make some new private key and share with server developers ? look like we store the key from here https://www.apple.com/certificateauthority/ and use it whenever we request? how do I get notification? should I just expect that expected response json structure this kind of notification will come to url that I am shared with my App Store Connect. Thank you for reading my question!