Skip to content

Commit

Permalink
Merge pull request #286 from richzw/master
Browse files Browse the repository at this point in the history
feat(appstore): add get transaction history v2 and the fields renewalPrice, currency, and offerDiscountType to the JWSRenewalInfoDecodedPayload
  • Loading branch information
takecy authored Jun 11, 2024
2 parents 4c74f3f + 2b8b31c commit 3b4a968
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
31 changes: 17 additions & 14 deletions appstore/api/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,23 @@ type ConsumptionRequestBody struct {

// JWSRenewalInfoDecodedPayload https://developer.apple.com/documentation/appstoreserverapi/jwsrenewalinfodecodedpayload
type JWSRenewalInfoDecodedPayload struct {
AutoRenewProductId string `json:"autoRenewProductId"`
AutoRenewStatus AutoRenewStatus `json:"autoRenewStatus"`
Environment Environment `json:"environment"`
ExpirationIntent int32 `json:"expirationIntent"`
GracePeriodExpiresDate int64 `json:"gracePeriodExpiresDate"`
IsInBillingRetryPeriod *bool `json:"isInBillingRetryPeriod"`
OfferIdentifier string `json:"offerIdentifier"`
OfferType int32 `json:"offerType"`
OriginalTransactionId string `json:"originalTransactionId"`
PriceIncreaseStatus *int32 `json:"priceIncreaseStatus"`
ProductId string `json:"productId"`
RecentSubscriptionStartDate int64 `json:"recentSubscriptionStartDate"`
RenewalDate int64 `json:"renewalDate"`
SignedDate int64 `json:"signedDate"`
AutoRenewProductId string `json:"autoRenewProductId"`
AutoRenewStatus AutoRenewStatus `json:"autoRenewStatus"`
Environment Environment `json:"environment"`
ExpirationIntent int32 `json:"expirationIntent"`
GracePeriodExpiresDate int64 `json:"gracePeriodExpiresDate"`
IsInBillingRetryPeriod *bool `json:"isInBillingRetryPeriod"`
OfferIdentifier string `json:"offerIdentifier"`
OfferType int32 `json:"offerType"`
OriginalTransactionId string `json:"originalTransactionId"`
PriceIncreaseStatus *int32 `json:"priceIncreaseStatus"`
ProductId string `json:"productId"`
RecentSubscriptionStartDate int64 `json:"recentSubscriptionStartDate"`
RenewalDate int64 `json:"renewalDate"`
SignedDate int64 `json:"signedDate"`
RenewalPrice int64 `json:"renewalPrice,omitempty"`
Currency string `json:"currency,omitempty"`
OfferDiscountType OfferDiscountType `json:"offerDiscountType,omitempty"`
}

func (J JWSRenewalInfoDecodedPayload) Valid() error {
Expand Down
3 changes: 2 additions & 1 deletion appstore/api/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ const (
HostProduction = "https://api.storekit.itunes.apple.com"

PathLookUp = "/inApps/v1/lookup/{orderId}"
PathTransactionHistory = "/inApps/v1/history/{originalTransactionId}"
PathTransactionHistory = "/inApps/v2/history/{originalTransactionId}"
PathTransactionHistoryV1 = "/inApps/v1/history/{originalTransactionId}"
PathTransactionInfo = "/inApps/v1/transactions/{transactionId}"
PathRefundHistory = "/inApps/v2/refund/lookup/{originalTransactionId}"
PathGetALLSubscriptionStatus = "/inApps/v1/subscriptions/{originalTransactionId}"
Expand Down

0 comments on commit 3b4a968

Please sign in to comment.