Skip to content

Commit

Permalink
Merge pull request #1 from sshropshire/orders_v2_application_context
Browse files Browse the repository at this point in the history
Add Application Context return_url and cancel_url
  • Loading branch information
sshropshire authored Apr 6, 2022
2 parents 1b6706d + 424bd06 commit 7f39ae0
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
public class CreateOrderRequest {
private String intent;
private List<PurchaseUnit> purchaseUnits;
private ApplicationContext applicationContext;

public String getIntent() {
return intent;
Expand All @@ -30,6 +31,12 @@ public void setPurchaseUnits(List<PurchaseUnit> purchaseUnits) {
this.purchaseUnits = purchaseUnits;
}

@JsonProperty("application_context")
public ApplicationContext getApplicationContext() { return applicationContext; }

@JsonProperty("application_context")
public void setApplicationContext(ApplicationContext applicationContext) { this.applicationContext = applicationContext; }

@Override
public String toString() {
ObjectMapper mapper = new ObjectMapper();
Expand Down Expand Up @@ -94,4 +101,21 @@ public void setEmailAddress(String emailAddress) {
}
}
}

public static class ApplicationContext {
private String returnURL;
private String cancelURL;

@JsonProperty("return_url")
public String getReturnURL() { return returnURL; }

@JsonProperty("return_url")
public void setReturnURL(String returnURL) { this.returnURL = returnURL; }

@JsonProperty("cancel_url")
public String getCancelURL() { return cancelURL; }

@JsonProperty("cancel_url")
public void setCancelURL(String cancelURL) { this.cancelURL = cancelURL; }
}
}

0 comments on commit 7f39ae0

Please sign in to comment.