@akinon/pz-tabby-extension 2.0.25 → 2.0.26-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @akinon/pz-tabby-extension
2
2
 
3
+ ## 2.0.26-rc.0
4
+
5
+ ### Patch Changes
6
+
7
+ - a3e2acb: ZERO-4487: ensure Tabby shipping_address city/address/zip are never empty
8
+ - c97525a: ZERO-4487: derive Tabby order_history payment_method from payment type
9
+
3
10
  ## 2.0.25
4
11
 
5
12
  ## 2.0.24
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/pz-tabby-extension",
3
- "version": "2.0.25",
3
+ "version": "2.0.26-rc.0",
4
4
  "license": "MIT",
5
5
  "main": "src/index.tsx",
6
6
  "peerDependencies": {
@@ -67,9 +67,9 @@ export const TabbyPaymentGateway = async ({
67
67
  salt,
68
68
  hash,
69
69
  shipping_address: {
70
- city: preOrder?.pre_order?.shipping_address?.city?.name,
71
- address: preOrder?.pre_order?.shipping_address?.line,
72
- zip: preOrder?.pre_order?.shipping_address?.postcode ?? '0'
70
+ city: preOrder?.pre_order?.shipping_address?.city?.name || 'N/A',
71
+ address: preOrder?.pre_order?.shipping_address?.line || 'N/A',
72
+ zip: preOrder?.pre_order?.shipping_address?.postcode || '00000'
73
73
  },
74
74
  order_items: preOrder?.pre_order?.basket?.basketitem_set?.map(
75
75
  (item: any) => ({
@@ -93,7 +93,10 @@ export const TabbyPaymentGateway = async ({
93
93
  orderHistory?.results?.map((order_history: any) => ({
94
94
  purchased_at: order_history?.created_date,
95
95
  amount: order_history?.amount,
96
- payment_method: order_history?.card === null ? 'cod' : 'card',
96
+ payment_method:
97
+ order_history?.payment_option?.payment_type === 'pay_on_delivery'
98
+ ? 'cod'
99
+ : 'card',
97
100
  status: getOrderStatus(order_history?.status?.value),
98
101
  buyer: {
99
102
  phone: order_history?.billing_address?.phone_number,
@@ -101,9 +104,9 @@ export const TabbyPaymentGateway = async ({
101
104
  name: `${order_history?.billing_address?.first_name} ${order_history?.billing_address?.last_name}`
102
105
  },
103
106
  shipping_address: {
104
- city: order_history?.shipping_address?.city?.name,
105
- address: order_history?.shipping_address?.line,
106
- zip: order_history?.shipping_address?.postcode ?? '0'
107
+ city: order_history?.shipping_address?.city?.name || 'N/A',
108
+ address: order_history?.shipping_address?.line || 'N/A',
109
+ zip: order_history?.shipping_address?.postcode || '00000'
107
110
  },
108
111
  order_items: groupByProductId(order_history?.orderitem_set)
109
112
  })) ?? []