Skip to content

Commit

Permalink
feat(instrument): PAYMENTS-4759 Include new instrument types in the r…
Browse files Browse the repository at this point in the history
…esponse

BREAKING CHANGES:
* Include new instrument types as part of the response. They need to be
handled by the consumer.
  • Loading branch information
icatalina committed Oct 15, 2019
1 parent 703c072 commit 7c5d85b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/store/url-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default class UrlHelper {
* @returns {string}
*/
getInstrumentsUrl(storeId, customerId, currencyCode) {
return `${this.host}/api/v2/stores/${storeId}/shoppers/${customerId}/instruments?currency_code=${currencyCode}`;
return `${this.host}/api/v3/stores/${storeId}/shoppers/${customerId}/instruments?currency_code=${currencyCode}`;
}

/**
Expand All @@ -51,7 +51,7 @@ export default class UrlHelper {
* @return {string}
*/
getTrustedShippingAddressUrl(storeId, customerId, currencyCode) {
return `${this.host}/api/v2/stores/${storeId}/shoppers/${customerId}/instruments/trusted_shipping_address?currency_code=${currencyCode}`;
return `${this.host}/api/v3/stores/${storeId}/shoppers/${customerId}/instruments/trusted_shipping_address?currency_code=${currencyCode}`;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions test/store/url-helper.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ describe('UrlHelper', () => {

it('returns a URL for submitting payments to an offsite provider', () => {
const result = urlHelper.getInstrumentsUrl(storeId, shopperId, currencyCode);
const expected = `${host}/api/v2/stores/${storeId}/shoppers/${shopperId}/instruments?currency_code=${currencyCode}`;
const expected = `${host}/api/v3/stores/${storeId}/shoppers/${shopperId}/instruments?currency_code=${currencyCode}`;

expect(result).toEqual(expected);
});

it('returns a URL for posting a trusted shipping address', () => {
const result = urlHelper.getTrustedShippingAddressUrl(storeId, shopperId, currencyCode);
const expected = `${host}/api/v2/stores/${storeId}/shoppers/${shopperId}/instruments/trusted_shipping_address?currency_code=${currencyCode}`;
const expected = `${host}/api/v3/stores/${storeId}/shoppers/${shopperId}/instruments/trusted_shipping_address?currency_code=${currencyCode}`;

expect(result).toEqual(expected);
});
Expand Down

0 comments on commit 7c5d85b

Please sign in to comment.