@infrab4a/connect 5.4.0-beta.21 → 5.4.0-beta.22
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 +46 -17
- package/index.esm.js +47 -18
- 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/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/types/mercado-pago-response.type.d.ts +8 -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,8 +8938,22 @@ 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,
|
|
8926
8943
|
};
|
|
8927
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',
|
|
8954
|
+
};
|
|
8955
|
+
return statusMap[status] || status;
|
|
8956
|
+
}
|
|
8928
8957
|
}
|
|
8929
8958
|
|
|
8930
8959
|
class MercadoPagoBankSlipAxiosAdapter {
|
|
@@ -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) {
|
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,8 +8914,22 @@ 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,
|
|
8902
8919
|
};
|
|
8903
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',
|
|
8930
|
+
};
|
|
8931
|
+
return statusMap[status] || status;
|
|
8932
|
+
}
|
|
8904
8933
|
}
|
|
8905
8934
|
|
|
8906
8935
|
class MercadoPagoBankSlipAxiosAdapter {
|
|
@@ -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) {
|
|
@@ -10083,4 +10112,4 @@ class ProductsVertexSearch {
|
|
|
10083
10112
|
}
|
|
10084
10113
|
}
|
|
10085
10114
|
|
|
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 };
|
|
10115
|
+
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, 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
|
+
}
|
|
@@ -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
|
+
private static statusMapping;
|
|
8
10
|
}
|
|
@@ -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?: [
|