@infrab4a/connect 5.3.8 → 5.3.9-beta.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/index.cjs.js
CHANGED
|
@@ -8830,15 +8830,17 @@ class PagarMeV5RequestHelper {
|
|
|
8830
8830
|
customer: this.buildCustomer(checkout),
|
|
8831
8831
|
shipping: this.buildShipping(checkout),
|
|
8832
8832
|
payments: this.buildPayment(checkout, method, card),
|
|
8833
|
+
...this.buildAdditionalInfo(checkout),
|
|
8833
8834
|
};
|
|
8834
8835
|
}
|
|
8835
8836
|
static buildItems(checkout) {
|
|
8837
|
+
const isSubscriber = checkout.user?.isSubscriber ?? false;
|
|
8836
8838
|
return checkout.lineItems
|
|
8837
8839
|
.filter((item) => !item.isGift)
|
|
8838
8840
|
.map((item) => {
|
|
8839
8841
|
return {
|
|
8840
8842
|
amount: Math.floor(item.pricePaid * 100),
|
|
8841
|
-
description: item.name,
|
|
8843
|
+
description: isSubscriber ? `${item.name} - ASSINANTE` : item.name,
|
|
8842
8844
|
quantity: item.quantity,
|
|
8843
8845
|
code: item.EAN,
|
|
8844
8846
|
};
|
|
@@ -8935,6 +8937,14 @@ class PagarMeV5RequestHelper {
|
|
|
8935
8937
|
},
|
|
8936
8938
|
};
|
|
8937
8939
|
}
|
|
8940
|
+
static buildAdditionalInfo(checkout) {
|
|
8941
|
+
const isSubscriber = checkout.user?.isSubscriber ?? false;
|
|
8942
|
+
if (isSubscriber)
|
|
8943
|
+
return {
|
|
8944
|
+
antifraude_enabled: false,
|
|
8945
|
+
};
|
|
8946
|
+
return {};
|
|
8947
|
+
}
|
|
8938
8948
|
}
|
|
8939
8949
|
|
|
8940
8950
|
class PagarMeV5ResponseHelper {
|
package/index.esm.js
CHANGED
|
@@ -8806,15 +8806,17 @@ class PagarMeV5RequestHelper {
|
|
|
8806
8806
|
customer: this.buildCustomer(checkout),
|
|
8807
8807
|
shipping: this.buildShipping(checkout),
|
|
8808
8808
|
payments: this.buildPayment(checkout, method, card),
|
|
8809
|
+
...this.buildAdditionalInfo(checkout),
|
|
8809
8810
|
};
|
|
8810
8811
|
}
|
|
8811
8812
|
static buildItems(checkout) {
|
|
8813
|
+
const isSubscriber = checkout.user?.isSubscriber ?? false;
|
|
8812
8814
|
return checkout.lineItems
|
|
8813
8815
|
.filter((item) => !item.isGift)
|
|
8814
8816
|
.map((item) => {
|
|
8815
8817
|
return {
|
|
8816
8818
|
amount: Math.floor(item.pricePaid * 100),
|
|
8817
|
-
description: item.name,
|
|
8819
|
+
description: isSubscriber ? `${item.name} - ASSINANTE` : item.name,
|
|
8818
8820
|
quantity: item.quantity,
|
|
8819
8821
|
code: item.EAN,
|
|
8820
8822
|
};
|
|
@@ -8911,6 +8913,14 @@ class PagarMeV5RequestHelper {
|
|
|
8911
8913
|
},
|
|
8912
8914
|
};
|
|
8913
8915
|
}
|
|
8916
|
+
static buildAdditionalInfo(checkout) {
|
|
8917
|
+
const isSubscriber = checkout.user?.isSubscriber ?? false;
|
|
8918
|
+
if (isSubscriber)
|
|
8919
|
+
return {
|
|
8920
|
+
antifraude_enabled: false,
|
|
8921
|
+
};
|
|
8922
|
+
return {};
|
|
8923
|
+
}
|
|
8914
8924
|
}
|
|
8915
8925
|
|
|
8916
8926
|
class PagarMeV5ResponseHelper {
|
package/package.json
CHANGED