-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for App Store Server API v1.11 and App Store Server Notif… #94
Merged
alexanderjordanbaker
merged 1 commit into
apple:main
from
alexanderjordanbaker:ASSAv1.11
May 6, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/main/java/com/apple/itunes/storekit/model/ConsumptionRequestReason.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright (c) 2024 Apple Inc. Licensed under MIT License. | ||
|
||
package com.apple.itunes.storekit.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonValue; | ||
|
||
/** | ||
* The customer-provided reason for a refund request. | ||
* | ||
* @see <a href="https://developer.apple.com/documentation/appstoreservernotifications/consumptionrequestreason">consumptionRequestReason</a> | ||
*/ | ||
public enum ConsumptionRequestReason { | ||
|
||
UNINTENDED_PURCHASE("UNINTENDED_PURCHASE"), | ||
FULFILLMENT_ISSUE("FULFILLMENT_ISSUE"), | ||
UNSATISFIED_WITH_PURCHASE("UNSATISFIED_WITH_PURCHASE"), | ||
LEGAL("LEGAL"), | ||
OTHER("OTHER"); | ||
|
||
private final String value; | ||
|
||
ConsumptionRequestReason(String value) { | ||
this.value = value; | ||
} | ||
|
||
public static ConsumptionRequestReason fromValue(String value) { | ||
for (ConsumptionRequestReason b : ConsumptionRequestReason.values()) { | ||
if (b.value.equals(value)) { | ||
return b; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
@JsonValue | ||
public String getValue() { | ||
return value; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return String.valueOf(value); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/main/java/com/apple/itunes/storekit/model/RefundPreference.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright (c) 2024 Apple Inc. Licensed under MIT License. | ||
|
||
package com.apple.itunes.storekit.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonValue; | ||
|
||
/** | ||
* A value that indicates your preferred outcome for the refund request. | ||
* | ||
* @see <a href="https://developer.apple.com/documentation/appstoreserverapi/refundpreference">refundPreference</a> | ||
*/ | ||
public enum RefundPreference { | ||
|
||
UNDECLARED(0), | ||
PREFER_GRANT(1), | ||
PREFER_DECLINE(2), | ||
NO_PREFERENCE(3); | ||
|
||
private final Integer value; | ||
|
||
RefundPreference(Integer value) { | ||
this.value = value; | ||
} | ||
|
||
public static RefundPreference fromValue(Integer value) { | ||
for (RefundPreference b : RefundPreference.values()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
if (b.value.equals(value)) { | ||
return b; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
@JsonValue | ||
public Integer getValue() { | ||
return value; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return String.valueOf(value); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/test/resources/models/signedConsumptionRequestNotification.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"notificationType": "CONSUMPTION_REQUEST", | ||
"notificationUUID": "002e14d5-51f5-4503-b5a8-c3a1af68eb20", | ||
"data": { | ||
"environment": "LocalTesting", | ||
"appAppleId": 41234, | ||
"bundleId": "com.example", | ||
"bundleVersion": "1.2.3", | ||
"signedTransactionInfo": "signed_transaction_info_value", | ||
"signedRenewalInfo": "signed_renewal_info_value", | ||
"status": 1, | ||
"consumptionRequestReason": "UNINTENDED_PURCHASE" | ||
}, | ||
"version": "2.0", | ||
"signedDate": 1698148900000 | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Why the letter b?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
B cause, no I think it is an artifact of the copy-paste from other enums.