Skip to content

Commit

Permalink
Change /client-token to /id-token; add entry_point to id-token request
Browse files Browse the repository at this point in the history
  • Loading branch information
scannillo committed Jun 25, 2020
1 parent e954b0b commit d2f419f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This repository represents a sample merchant server for a merchant integrating w
## Build and run locally
To build and run locally, use the command: `./mvnw spring-boot:run -Dspring-boot.run.profiles=local`. Running this command will install Maven and all necessary dependencies.

If everything worked, you should be able to hit `http://localhost:5000/client-token?countryCode=US`.
If everything worked, you should be able to hit `http://localhost:5000/id-token?countryCode=US`.

## Switching Merchant Account/ Authentication

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ private IdToken getToken(final String authorizationHeader) {
MultiValueMap<String, String> body = new LinkedMultiValueMap<>();
body.add("grant_type", "client_credentials");
body.add("response_type", "id_token");
body.add("entry_point", "paypal_native_sdk");

HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(body, headers);
ResponseEntity<IdToken> response = restTemplate.postForEntity(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public RestController(OrdersV2Client ordersV2Client, PayPalTokenClient payPalTok
this.payPalTokenClient = payPalTokenClient;
}

@GetMapping(path = "/client-token")
IdToken getClientToken(@RequestParam(value = "countryCode") String countryCode) {
@GetMapping(path = "/id-token")
IdToken getIDToken(@RequestParam(value = "countryCode") String countryCode) {
System.out.println("******************************");
System.out.println("REQUEST to /v1/oauth2/token:");
System.out.println("Country code: " + countryCode);
Expand Down

0 comments on commit d2f419f

Please sign in to comment.