Skip to content

Commit 5728185

Browse files
committed
feat(payment): PAYPAL-4935 updates after review
1 parent 0ecd084 commit 5728185

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

packages/core/src/cart/cart-request-sender.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ export default class CartRequestSender {
3737
},
3838
};
3939

40-
return this._requestSender
41-
.get<HeadlessCartRequestResponse>(url, {
42-
...requestOptions,
43-
})
44-
.then(this.transformToCartResponse);
40+
const response = await this._requestSender.get<HeadlessCartRequestResponse>(url, {
41+
...requestOptions,
42+
});
43+
44+
return this.transformToCartResponse(response);
4545
}
4646

4747
private transformToCartResponse(

packages/core/src/cart/headless-cart/headless-cart.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export interface HeadlessLineItems {
101101

102102
export default interface HeadlessCartResponse {
103103
cart?: {
104-
amount: BaseFieldFragment; // cart amount;
104+
amount: BaseFieldFragment;
105105
baseAmount: BaseFieldFragment;
106106
entityId: string;
107107
id: string;

packages/core/src/cart/headless-cart/map-to-cart-line-item.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default function mapToLineItem(lineItem: HeadlessLineItem): LineItem {
3434
discountAmount: discountedAmount.value,
3535
discounts: discounts.map((discount) => ({
3636
discountedAmount: discount.discountedAmount.value,
37-
// TODO:: discount item does not have name field in response body when making request using REST API, but there is name in interface, for a while set name as entityID
37+
// Info:: discount item does not have name field in response body when making request using REST API, but there is name in interface, for a while set name as entityID
3838
name: discount.entityId,
3939
})),
4040
extendedListPrice: extendedListPrice.value,
@@ -53,7 +53,7 @@ export default function mapToLineItem(lineItem: HeadlessLineItem): LineItem {
5353
valueId: option.valueEntityId,
5454
})),
5555

56-
// TODO:: we do not have any information regarding to fields below in the GraphQL Storefront doc
56+
// Info:: we do not have any information regarding to fields below in the GraphQL Storefront doc
5757
addedByPromotion: false,
5858
comparisonPrice: 0,
5959
extendedComparisonPrice: 0,

packages/core/src/cart/headless-cart/map-to-cart.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ export default function mapToCart(headlessCartResponse: HeadlessCartResponse): C
3636
code: item.code,
3737
couponType: item.couponType,
3838
discountedAmount: item.discountedAmount.value,
39-
// TODO:: there is no info about displayName field
39+
// Info:: there is no info about displayName field
4040
displayName: '',
4141
})),
42-
// TODO:: information about email field can be pulled from Billing Address or Shipping Address (https://developer.bigcommerce.com/docs/storefront/cart-checkout/guide/graphql-storefront#get-checkout)
42+
// Info:: information about email field can be pulled from Billing Address or Shipping Address (https://developer.bigcommerce.com/docs/storefront/cart-checkout/guide/graphql-storefront#get-checkout)
4343
email: '',
44-
// TODO:: there is no info about customerId field
44+
// Info:: there is no info about customerId field
4545
customerId: 0,
4646
};
4747
}

0 commit comments

Comments
 (0)