@uappi/public-sdk 1.22.0 → 1.24.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.
@@ -145,7 +145,7 @@ function handleIframeMessage(event: MessageEvent): void {
145
145
  purchaseOrderAction(props.option.paymentType.code, props.orderGroup);
146
146
  facebookPurchaseOrderAction(props.orderGroup.id, props.orderGroup.values?.totalValue ?? 0);
147
147
  } else if (cartSnapshot.value) {
148
- purchaseAction(props.option.paymentType.code, cartSnapshot.value);
148
+ purchaseAction(props.option.paymentType.code, cartSnapshot.value, data.code);
149
149
  facebookPurchaseAction(data.id, cartSnapshot.value);
150
150
  } else {
151
151
  console.error('[PaymentHosted] Carrinho indisponível: evento de tracking de compra (purchase) não foi disparado.');
@@ -354,6 +354,16 @@ export interface CustomerOrderItem {
354
354
  simpleProduct: SimpleProduct;
355
355
  }
356
356
 
357
+ export interface InternalDepositBank {
358
+ name: string;
359
+ bankName: string;
360
+ bank: string;
361
+ agency: string;
362
+ account: string;
363
+ operation: string;
364
+ document: string;
365
+ }
366
+
357
367
  export interface CustomerOrderPayment {
358
368
  id: 154;
359
369
  orderGroupId: number;
@@ -377,6 +387,7 @@ export interface CustomerOrderPayment {
377
387
  billetBarCode: null | string;
378
388
  billetDigitableLine: null | string;
379
389
  billetUrl: null | string;
390
+ internalDepositBank: InternalDepositBank | null;
380
391
  cardAutomaticCapture: boolean;
381
392
  cardMasked: string | null;
382
393
  cardFlag:
@@ -77,7 +77,7 @@ export function buy(
77
77
  cartResponse: CartResponse,
78
78
  ) {
79
79
  return api.cart.buy(payload).then(data => {
80
- purchaseAction(paymentMethod, cartResponse);
80
+ purchaseAction(paymentMethod, cartResponse, data.code);
81
81
  return data;
82
82
  });
83
83
  }
@@ -6,6 +6,7 @@ import type { CartResponse } from '../../../../Api/types';
6
6
  export function purchaseAction(
7
7
  paymentMethod: string,
8
8
  cartPayload: CartResponse,
9
+ transactionId: string,
9
10
  ) {
10
11
  pushDatalayer({
11
12
  event: 'purchase',
@@ -21,7 +22,7 @@ export function purchaseAction(
21
22
  shippingOption => shippingOption.selected,
22
23
  )!.label,
23
24
  tax: 0,
24
- transaction_id: '',
25
+ transaction_id: transactionId,
25
26
 
26
27
  value: totalValue(cartPayload),
27
28
  coupon: cartPayload.discountMap.coupon?.discountMainCode || '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uappi/public-sdk",
3
- "version": "1.22.0",
3
+ "version": "1.24.0",
4
4
  "description": "Pacotes públicos para desenvolvimento do ecossistema Uappi",
5
5
  "main": "main.ts",
6
6
  "scripts": {