You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+50-6
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,8 @@
1
-
Apple App Store Server Golang Library
2
-
================
1
+
# Apple App Store Server Golang Library
3
2
4
3
The Golang server library for the [App Store Server API](https://developer.apple.com/documentation/appstoreserverapi) and [App Store Server Notifications](https://developer.apple.com/documentation/appstoreservernotifications).
5
4
6
-
The App Store Server API is a REST API that you call from your server to request and provide information about your customers' in-app purchases.
5
+
The App Store Server API is a REST API that you call from your server to request and provide information about your customers' in-app purchases.
7
6
8
7
The App Store Server API is independent of the app’s installation status on the customers’ devices. The App Store server returns information based on a customer’s in-app purchase history regardless of whether the customer installs, removes, or reinstalls the app on their devices.
9
8
@@ -18,6 +17,7 @@ go get github.com/richzw/appstore
18
17
### [Generate a Private Key](https://developer.apple.com/documentation/appstoreserverapi/creating_api_keys_to_use_with_the_app_store_server_api)
19
18
20
19
> Log in to [App Store Connect](https://appstoreconnect.apple.com/login) and complete the following steps:
20
+
>
21
21
> - Select Users and Access, and then select the Keys tab.
22
22
> - Select In-App Purchase under the Key Type.
23
23
> - Click Generate API Key or the Add (+) button.
@@ -70,8 +70,8 @@ func main() {
70
70
- Manage the HTTP 429 RateLimitExceededError in your error-handling process. For example, log the failure and queue the job to process it again at a later time.
71
71
- Check the Retry-After header if you receive the HTTP 429 error. This header contains a UNIX time, in milliseconds, that informs you when you can next send a request.
72
72
- Error handling
73
-
- handler error per [apple store server api error](https://developer.apple.com/documentation/appstoreserverapi/error_codes) document
74
-
-[error definition](./error.go)
73
+
- handler error per [apple store server api error](https://developer.apple.com/documentation/appstoreserverapi/error_codes) document
74
+
-[error definition](./error.go)
75
75
76
76
### Look Up Order ID
77
77
@@ -220,11 +220,55 @@ func main() {
220
220
}
221
221
```
222
222
223
+
### Parse signed notification payloads from App Store Server Notification request
224
+
225
+
```go
226
+
import (
227
+
"encoding/json"
228
+
229
+
"github.com/richzw/appstore"
230
+
)
231
+
232
+
funcmain() {
233
+
c:= &appstore.StoreConfig{
234
+
KeyContent: []byte(ACCOUNTPRIVATEKEY),
235
+
KeyID: "FAKEKEYID",
236
+
BundleID: "fake.bundle.id",
237
+
Issuer: "xxxxx-xx-xx-xx-xxxxxxxxxx",
238
+
Sandbox: false,
239
+
}
240
+
a:= appstore.NewStoreClient(c)
241
+
242
+
reqBody:= []byte{} // Request from App Store Server Notification
0 commit comments