@infrab4a/connect 5.4.0-beta.21 → 5.4.0-beta.23
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 +95 -18
- package/index.esm.js +96 -19
- package/package.json +1 -1
- package/src/domain/shopping/enums/index.d.ts +1 -0
- package/src/domain/shopping/enums/order-payment-status.enum.d.ts +10 -0
- package/src/domain/shopping/factories/mercado-pago-payment-method.factory.d.ts +2 -1
- package/src/infra/mercado-pago/enums/index.d.ts +2 -0
- package/src/infra/mercado-pago/enums/mercado-pago-status-detail.enum.d.ts +33 -0
- package/src/infra/mercado-pago/enums/mercado-pago-status.enum.d.ts +10 -0
- package/src/infra/mercado-pago/helpers/mercado-pago-request.helper.d.ts +14 -9
- package/src/infra/mercado-pago/helpers/mercado-pago-response.helper.d.ts +2 -0
- package/src/infra/mercado-pago/index.d.ts +1 -0
- package/src/infra/mercado-pago/types/index.d.ts +1 -0
- package/src/infra/mercado-pago/types/mercado-pago-response.type.d.ts +10 -2
- package/src/infra/mercado-pago/types/mercado-pago-status-detail.type.d.ts +2 -0
- package/src/infra/mercado-pago/types/mercado-pago-status.type.d.ts +2 -0
package/index.cjs.js
CHANGED
|
@@ -62,6 +62,18 @@ exports.OrderBlockedType = void 0;
|
|
|
62
62
|
OrderBlockedType["Boleto"] = "Boleto";
|
|
63
63
|
})(exports.OrderBlockedType || (exports.OrderBlockedType = {}));
|
|
64
64
|
|
|
65
|
+
exports.OrderPaymentStatus = void 0;
|
|
66
|
+
(function (OrderPaymentStatus) {
|
|
67
|
+
OrderPaymentStatus["Em processamento"] = "processing";
|
|
68
|
+
OrderPaymentStatus["Autorizada"] = "authorized";
|
|
69
|
+
OrderPaymentStatus["Pago"] = "paid";
|
|
70
|
+
OrderPaymentStatus["Estornada"] = "refunded";
|
|
71
|
+
OrderPaymentStatus["Aguardando pagamento"] = "waiting_payment";
|
|
72
|
+
OrderPaymentStatus["Aguardando estorno"] = "pending_refund";
|
|
73
|
+
OrderPaymentStatus["Recusada/N\u00E3o autorizada"] = "refused";
|
|
74
|
+
OrderPaymentStatus["Chargedback"] = "chargedback";
|
|
75
|
+
})(exports.OrderPaymentStatus || (exports.OrderPaymentStatus = {}));
|
|
76
|
+
|
|
65
77
|
exports.PagarmePaymentStatus = void 0;
|
|
66
78
|
(function (PagarmePaymentStatus) {
|
|
67
79
|
PagarmePaymentStatus["Em processamento"] = "processing";
|
|
@@ -8776,7 +8788,7 @@ class MercadoPagoRequestHelper {
|
|
|
8776
8788
|
statement_descriptor: checkout.shop === exports.Shops.GLAMSHOP ? 'Glam' : 'Mens Market',
|
|
8777
8789
|
additional_info: {
|
|
8778
8790
|
items: this.buildItems(checkout),
|
|
8779
|
-
payer: this.buildFullPayer(checkout),
|
|
8791
|
+
...(method === 'credit_card' && { payer: this.buildFullPayer(checkout) }),
|
|
8780
8792
|
},
|
|
8781
8793
|
...(method === 'credit_card' && this.buildCardPayment(card)),
|
|
8782
8794
|
...(method === 'pix' && this.buildPixPayment()),
|
|
@@ -8842,16 +8854,21 @@ class MercadoPagoRequestHelper {
|
|
|
8842
8854
|
static buildBoletoPayment(checkout) {
|
|
8843
8855
|
return {
|
|
8844
8856
|
payment_method_id: 'bolbradesco',
|
|
8845
|
-
date_of_expiration: dateFns.format(dateFns.addDays(new Date(),
|
|
8857
|
+
date_of_expiration: dateFns.format(dateFns.addDays(new Date(), 3), 'yyyy-MM-dd') + 'T23:59:59.999-03:00',
|
|
8846
8858
|
payer: {
|
|
8847
8859
|
first_name: checkout.user.firstName,
|
|
8848
8860
|
last_name: checkout.user.lastName,
|
|
8861
|
+
email: checkout.user.email,
|
|
8862
|
+
identification: {
|
|
8863
|
+
type: 'CPF',
|
|
8864
|
+
number: checkout.user.cpf.replace(/\D/g, ''),
|
|
8865
|
+
},
|
|
8849
8866
|
phone: {
|
|
8850
8867
|
area_code: checkout.user.phone.substring(0, 2),
|
|
8851
8868
|
number: checkout.user.phone.substring(2),
|
|
8852
8869
|
},
|
|
8853
8870
|
address: {
|
|
8854
|
-
zip_code: checkout.shippingAddress.zip,
|
|
8871
|
+
zip_code: checkout.shippingAddress.zip.replace(/\D/g, ''),
|
|
8855
8872
|
street_name: `${checkout.shippingAddress.street}, ${checkout.shippingAddress.district}`,
|
|
8856
8873
|
street_number: checkout.shippingAddress.number,
|
|
8857
8874
|
neighborhood: checkout.shippingAddress.district,
|
|
@@ -8881,7 +8898,7 @@ class MercadoPagoResponseHelper {
|
|
|
8881
8898
|
id: response.id.toString(),
|
|
8882
8899
|
acquirer_name: exports.PaymentProviders.MERCADOPAGO,
|
|
8883
8900
|
amount: response.transaction_amount,
|
|
8884
|
-
status: response.status,
|
|
8901
|
+
status: this.statusMapping(response.status),
|
|
8885
8902
|
status_reason: response.status_detail?.toString(),
|
|
8886
8903
|
payment_method: method,
|
|
8887
8904
|
currency: response.currency_id?.toString(),
|
|
@@ -8890,20 +8907,18 @@ class MercadoPagoResponseHelper {
|
|
|
8890
8907
|
charger_id: response.charges_details?.at(0)?.id?.toString() ?? null,
|
|
8891
8908
|
...(method == exports.TransactionPaymentMethods.PIX && this.getPixReponse(response)),
|
|
8892
8909
|
...(method == exports.TransactionPaymentMethods.CARD && this.getCardReponse(response)),
|
|
8910
|
+
...(method == exports.TransactionPaymentMethods.BANKSLIP && this.getBoletoReponse(response)),
|
|
8893
8911
|
});
|
|
8894
8912
|
}
|
|
8895
|
-
|
|
8896
|
-
|
|
8897
|
-
|
|
8898
|
-
|
|
8899
|
-
|
|
8900
|
-
|
|
8901
|
-
|
|
8902
|
-
|
|
8903
|
-
|
|
8904
|
-
// boleto_document_number: transaction.document_number?.toString(),
|
|
8905
|
-
// }
|
|
8906
|
-
// }
|
|
8913
|
+
static getBoletoReponse(response) {
|
|
8914
|
+
return {
|
|
8915
|
+
boleto_url: response.transaction_details?.external_resource_url?.toString(),
|
|
8916
|
+
boleto_barcode: response.transaction_details?.barcode?.content?.toString(),
|
|
8917
|
+
boleto_line: response.transaction_details?.digitable_line?.toString(),
|
|
8918
|
+
boleto_expiration_date: response.date_of_expiration?.toString(),
|
|
8919
|
+
boleto_document_number: response.transaction_details?.verification_code?.toString(),
|
|
8920
|
+
};
|
|
8921
|
+
}
|
|
8907
8922
|
static getPixReponse(response) {
|
|
8908
8923
|
return {
|
|
8909
8924
|
pix_qr_code: response.point_of_interaction?.transaction_data?.qr_code,
|
|
@@ -8923,7 +8938,21 @@ class MercadoPagoResponseHelper {
|
|
|
8923
8938
|
card_expiration_year: response.card?.expiration_year?.toString(),
|
|
8924
8939
|
capture_method: response.payment_type_id?.toString(),
|
|
8925
8940
|
authorization_code: response.authorization_code?.toString(),
|
|
8941
|
+
paid_amount: this.statusMapping(response.status) == 'paid' ? response.transaction_details?.total_paid_amount : null,
|
|
8942
|
+
paid_at: this.statusMapping(response.status) == 'paid' ? response.date_approved : null,
|
|
8943
|
+
};
|
|
8944
|
+
}
|
|
8945
|
+
static statusMapping(status) {
|
|
8946
|
+
const statusMap = {
|
|
8947
|
+
approved: 'paid',
|
|
8948
|
+
pending: 'waiting_payment',
|
|
8949
|
+
in_process: 'processing',
|
|
8950
|
+
rejected: 'refused',
|
|
8951
|
+
cancelled: 'refused',
|
|
8952
|
+
refunded: 'refunded',
|
|
8953
|
+
charged_back: 'chargedback',
|
|
8926
8954
|
};
|
|
8955
|
+
return statusMap[status] || status;
|
|
8927
8956
|
}
|
|
8928
8957
|
}
|
|
8929
8958
|
|
|
@@ -8951,7 +8980,7 @@ class MercadoPagoBankSlipAxiosAdapter {
|
|
|
8951
8980
|
data: payload,
|
|
8952
8981
|
});
|
|
8953
8982
|
console.warn('[MERCADO PAGO RESPONSE BOLETO DATA]', JSON.stringify(data));
|
|
8954
|
-
const payment = await this.paymentRepository.create(MercadoPagoResponseHelper.build(exports.TransactionPaymentMethods.
|
|
8983
|
+
const payment = await this.paymentRepository.create(MercadoPagoResponseHelper.build(exports.TransactionPaymentMethods.BANKSLIP, checkout, data));
|
|
8955
8984
|
return payment;
|
|
8956
8985
|
}
|
|
8957
8986
|
catch (error) {
|
|
@@ -8992,7 +9021,8 @@ class MercadoPagoCardAxiosAdapter {
|
|
|
8992
9021
|
data: payload,
|
|
8993
9022
|
});
|
|
8994
9023
|
console.warn('[MERCADO PAGO RESPONSE CARD DATA]', JSON.stringify(data));
|
|
8995
|
-
if ((data.status !== 'approved' && data.status_detail !==
|
|
9024
|
+
if ((data.status !== 'approved' && data.status_detail !== exports.MercadoPagoStatusDetailEnum.accredited) ||
|
|
9025
|
+
data.status !== 'authorized') {
|
|
8996
9026
|
await this.orderBlockedRepository.createBlockedOrderOrPayment({
|
|
8997
9027
|
checkout,
|
|
8998
9028
|
blockType: 'Card not authorized',
|
|
@@ -9113,6 +9143,53 @@ class MercadoPagoPixAxiosAdapter {
|
|
|
9113
9143
|
}
|
|
9114
9144
|
}
|
|
9115
9145
|
|
|
9146
|
+
exports.MercadoPagoStatusDetailEnum = void 0;
|
|
9147
|
+
(function (MercadoPagoStatusDetailEnum) {
|
|
9148
|
+
MercadoPagoStatusDetailEnum["accredited"] = "accredited";
|
|
9149
|
+
MercadoPagoStatusDetailEnum["partially_refunded"] = "partially_refunded";
|
|
9150
|
+
MercadoPagoStatusDetailEnum["pending_capture"] = "pending_capture";
|
|
9151
|
+
MercadoPagoStatusDetailEnum["offline_process"] = "offline_process";
|
|
9152
|
+
MercadoPagoStatusDetailEnum["pending_contingency"] = "pending_contingency";
|
|
9153
|
+
MercadoPagoStatusDetailEnum["pending_review_manual"] = "pending_review_manual";
|
|
9154
|
+
MercadoPagoStatusDetailEnum["pending_waiting_transfer"] = "pending_waiting_transfer";
|
|
9155
|
+
MercadoPagoStatusDetailEnum["pending_waiting_payment"] = "pending_waiting_payment";
|
|
9156
|
+
MercadoPagoStatusDetailEnum["pending_challenge"] = "pending_challenge";
|
|
9157
|
+
MercadoPagoStatusDetailEnum["bank_error"] = "bank_error";
|
|
9158
|
+
MercadoPagoStatusDetailEnum["cc_rejected_3ds_mandatory"] = "cc_rejected_3ds_mandatory";
|
|
9159
|
+
MercadoPagoStatusDetailEnum["cc_rejected_bad_filled_card_number"] = "cc_rejected_bad_filled_card_number";
|
|
9160
|
+
MercadoPagoStatusDetailEnum["cc_rejected_bad_filled_date"] = "cc_rejected_bad_filled_date";
|
|
9161
|
+
MercadoPagoStatusDetailEnum["cc_rejected_bad_filled_other"] = "cc_rejected_bad_filled_other";
|
|
9162
|
+
MercadoPagoStatusDetailEnum["cc_rejected_bad_filled_security_code"] = "cc_rejected_bad_filled_security_code";
|
|
9163
|
+
MercadoPagoStatusDetailEnum["cc_rejected_blacklist"] = "cc_rejected_blacklist";
|
|
9164
|
+
MercadoPagoStatusDetailEnum["cc_rejected_call_for_authorize"] = "cc_rejected_call_for_authorize";
|
|
9165
|
+
MercadoPagoStatusDetailEnum["cc_rejected_card_disabled"] = "cc_rejected_card_disabled";
|
|
9166
|
+
MercadoPagoStatusDetailEnum["cc_rejected_card_error"] = "cc_rejected_card_error";
|
|
9167
|
+
MercadoPagoStatusDetailEnum["cc_rejected_duplicated_payment"] = "cc_rejected_duplicated_payment";
|
|
9168
|
+
MercadoPagoStatusDetailEnum["cc_rejected_high_risk"] = "cc_rejected_high_risk";
|
|
9169
|
+
MercadoPagoStatusDetailEnum["cc_rejected_insufficient_amount"] = "cc_rejected_insufficient_amount";
|
|
9170
|
+
MercadoPagoStatusDetailEnum["cc_rejected_invalid_installments"] = "cc_rejected_invalid_installments";
|
|
9171
|
+
MercadoPagoStatusDetailEnum["cc_rejected_max_attempts"] = "cc_rejected_max_attempts";
|
|
9172
|
+
MercadoPagoStatusDetailEnum["cc_rejected_other_reason"] = "cc_rejected_other_reason";
|
|
9173
|
+
MercadoPagoStatusDetailEnum["cc_amount_rate_limit_exceeded"] = "cc_amount_rate_limit_exceeded";
|
|
9174
|
+
MercadoPagoStatusDetailEnum["rejected_insufficient_data"] = "rejected_insufficient_data";
|
|
9175
|
+
MercadoPagoStatusDetailEnum["rejected_by_bank"] = "rejected_by_bank";
|
|
9176
|
+
MercadoPagoStatusDetailEnum["rejected_by_regulations"] = "rejected_by_regulations";
|
|
9177
|
+
MercadoPagoStatusDetailEnum["insufficient_amount"] = "insufficient_amount";
|
|
9178
|
+
MercadoPagoStatusDetailEnum["cc_rejected_card_type_not_allowed"] = "cc_rejected_card_type_not_allowed";
|
|
9179
|
+
})(exports.MercadoPagoStatusDetailEnum || (exports.MercadoPagoStatusDetailEnum = {}));
|
|
9180
|
+
|
|
9181
|
+
exports.MercadoPagoStatusEnum = void 0;
|
|
9182
|
+
(function (MercadoPagoStatusEnum) {
|
|
9183
|
+
MercadoPagoStatusEnum["approved"] = "approved";
|
|
9184
|
+
MercadoPagoStatusEnum["authorized"] = "authorized";
|
|
9185
|
+
MercadoPagoStatusEnum["pending"] = "pending";
|
|
9186
|
+
MercadoPagoStatusEnum["in_process"] = "in_process";
|
|
9187
|
+
MercadoPagoStatusEnum["rejected"] = "rejected";
|
|
9188
|
+
MercadoPagoStatusEnum["cancelled"] = "cancelled";
|
|
9189
|
+
MercadoPagoStatusEnum["refunded"] = "refunded";
|
|
9190
|
+
MercadoPagoStatusEnum["charged_back"] = "charged_back";
|
|
9191
|
+
})(exports.MercadoPagoStatusEnum || (exports.MercadoPagoStatusEnum = {}));
|
|
9192
|
+
|
|
9116
9193
|
class PagarmeBankSlipAxiosAdapter {
|
|
9117
9194
|
constructor(credentials, paymentRepository) {
|
|
9118
9195
|
this.credentials = credentials;
|
package/index.esm.js
CHANGED
|
@@ -38,6 +38,18 @@ var OrderBlockedType;
|
|
|
38
38
|
OrderBlockedType["Boleto"] = "Boleto";
|
|
39
39
|
})(OrderBlockedType || (OrderBlockedType = {}));
|
|
40
40
|
|
|
41
|
+
var OrderPaymentStatus;
|
|
42
|
+
(function (OrderPaymentStatus) {
|
|
43
|
+
OrderPaymentStatus["Em processamento"] = "processing";
|
|
44
|
+
OrderPaymentStatus["Autorizada"] = "authorized";
|
|
45
|
+
OrderPaymentStatus["Pago"] = "paid";
|
|
46
|
+
OrderPaymentStatus["Estornada"] = "refunded";
|
|
47
|
+
OrderPaymentStatus["Aguardando pagamento"] = "waiting_payment";
|
|
48
|
+
OrderPaymentStatus["Aguardando estorno"] = "pending_refund";
|
|
49
|
+
OrderPaymentStatus["Recusada/N\u00E3o autorizada"] = "refused";
|
|
50
|
+
OrderPaymentStatus["Chargedback"] = "chargedback";
|
|
51
|
+
})(OrderPaymentStatus || (OrderPaymentStatus = {}));
|
|
52
|
+
|
|
41
53
|
var PagarmePaymentStatus;
|
|
42
54
|
(function (PagarmePaymentStatus) {
|
|
43
55
|
PagarmePaymentStatus["Em processamento"] = "processing";
|
|
@@ -8752,7 +8764,7 @@ class MercadoPagoRequestHelper {
|
|
|
8752
8764
|
statement_descriptor: checkout.shop === Shops.GLAMSHOP ? 'Glam' : 'Mens Market',
|
|
8753
8765
|
additional_info: {
|
|
8754
8766
|
items: this.buildItems(checkout),
|
|
8755
|
-
payer: this.buildFullPayer(checkout),
|
|
8767
|
+
...(method === 'credit_card' && { payer: this.buildFullPayer(checkout) }),
|
|
8756
8768
|
},
|
|
8757
8769
|
...(method === 'credit_card' && this.buildCardPayment(card)),
|
|
8758
8770
|
...(method === 'pix' && this.buildPixPayment()),
|
|
@@ -8818,16 +8830,21 @@ class MercadoPagoRequestHelper {
|
|
|
8818
8830
|
static buildBoletoPayment(checkout) {
|
|
8819
8831
|
return {
|
|
8820
8832
|
payment_method_id: 'bolbradesco',
|
|
8821
|
-
date_of_expiration: format(addDays(new Date(),
|
|
8833
|
+
date_of_expiration: format(addDays(new Date(), 3), 'yyyy-MM-dd') + 'T23:59:59.999-03:00',
|
|
8822
8834
|
payer: {
|
|
8823
8835
|
first_name: checkout.user.firstName,
|
|
8824
8836
|
last_name: checkout.user.lastName,
|
|
8837
|
+
email: checkout.user.email,
|
|
8838
|
+
identification: {
|
|
8839
|
+
type: 'CPF',
|
|
8840
|
+
number: checkout.user.cpf.replace(/\D/g, ''),
|
|
8841
|
+
},
|
|
8825
8842
|
phone: {
|
|
8826
8843
|
area_code: checkout.user.phone.substring(0, 2),
|
|
8827
8844
|
number: checkout.user.phone.substring(2),
|
|
8828
8845
|
},
|
|
8829
8846
|
address: {
|
|
8830
|
-
zip_code: checkout.shippingAddress.zip,
|
|
8847
|
+
zip_code: checkout.shippingAddress.zip.replace(/\D/g, ''),
|
|
8831
8848
|
street_name: `${checkout.shippingAddress.street}, ${checkout.shippingAddress.district}`,
|
|
8832
8849
|
street_number: checkout.shippingAddress.number,
|
|
8833
8850
|
neighborhood: checkout.shippingAddress.district,
|
|
@@ -8857,7 +8874,7 @@ class MercadoPagoResponseHelper {
|
|
|
8857
8874
|
id: response.id.toString(),
|
|
8858
8875
|
acquirer_name: PaymentProviders.MERCADOPAGO,
|
|
8859
8876
|
amount: response.transaction_amount,
|
|
8860
|
-
status: response.status,
|
|
8877
|
+
status: this.statusMapping(response.status),
|
|
8861
8878
|
status_reason: response.status_detail?.toString(),
|
|
8862
8879
|
payment_method: method,
|
|
8863
8880
|
currency: response.currency_id?.toString(),
|
|
@@ -8866,20 +8883,18 @@ class MercadoPagoResponseHelper {
|
|
|
8866
8883
|
charger_id: response.charges_details?.at(0)?.id?.toString() ?? null,
|
|
8867
8884
|
...(method == TransactionPaymentMethods.PIX && this.getPixReponse(response)),
|
|
8868
8885
|
...(method == TransactionPaymentMethods.CARD && this.getCardReponse(response)),
|
|
8886
|
+
...(method == TransactionPaymentMethods.BANKSLIP && this.getBoletoReponse(response)),
|
|
8869
8887
|
});
|
|
8870
8888
|
}
|
|
8871
|
-
|
|
8872
|
-
|
|
8873
|
-
|
|
8874
|
-
|
|
8875
|
-
|
|
8876
|
-
|
|
8877
|
-
|
|
8878
|
-
|
|
8879
|
-
|
|
8880
|
-
// boleto_document_number: transaction.document_number?.toString(),
|
|
8881
|
-
// }
|
|
8882
|
-
// }
|
|
8889
|
+
static getBoletoReponse(response) {
|
|
8890
|
+
return {
|
|
8891
|
+
boleto_url: response.transaction_details?.external_resource_url?.toString(),
|
|
8892
|
+
boleto_barcode: response.transaction_details?.barcode?.content?.toString(),
|
|
8893
|
+
boleto_line: response.transaction_details?.digitable_line?.toString(),
|
|
8894
|
+
boleto_expiration_date: response.date_of_expiration?.toString(),
|
|
8895
|
+
boleto_document_number: response.transaction_details?.verification_code?.toString(),
|
|
8896
|
+
};
|
|
8897
|
+
}
|
|
8883
8898
|
static getPixReponse(response) {
|
|
8884
8899
|
return {
|
|
8885
8900
|
pix_qr_code: response.point_of_interaction?.transaction_data?.qr_code,
|
|
@@ -8899,7 +8914,21 @@ class MercadoPagoResponseHelper {
|
|
|
8899
8914
|
card_expiration_year: response.card?.expiration_year?.toString(),
|
|
8900
8915
|
capture_method: response.payment_type_id?.toString(),
|
|
8901
8916
|
authorization_code: response.authorization_code?.toString(),
|
|
8917
|
+
paid_amount: this.statusMapping(response.status) == 'paid' ? response.transaction_details?.total_paid_amount : null,
|
|
8918
|
+
paid_at: this.statusMapping(response.status) == 'paid' ? response.date_approved : null,
|
|
8919
|
+
};
|
|
8920
|
+
}
|
|
8921
|
+
static statusMapping(status) {
|
|
8922
|
+
const statusMap = {
|
|
8923
|
+
approved: 'paid',
|
|
8924
|
+
pending: 'waiting_payment',
|
|
8925
|
+
in_process: 'processing',
|
|
8926
|
+
rejected: 'refused',
|
|
8927
|
+
cancelled: 'refused',
|
|
8928
|
+
refunded: 'refunded',
|
|
8929
|
+
charged_back: 'chargedback',
|
|
8902
8930
|
};
|
|
8931
|
+
return statusMap[status] || status;
|
|
8903
8932
|
}
|
|
8904
8933
|
}
|
|
8905
8934
|
|
|
@@ -8927,7 +8956,7 @@ class MercadoPagoBankSlipAxiosAdapter {
|
|
|
8927
8956
|
data: payload,
|
|
8928
8957
|
});
|
|
8929
8958
|
console.warn('[MERCADO PAGO RESPONSE BOLETO DATA]', JSON.stringify(data));
|
|
8930
|
-
const payment = await this.paymentRepository.create(MercadoPagoResponseHelper.build(TransactionPaymentMethods.
|
|
8959
|
+
const payment = await this.paymentRepository.create(MercadoPagoResponseHelper.build(TransactionPaymentMethods.BANKSLIP, checkout, data));
|
|
8931
8960
|
return payment;
|
|
8932
8961
|
}
|
|
8933
8962
|
catch (error) {
|
|
@@ -8968,7 +8997,8 @@ class MercadoPagoCardAxiosAdapter {
|
|
|
8968
8997
|
data: payload,
|
|
8969
8998
|
});
|
|
8970
8999
|
console.warn('[MERCADO PAGO RESPONSE CARD DATA]', JSON.stringify(data));
|
|
8971
|
-
if ((data.status !== 'approved' && data.status_detail !==
|
|
9000
|
+
if ((data.status !== 'approved' && data.status_detail !== MercadoPagoStatusDetailEnum.accredited) ||
|
|
9001
|
+
data.status !== 'authorized') {
|
|
8972
9002
|
await this.orderBlockedRepository.createBlockedOrderOrPayment({
|
|
8973
9003
|
checkout,
|
|
8974
9004
|
blockType: 'Card not authorized',
|
|
@@ -9089,6 +9119,53 @@ class MercadoPagoPixAxiosAdapter {
|
|
|
9089
9119
|
}
|
|
9090
9120
|
}
|
|
9091
9121
|
|
|
9122
|
+
var MercadoPagoStatusDetailEnum;
|
|
9123
|
+
(function (MercadoPagoStatusDetailEnum) {
|
|
9124
|
+
MercadoPagoStatusDetailEnum["accredited"] = "accredited";
|
|
9125
|
+
MercadoPagoStatusDetailEnum["partially_refunded"] = "partially_refunded";
|
|
9126
|
+
MercadoPagoStatusDetailEnum["pending_capture"] = "pending_capture";
|
|
9127
|
+
MercadoPagoStatusDetailEnum["offline_process"] = "offline_process";
|
|
9128
|
+
MercadoPagoStatusDetailEnum["pending_contingency"] = "pending_contingency";
|
|
9129
|
+
MercadoPagoStatusDetailEnum["pending_review_manual"] = "pending_review_manual";
|
|
9130
|
+
MercadoPagoStatusDetailEnum["pending_waiting_transfer"] = "pending_waiting_transfer";
|
|
9131
|
+
MercadoPagoStatusDetailEnum["pending_waiting_payment"] = "pending_waiting_payment";
|
|
9132
|
+
MercadoPagoStatusDetailEnum["pending_challenge"] = "pending_challenge";
|
|
9133
|
+
MercadoPagoStatusDetailEnum["bank_error"] = "bank_error";
|
|
9134
|
+
MercadoPagoStatusDetailEnum["cc_rejected_3ds_mandatory"] = "cc_rejected_3ds_mandatory";
|
|
9135
|
+
MercadoPagoStatusDetailEnum["cc_rejected_bad_filled_card_number"] = "cc_rejected_bad_filled_card_number";
|
|
9136
|
+
MercadoPagoStatusDetailEnum["cc_rejected_bad_filled_date"] = "cc_rejected_bad_filled_date";
|
|
9137
|
+
MercadoPagoStatusDetailEnum["cc_rejected_bad_filled_other"] = "cc_rejected_bad_filled_other";
|
|
9138
|
+
MercadoPagoStatusDetailEnum["cc_rejected_bad_filled_security_code"] = "cc_rejected_bad_filled_security_code";
|
|
9139
|
+
MercadoPagoStatusDetailEnum["cc_rejected_blacklist"] = "cc_rejected_blacklist";
|
|
9140
|
+
MercadoPagoStatusDetailEnum["cc_rejected_call_for_authorize"] = "cc_rejected_call_for_authorize";
|
|
9141
|
+
MercadoPagoStatusDetailEnum["cc_rejected_card_disabled"] = "cc_rejected_card_disabled";
|
|
9142
|
+
MercadoPagoStatusDetailEnum["cc_rejected_card_error"] = "cc_rejected_card_error";
|
|
9143
|
+
MercadoPagoStatusDetailEnum["cc_rejected_duplicated_payment"] = "cc_rejected_duplicated_payment";
|
|
9144
|
+
MercadoPagoStatusDetailEnum["cc_rejected_high_risk"] = "cc_rejected_high_risk";
|
|
9145
|
+
MercadoPagoStatusDetailEnum["cc_rejected_insufficient_amount"] = "cc_rejected_insufficient_amount";
|
|
9146
|
+
MercadoPagoStatusDetailEnum["cc_rejected_invalid_installments"] = "cc_rejected_invalid_installments";
|
|
9147
|
+
MercadoPagoStatusDetailEnum["cc_rejected_max_attempts"] = "cc_rejected_max_attempts";
|
|
9148
|
+
MercadoPagoStatusDetailEnum["cc_rejected_other_reason"] = "cc_rejected_other_reason";
|
|
9149
|
+
MercadoPagoStatusDetailEnum["cc_amount_rate_limit_exceeded"] = "cc_amount_rate_limit_exceeded";
|
|
9150
|
+
MercadoPagoStatusDetailEnum["rejected_insufficient_data"] = "rejected_insufficient_data";
|
|
9151
|
+
MercadoPagoStatusDetailEnum["rejected_by_bank"] = "rejected_by_bank";
|
|
9152
|
+
MercadoPagoStatusDetailEnum["rejected_by_regulations"] = "rejected_by_regulations";
|
|
9153
|
+
MercadoPagoStatusDetailEnum["insufficient_amount"] = "insufficient_amount";
|
|
9154
|
+
MercadoPagoStatusDetailEnum["cc_rejected_card_type_not_allowed"] = "cc_rejected_card_type_not_allowed";
|
|
9155
|
+
})(MercadoPagoStatusDetailEnum || (MercadoPagoStatusDetailEnum = {}));
|
|
9156
|
+
|
|
9157
|
+
var MercadoPagoStatusEnum;
|
|
9158
|
+
(function (MercadoPagoStatusEnum) {
|
|
9159
|
+
MercadoPagoStatusEnum["approved"] = "approved";
|
|
9160
|
+
MercadoPagoStatusEnum["authorized"] = "authorized";
|
|
9161
|
+
MercadoPagoStatusEnum["pending"] = "pending";
|
|
9162
|
+
MercadoPagoStatusEnum["in_process"] = "in_process";
|
|
9163
|
+
MercadoPagoStatusEnum["rejected"] = "rejected";
|
|
9164
|
+
MercadoPagoStatusEnum["cancelled"] = "cancelled";
|
|
9165
|
+
MercadoPagoStatusEnum["refunded"] = "refunded";
|
|
9166
|
+
MercadoPagoStatusEnum["charged_back"] = "charged_back";
|
|
9167
|
+
})(MercadoPagoStatusEnum || (MercadoPagoStatusEnum = {}));
|
|
9168
|
+
|
|
9092
9169
|
class PagarmeBankSlipAxiosAdapter {
|
|
9093
9170
|
constructor(credentials, paymentRepository) {
|
|
9094
9171
|
this.credentials = credentials;
|
|
@@ -10083,4 +10160,4 @@ class ProductsVertexSearch {
|
|
|
10083
10160
|
}
|
|
10084
10161
|
}
|
|
10085
10162
|
|
|
10086
|
-
export { AccessoryImportances, Address, AdyenCardAxiosAdapter, AdyenPaymentMethodFactory, AntifraudBankSlipService, AntifraudCardService, AntifraudGlampointsService, AntifraudPixService, AntifraudProviderFactory, AntifraudProviders, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, BrandCategory, BrandCategoryFirestoreRepository, BrandEquityOptions, BusinessError, BusinessUnitEnum, Buy2Win, Buy2WinFirestoreRepository, Campaign, CampaignBanner, CampaignDashboard, CampaignDashboardFirestoreRepository, CampaignHashtag, CampaignHashtagFirestoreRepository, Category, CategoryCollectionChildren, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryFilter, CategoryFilterHasuraGraphQLRepository, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, CategoryProduct, CategoryProductHasuraGraphQLRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, ClassNameHelper, ConnectBaseDocumentSnapshot, ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, Coupon, CouponCategories, CouponCategory, CouponChannels, CouponFirestoreRepository, CouponOldCategories, CouponSubtypes, CouponTypes, Debug, DebugDecoratorHelper, DebugHelper, DebugNamespaces, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FirebaseFileUploaderService, FragranceImportances, FraudValidationError, GenderDestination, GlampointsPaymentMethodFactory, GlampointsPaymentService, Group, GroupFirestoreRepository, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, Log, LogDocument, LogFirestoreRepository, Logger, MercadoPagoBankSlipAxiosAdapter, MercadoPagoCardAxiosAdapter, MercadoPagoPaymentMethodFactory, MercadoPagoPixAxiosAdapter, MercadoPagoRequestHelper, MercadoPagoResponseHelper, NotFoundError, ObsEmitter, OfficePosition, Order, OrderBlocked, OrderBlockedFirestoreRepository, OrderBlockedType, OrderFirestoreRepository, OrderStatus, PagarMeV5OrderStatus, PagarMeV5PaymentStatus, PagarmeBankSlipAxiosAdapter, PagarmeCardAxiosAdapter, PagarmePaymentMethodFactory, PagarmePaymentStatus, PagarmePixAxiosAdapter, PagarmeV5BankSlipAxiosAdapter, PagarmeV5CardAxiosAdapter, PagarmeV5PixAxiosAdapter, Payment, PaymentError, PaymentFirestoreRepository, PaymentMethods, PaymentProviderFactory, PaymentProviders, PaymentTransaction, PaymentType, PersonTypes, Plans, Product, ProductErrors, ProductErrorsHasuraGraphQL, ProductErrorsHasuraGraphQLRepository, ProductFirestoreRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductLabelEnum, ProductReview, ProductReviewHasuraGraphQLRepository, ProductSpents, ProductStockNotification, ProductStockNotificationHasuraGraphQLRepository, ProductVariantFirestoreRepository, ProductsIndex, ProductsVertexSearch, QuestionsFilters, RecoveryPassword, ReflectHelper, Register, RegisterFirebaseAuthService, RequiredArgumentError, RestCacheAdapter, RoundProductPricesHelper, Sequence, SequenceFirestoreRepository, ShippingMethod, ShopMenu, ShopMenuFirestoreRepository, ShopPageName, ShopSettings, ShopSettingsFirestoreRepository, Shops, SignInMethods, SignOut, Status, StockLimitError, StockOutError, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionMaterialization, SubscriptionMaterializationFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionSummary, SubscriptionSummaryFirestoreRepository, Trace, TransactionPaymentMethods, UnauthorizedError, UpdateOptionActions, UpdateUserImage, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserType, Variant, VariantHasuraGraphQL, VariantHasuraGraphQLRepository, VertexAxiosAdapter, WeakPasswordError, Where, Wishlist, WishlistHasuraGraphQLRepository, WishlistLogType, deserialize, getClass, is, isDebuggable, isUUID, parseDateTime, registerClass, resolveClass, serialize, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|
|
10163
|
+
export { AccessoryImportances, Address, AdyenCardAxiosAdapter, AdyenPaymentMethodFactory, AntifraudBankSlipService, AntifraudCardService, AntifraudGlampointsService, AntifraudPixService, AntifraudProviderFactory, AntifraudProviders, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, BrandCategory, BrandCategoryFirestoreRepository, BrandEquityOptions, BusinessError, BusinessUnitEnum, Buy2Win, Buy2WinFirestoreRepository, Campaign, CampaignBanner, CampaignDashboard, CampaignDashboardFirestoreRepository, CampaignHashtag, CampaignHashtagFirestoreRepository, Category, CategoryCollectionChildren, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryFilter, CategoryFilterHasuraGraphQLRepository, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, CategoryProduct, CategoryProductHasuraGraphQLRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, ClassNameHelper, ConnectBaseDocumentSnapshot, ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, Coupon, CouponCategories, CouponCategory, CouponChannels, CouponFirestoreRepository, CouponOldCategories, CouponSubtypes, CouponTypes, Debug, DebugDecoratorHelper, DebugHelper, DebugNamespaces, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FirebaseFileUploaderService, FragranceImportances, FraudValidationError, GenderDestination, GlampointsPaymentMethodFactory, GlampointsPaymentService, Group, GroupFirestoreRepository, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, Log, LogDocument, LogFirestoreRepository, Logger, MercadoPagoBankSlipAxiosAdapter, MercadoPagoCardAxiosAdapter, MercadoPagoPaymentMethodFactory, MercadoPagoPixAxiosAdapter, MercadoPagoRequestHelper, MercadoPagoResponseHelper, MercadoPagoStatusDetailEnum, MercadoPagoStatusEnum, NotFoundError, ObsEmitter, OfficePosition, Order, OrderBlocked, OrderBlockedFirestoreRepository, OrderBlockedType, OrderFirestoreRepository, OrderPaymentStatus, OrderStatus, PagarMeV5OrderStatus, PagarMeV5PaymentStatus, PagarmeBankSlipAxiosAdapter, PagarmeCardAxiosAdapter, PagarmePaymentMethodFactory, PagarmePaymentStatus, PagarmePixAxiosAdapter, PagarmeV5BankSlipAxiosAdapter, PagarmeV5CardAxiosAdapter, PagarmeV5PixAxiosAdapter, Payment, PaymentError, PaymentFirestoreRepository, PaymentMethods, PaymentProviderFactory, PaymentProviders, PaymentTransaction, PaymentType, PersonTypes, Plans, Product, ProductErrors, ProductErrorsHasuraGraphQL, ProductErrorsHasuraGraphQLRepository, ProductFirestoreRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductLabelEnum, ProductReview, ProductReviewHasuraGraphQLRepository, ProductSpents, ProductStockNotification, ProductStockNotificationHasuraGraphQLRepository, ProductVariantFirestoreRepository, ProductsIndex, ProductsVertexSearch, QuestionsFilters, RecoveryPassword, ReflectHelper, Register, RegisterFirebaseAuthService, RequiredArgumentError, RestCacheAdapter, RoundProductPricesHelper, Sequence, SequenceFirestoreRepository, ShippingMethod, ShopMenu, ShopMenuFirestoreRepository, ShopPageName, ShopSettings, ShopSettingsFirestoreRepository, Shops, SignInMethods, SignOut, Status, StockLimitError, StockOutError, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionMaterialization, SubscriptionMaterializationFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionSummary, SubscriptionSummaryFirestoreRepository, Trace, TransactionPaymentMethods, UnauthorizedError, UpdateOptionActions, UpdateUserImage, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserType, Variant, VariantHasuraGraphQL, VariantHasuraGraphQLRepository, VertexAxiosAdapter, WeakPasswordError, Where, Wishlist, WishlistHasuraGraphQLRepository, WishlistLogType, deserialize, getClass, is, isDebuggable, isUUID, parseDateTime, registerClass, resolveClass, serialize, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './antifraud-providers.enum';
|
|
2
2
|
export * from './business-unit.enum';
|
|
3
3
|
export * from './order-blocked.enum';
|
|
4
|
+
export * from './order-payment-status.enum';
|
|
4
5
|
export * from './pagarme-payment-status.enum';
|
|
5
6
|
export * from './pagarme-v5-payment-status.enum';
|
|
6
7
|
export * from './payment-methods.enum';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare enum OrderPaymentStatus {
|
|
2
|
+
'Em processamento' = "processing",
|
|
3
|
+
'Autorizada' = "authorized",
|
|
4
|
+
'Pago' = "paid",
|
|
5
|
+
'Estornada' = "refunded",
|
|
6
|
+
'Aguardando pagamento' = "waiting_payment",
|
|
7
|
+
'Aguardando estorno' = "pending_refund",
|
|
8
|
+
'Recusada/Não autorizada' = "refused",
|
|
9
|
+
'Chargedback' = "chargedback"
|
|
10
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { PaymentProviderCard, PaymentProviderPix } from '../interfaces';
|
|
1
|
+
import { PaymentProviderBankSlip, PaymentProviderCard, PaymentProviderPix } from '../interfaces';
|
|
2
2
|
import { MercadoPagoCard } from '../types';
|
|
3
3
|
import { BasePaymentMethodFactory } from './base-payment-method.factory';
|
|
4
4
|
type MercadoPagoPaymentFactoryMethods = {
|
|
5
5
|
card?: PaymentProviderCard<MercadoPagoCard>;
|
|
6
6
|
pix?: PaymentProviderPix;
|
|
7
|
+
bankSlip?: PaymentProviderBankSlip;
|
|
7
8
|
};
|
|
8
9
|
export declare class MercadoPagoPaymentMethodFactory extends BasePaymentMethodFactory<MercadoPagoPaymentFactoryMethods> {
|
|
9
10
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare enum MercadoPagoStatusDetailEnum {
|
|
2
|
+
'accredited' = "accredited",
|
|
3
|
+
'partially_refunded' = "partially_refunded",
|
|
4
|
+
'pending_capture' = "pending_capture",
|
|
5
|
+
'offline_process' = "offline_process",
|
|
6
|
+
'pending_contingency' = "pending_contingency",
|
|
7
|
+
'pending_review_manual' = "pending_review_manual",
|
|
8
|
+
'pending_waiting_transfer' = "pending_waiting_transfer",
|
|
9
|
+
'pending_waiting_payment' = "pending_waiting_payment",
|
|
10
|
+
'pending_challenge' = "pending_challenge",
|
|
11
|
+
'bank_error' = "bank_error",
|
|
12
|
+
'cc_rejected_3ds_mandatory' = "cc_rejected_3ds_mandatory",
|
|
13
|
+
'cc_rejected_bad_filled_card_number' = "cc_rejected_bad_filled_card_number",
|
|
14
|
+
'cc_rejected_bad_filled_date' = "cc_rejected_bad_filled_date",
|
|
15
|
+
'cc_rejected_bad_filled_other' = "cc_rejected_bad_filled_other",
|
|
16
|
+
'cc_rejected_bad_filled_security_code' = "cc_rejected_bad_filled_security_code",
|
|
17
|
+
'cc_rejected_blacklist' = "cc_rejected_blacklist",
|
|
18
|
+
'cc_rejected_call_for_authorize' = "cc_rejected_call_for_authorize",
|
|
19
|
+
'cc_rejected_card_disabled' = "cc_rejected_card_disabled",
|
|
20
|
+
'cc_rejected_card_error' = "cc_rejected_card_error",
|
|
21
|
+
'cc_rejected_duplicated_payment' = "cc_rejected_duplicated_payment",
|
|
22
|
+
'cc_rejected_high_risk' = "cc_rejected_high_risk",
|
|
23
|
+
'cc_rejected_insufficient_amount' = "cc_rejected_insufficient_amount",
|
|
24
|
+
'cc_rejected_invalid_installments' = "cc_rejected_invalid_installments",
|
|
25
|
+
'cc_rejected_max_attempts' = "cc_rejected_max_attempts",
|
|
26
|
+
'cc_rejected_other_reason' = "cc_rejected_other_reason",
|
|
27
|
+
'cc_amount_rate_limit_exceeded' = "cc_amount_rate_limit_exceeded",
|
|
28
|
+
'rejected_insufficient_data' = "rejected_insufficient_data",
|
|
29
|
+
'rejected_by_bank' = "rejected_by_bank",
|
|
30
|
+
'rejected_by_regulations' = "rejected_by_regulations",
|
|
31
|
+
'insufficient_amount' = "insufficient_amount",
|
|
32
|
+
'cc_rejected_card_type_not_allowed' = "cc_rejected_card_type_not_allowed"
|
|
33
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare enum MercadoPagoStatusEnum {
|
|
2
|
+
'approved' = "approved",
|
|
3
|
+
'authorized' = "authorized",
|
|
4
|
+
'pending' = "pending",
|
|
5
|
+
'in_process' = "in_process",
|
|
6
|
+
'rejected' = "rejected",
|
|
7
|
+
'cancelled' = "cancelled",
|
|
8
|
+
'refunded' = "refunded",
|
|
9
|
+
'charged_back' = "charged_back"
|
|
10
|
+
}
|
|
@@ -11,6 +11,11 @@ export declare class MercadoPagoRequestHelper {
|
|
|
11
11
|
payer: {
|
|
12
12
|
first_name: string;
|
|
13
13
|
last_name: string;
|
|
14
|
+
email: string;
|
|
15
|
+
identification: {
|
|
16
|
+
type: string;
|
|
17
|
+
number: string;
|
|
18
|
+
};
|
|
14
19
|
phone: {
|
|
15
20
|
area_code: string;
|
|
16
21
|
number: string;
|
|
@@ -33,15 +38,6 @@ export declare class MercadoPagoRequestHelper {
|
|
|
33
38
|
};
|
|
34
39
|
statement_descriptor: string;
|
|
35
40
|
additional_info: {
|
|
36
|
-
items: {
|
|
37
|
-
id: string;
|
|
38
|
-
title: string;
|
|
39
|
-
description: string;
|
|
40
|
-
picture_url: string;
|
|
41
|
-
category_id: string;
|
|
42
|
-
quantity: number;
|
|
43
|
-
unit_price: number;
|
|
44
|
-
}[];
|
|
45
41
|
payer: {
|
|
46
42
|
first_name: string;
|
|
47
43
|
last_name: string;
|
|
@@ -58,6 +54,15 @@ export declare class MercadoPagoRequestHelper {
|
|
|
58
54
|
federal_unit: string;
|
|
59
55
|
};
|
|
60
56
|
};
|
|
57
|
+
items: {
|
|
58
|
+
id: string;
|
|
59
|
+
title: string;
|
|
60
|
+
description: string;
|
|
61
|
+
picture_url: string;
|
|
62
|
+
category_id: string;
|
|
63
|
+
quantity: number;
|
|
64
|
+
unit_price: number;
|
|
65
|
+
}[];
|
|
61
66
|
};
|
|
62
67
|
};
|
|
63
68
|
private static buildItems;
|
|
@@ -3,6 +3,8 @@ import { MercadoPagoResponse } from '../types';
|
|
|
3
3
|
export declare class MercadoPagoResponseHelper {
|
|
4
4
|
static build(method: TransactionPaymentMethods, checkout: Checkout, response: MercadoPagoResponse): Payment;
|
|
5
5
|
private static buildPaymentTransaction;
|
|
6
|
+
private static getBoletoReponse;
|
|
6
7
|
private static getPixReponse;
|
|
7
8
|
private static getCardReponse;
|
|
9
|
+
static statusMapping(status: string): string;
|
|
8
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { MercadoPagoStatusDetail } from './mercado-pago-status-detail.type';
|
|
2
|
+
import { MercadoPagoStatus } from './mercado-pago-status.type';
|
|
3
3
|
export type MercadoPagoResponse = {
|
|
4
4
|
id: number;
|
|
5
5
|
date_created?: string;
|
|
@@ -102,6 +102,9 @@ export type MercadoPagoResponse = {
|
|
|
102
102
|
financing_group?: any;
|
|
103
103
|
deduction_schema?: string;
|
|
104
104
|
installments?: number;
|
|
105
|
+
barcode?: {
|
|
106
|
+
content?: string;
|
|
107
|
+
};
|
|
105
108
|
transaction_details?: {
|
|
106
109
|
payment_method_reference_id?: any;
|
|
107
110
|
acquirer_reference?: any;
|
|
@@ -112,6 +115,11 @@ export type MercadoPagoResponse = {
|
|
|
112
115
|
installment_amount?: number;
|
|
113
116
|
financial_institution?: any;
|
|
114
117
|
payable_deferral_period?: any;
|
|
118
|
+
digitable_line?: string;
|
|
119
|
+
barcode?: {
|
|
120
|
+
content?: string;
|
|
121
|
+
};
|
|
122
|
+
verification_code?: string;
|
|
115
123
|
};
|
|
116
124
|
fee_details?: any[];
|
|
117
125
|
charges_details?: [
|