Skip to content

Commit

Permalink
Add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
scannillo committed Oct 30, 2019
1 parent 4aac364 commit 04916b4
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,12 @@ public String getValue() {
public void setValue(String value) {
this.value = value;
}

@Override
public String toString() {
return "Amount{" +
"currencyCode='" + currencyCode + '\'' +
", value='" + value + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,13 @@ public Payee getPayee() {
public void setPayee(Payee payee) {
this.payee = payee;
}

@Override
public String toString() {
return "CreateOrderRequest{" +
"intent='" + intent + '\'' +
", purchaseUnits=" + purchaseUnits +
", payee=" + payee +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,11 @@ public String getEmailAddress() {
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
}

@Override
public String toString() {
return "Payee{" +
"emailAddress='" + emailAddress + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,11 @@ public Amount getAmount() {
public void setAmount(Amount amount) {
this.amount = amount;
}

@Override
public String toString() {
return "PurchaseUnit{" +
"amount=" + amount +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,13 @@ public String getCountryCode() {
public void setCountryCode(final String countryCode) {
this.countryCode = countryCode;
}

@Override
public String toString() {
return "ProcessOrderRequest{" +
"orderId='" + orderId + '\'' +
", intent='" + intent + '\'' +
", countryCode='" + countryCode + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ public RestController(OrdersV2Client ordersV2Client, PayPalTokenClient payPalTok

@PostMapping(path = "/uat")
UniversalAccessToken getUat(@RequestParam(value = "countryCode", required = false, defaultValue = "US") String countryCode) {
System.out.println("******************************");
System.out.println("REQUEST to /v2/checkout/authorize-order:");
System.out.println("Country code: " + countryCode);
return payPalTokenClient.getFullScopedUAT(countryCode);
}

Expand All @@ -33,11 +36,17 @@ Order createOrder(@RequestBody CreateOrderRequest createOrderRequest,

@PostMapping("/capture-order")
Order captureOrder(@RequestBody ProcessOrderRequest processOrderRequest) {
System.out.println("******************************");
System.out.println("REQUEST to /v2/checkout/capture-order:");
System.out.println("Process Order Request body: " + processOrderRequest.toString());
return ordersV2Client.processOrder(processOrderRequest);
}

@PostMapping("/authorize-order")
Order authorizeOrder(@RequestBody ProcessOrderRequest processOrderRequest) {
System.out.println("******************************");
System.out.println("REQUEST to /v2/checkout/authorize-order:");
System.out.println("Process Order Request body: " + processOrderRequest.toString());
return ordersV2Client.processOrder(processOrderRequest);
}
}

0 comments on commit 04916b4

Please sign in to comment.