File tree 1 file changed +33
-0
lines changed
1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,39 @@ go get github.com/richzw/appstore
23
23
> - Enter a name for the key. The name is for your reference only and isn’t part of the key itself. Click Generate.
24
24
> - Click Download API Key next to the new API key. And store your private key in a secure place.
25
25
26
+ ### Get Transaction Info
27
+
28
+ ``` go
29
+ import (
30
+ " github.com/richzw/appstore"
31
+ )
32
+
33
+ // ACCOUNTPRIVATEKEY is the key file generated from previous step
34
+ const ACCOUNTPRIVATEKEY = `
35
+ -----BEGIN PRIVATE KEY-----
36
+ FAKEACCOUNTKEYBASE64FORMAT
37
+ -----END PRIVATE KEY-----
38
+ `
39
+ func main () {
40
+ c := &appstore.StoreConfig {
41
+ KeyContent: []byte (ACCOUNTPRIVATEKEY),
42
+ KeyID: " FAKEKEYID" ,
43
+ BundleID: " fake.bundle.id" ,
44
+ Issuer: " xxxxx-xx-xx-xx-xxxxxxxxxx" ,
45
+ Sandbox: false ,
46
+ }
47
+ transactionId := " FAKETRANSACTIONID"
48
+ a := appstore.NewStoreClient (c)
49
+ response , err := a.GetTransactionInfo (context.TODO (), transactionId)
50
+
51
+ transantion , err := a.ParseSignedTransaction (response.SignedTransactionInfo )
52
+
53
+ if transaction.TransactionId == transactionId {
54
+ // the transaction is valid
55
+ }
56
+ }
57
+ ```
58
+
26
59
### Look Up Order ID
27
60
28
61
``` go
You can’t perform that action at this time.
0 commit comments