[ECOMMERCE-486] Salesforce-Should add the authorization in header for Cart/Checkout endpoint Created: 21/Oct/21 Updated: 18/Oct/22 Resolved: 03/Mar/22 |
|
| Status: | Closed |
| Project: | E-commerce |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Thuy To | Assignee: | Unassigned |
| Resolution: | Obsolete | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Template: | |||||||||
| Acceptance criteria: |
Empty
|
||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||
| Date of First Response: | |||||||||
| Epic Link: | AuthorX Maintenance | ||||||||
| Sprint: | AuthorX 4 | ||||||||
| Story Points: | 2 | ||||||||
| Description |
Steps to reproduce
Expected resultsRun the rest endpoint of cart/checkout on postman successfully. Actual results+ Miss the authorization in header of getByCartId method in SalesforceCartProvider.java + Miss the authorization in header of all methods in SalesforceCheckoutProvider.java WorkaroundDevelopment notes+ Maybe add the authorization in header like line 134 and 135 in below image:
|
| Comments |
| Comment by Jesus Alonso [ 02/Mar/22 ] |
|
Hey thuy.to , for what I can see in code, getByCartId and all the methods in SalesforceCheckoutProvider, use the method executeRequestWithShopApi: public HttpResponse executeRequestWithShopApi(String path, List<NameValuePair> nameValuePairs, HttpRequestBase httpRequestBase) throws IOException, URISyntaxException { URI uri = new URIBuilder(connection.getBaseUrl()).setPath(path).addParameters(nameValuePairs).build(); httpRequestBase.setURI(uri); setRequestHeaders(httpRequestBase); return client.execute(httpRequestBase); } private void setRequestHeaders(HttpRequestBase httpRequestBase) { httpRequestBase.addHeader(HttpHeaders.ACCEPT, APPLICATION_JSON); httpRequestBase.addHeader(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON); if (!httpRequestBase.containsHeader(HttpHeaders.AUTHORIZATION)) { httpRequestBase.addHeader(HttpHeaders.AUTHORIZATION, token); } } As you can see there we are setting the token. |
| Comment by Thuy To [ 03/Mar/22 ] |
|
Hi jalonso , Thank you for your verification. We can close this ticket. :bow: 🙇♀️ |
| Comment by Jesus Alonso [ 03/Mar/22 ] |
|
Not an issue |