@infrab4a/connect 5.4.0-beta.20 → 5.4.0-beta.21

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
@@ -148,6 +148,9 @@ class AntifraudProviderFactory {
148
148
  class GlampointsPaymentMethodFactory extends BasePaymentMethodFactory {
149
149
  }
150
150
 
151
+ class MercadoPagoPaymentMethodFactory extends BasePaymentMethodFactory {
152
+ }
153
+
151
154
  class PagarmePaymentMethodFactory extends BasePaymentMethodFactory {
152
155
  }
153
156
 
@@ -8777,6 +8780,7 @@ class MercadoPagoRequestHelper {
8777
8780
  },
8778
8781
  ...(method === 'credit_card' && this.buildCardPayment(card)),
8779
8782
  ...(method === 'pix' && this.buildPixPayment()),
8783
+ ...(method === 'boleto' && this.buildBoletoPayment(checkout)),
8780
8784
  };
8781
8785
  }
8782
8786
  static buildItems(checkout) {
@@ -8817,6 +8821,9 @@ class MercadoPagoRequestHelper {
8817
8821
  zip_code: checkout.shippingAddress.zip,
8818
8822
  street_name: `${checkout.shippingAddress.street}, ${checkout.shippingAddress.district}`,
8819
8823
  street_number: checkout.shippingAddress.number,
8824
+ neighborhood: checkout.shippingAddress.district,
8825
+ city: checkout.shippingAddress.city,
8826
+ federal_unit: checkout.shippingAddress.state,
8820
8827
  },
8821
8828
  };
8822
8829
  }
@@ -8832,6 +8839,28 @@ class MercadoPagoRequestHelper {
8832
8839
  date_of_expiration: dateFns.format(dateFns.addDays(new Date(), 1), 'yyyy-MM-dd') + 'T23:59:59.999-03:00',
8833
8840
  };
8834
8841
  }
8842
+ static buildBoletoPayment(checkout) {
8843
+ return {
8844
+ payment_method_id: 'bolbradesco',
8845
+ date_of_expiration: dateFns.format(dateFns.addDays(new Date(), 1), 'yyyy-MM-dd') + 'T23:59:59.999-03:00',
8846
+ payer: {
8847
+ first_name: checkout.user.firstName,
8848
+ last_name: checkout.user.lastName,
8849
+ phone: {
8850
+ area_code: checkout.user.phone.substring(0, 2),
8851
+ number: checkout.user.phone.substring(2),
8852
+ },
8853
+ address: {
8854
+ zip_code: checkout.shippingAddress.zip,
8855
+ street_name: `${checkout.shippingAddress.street}, ${checkout.shippingAddress.district}`,
8856
+ street_number: checkout.shippingAddress.number,
8857
+ neighborhood: checkout.shippingAddress.district,
8858
+ city: checkout.shippingAddress.city,
8859
+ federal_unit: checkout.shippingAddress.state,
8860
+ },
8861
+ },
8862
+ };
8863
+ }
8835
8864
  }
8836
8865
 
8837
8866
  class MercadoPagoResponseHelper {
@@ -8898,6 +8927,46 @@ class MercadoPagoResponseHelper {
8898
8927
  }
8899
8928
  }
8900
8929
 
8930
+ class MercadoPagoBankSlipAxiosAdapter {
8931
+ constructor(credentials, paymentRepository) {
8932
+ this.credentials = credentials;
8933
+ this.paymentRepository = paymentRepository;
8934
+ }
8935
+ async pay(checkout) {
8936
+ try {
8937
+ const payload = MercadoPagoRequestHelper.build({
8938
+ checkout,
8939
+ method: 'boleto',
8940
+ postback: this.credentials.postback,
8941
+ });
8942
+ console.warn('[MERCADO PAGO BOLETO DATA TO SEND]', JSON.stringify(payload));
8943
+ const { data } = await axios__default["default"]({
8944
+ method: 'POST',
8945
+ url: `${this.credentials.url}/v1/payments`,
8946
+ headers: {
8947
+ 'X-Idempotency-Key': `${checkout.id}-${new Date().getTime()}`,
8948
+ Authorization: `Bearer ${this.credentials.api_key}`,
8949
+ 'Content-Type': 'application/json',
8950
+ },
8951
+ data: payload,
8952
+ });
8953
+ console.warn('[MERCADO PAGO RESPONSE BOLETO DATA]', JSON.stringify(data));
8954
+ const payment = await this.paymentRepository.create(MercadoPagoResponseHelper.build(exports.TransactionPaymentMethods.PIX, checkout, data));
8955
+ return payment;
8956
+ }
8957
+ catch (error) {
8958
+ if (error instanceof axios.AxiosError) {
8959
+ console.warn(error.response);
8960
+ console.warn(error.response.data);
8961
+ console.warn(error.response.data.cause);
8962
+ }
8963
+ }
8964
+ }
8965
+ getBoletoTransaction(paymentId) {
8966
+ throw new Error('Method not implemented.');
8967
+ }
8968
+ }
8969
+
8901
8970
  class MercadoPagoCardAxiosAdapter {
8902
8971
  constructor(credentials, paymentRepository, orderBlockedRepository) {
8903
8972
  this.credentials = credentials;
@@ -9024,7 +9093,7 @@ class MercadoPagoPixAxiosAdapter {
9024
9093
  method: 'POST',
9025
9094
  url: `${this.credentials.url}/v1/payments`,
9026
9095
  headers: {
9027
- 'X-Idempotency-Key': checkout.id,
9096
+ 'X-Idempotency-Key': `${checkout.id}-${new Date().getTime()}`,
9028
9097
  Authorization: `Bearer ${this.credentials.api_key}`,
9029
9098
  'Content-Type': 'application/json',
9030
9099
  },
@@ -10237,7 +10306,9 @@ exports.Log = Log;
10237
10306
  exports.LogDocument = LogDocument;
10238
10307
  exports.LogFirestoreRepository = LogFirestoreRepository;
10239
10308
  exports.Logger = Logger;
10309
+ exports.MercadoPagoBankSlipAxiosAdapter = MercadoPagoBankSlipAxiosAdapter;
10240
10310
  exports.MercadoPagoCardAxiosAdapter = MercadoPagoCardAxiosAdapter;
10311
+ exports.MercadoPagoPaymentMethodFactory = MercadoPagoPaymentMethodFactory;
10241
10312
  exports.MercadoPagoPixAxiosAdapter = MercadoPagoPixAxiosAdapter;
10242
10313
  exports.MercadoPagoRequestHelper = MercadoPagoRequestHelper;
10243
10314
  exports.MercadoPagoResponseHelper = MercadoPagoResponseHelper;
package/index.esm.js CHANGED
@@ -124,6 +124,9 @@ class AntifraudProviderFactory {
124
124
  class GlampointsPaymentMethodFactory extends BasePaymentMethodFactory {
125
125
  }
126
126
 
127
+ class MercadoPagoPaymentMethodFactory extends BasePaymentMethodFactory {
128
+ }
129
+
127
130
  class PagarmePaymentMethodFactory extends BasePaymentMethodFactory {
128
131
  }
129
132
 
@@ -8753,6 +8756,7 @@ class MercadoPagoRequestHelper {
8753
8756
  },
8754
8757
  ...(method === 'credit_card' && this.buildCardPayment(card)),
8755
8758
  ...(method === 'pix' && this.buildPixPayment()),
8759
+ ...(method === 'boleto' && this.buildBoletoPayment(checkout)),
8756
8760
  };
8757
8761
  }
8758
8762
  static buildItems(checkout) {
@@ -8793,6 +8797,9 @@ class MercadoPagoRequestHelper {
8793
8797
  zip_code: checkout.shippingAddress.zip,
8794
8798
  street_name: `${checkout.shippingAddress.street}, ${checkout.shippingAddress.district}`,
8795
8799
  street_number: checkout.shippingAddress.number,
8800
+ neighborhood: checkout.shippingAddress.district,
8801
+ city: checkout.shippingAddress.city,
8802
+ federal_unit: checkout.shippingAddress.state,
8796
8803
  },
8797
8804
  };
8798
8805
  }
@@ -8808,6 +8815,28 @@ class MercadoPagoRequestHelper {
8808
8815
  date_of_expiration: format(addDays(new Date(), 1), 'yyyy-MM-dd') + 'T23:59:59.999-03:00',
8809
8816
  };
8810
8817
  }
8818
+ static buildBoletoPayment(checkout) {
8819
+ return {
8820
+ payment_method_id: 'bolbradesco',
8821
+ date_of_expiration: format(addDays(new Date(), 1), 'yyyy-MM-dd') + 'T23:59:59.999-03:00',
8822
+ payer: {
8823
+ first_name: checkout.user.firstName,
8824
+ last_name: checkout.user.lastName,
8825
+ phone: {
8826
+ area_code: checkout.user.phone.substring(0, 2),
8827
+ number: checkout.user.phone.substring(2),
8828
+ },
8829
+ address: {
8830
+ zip_code: checkout.shippingAddress.zip,
8831
+ street_name: `${checkout.shippingAddress.street}, ${checkout.shippingAddress.district}`,
8832
+ street_number: checkout.shippingAddress.number,
8833
+ neighborhood: checkout.shippingAddress.district,
8834
+ city: checkout.shippingAddress.city,
8835
+ federal_unit: checkout.shippingAddress.state,
8836
+ },
8837
+ },
8838
+ };
8839
+ }
8811
8840
  }
8812
8841
 
8813
8842
  class MercadoPagoResponseHelper {
@@ -8874,6 +8903,46 @@ class MercadoPagoResponseHelper {
8874
8903
  }
8875
8904
  }
8876
8905
 
8906
+ class MercadoPagoBankSlipAxiosAdapter {
8907
+ constructor(credentials, paymentRepository) {
8908
+ this.credentials = credentials;
8909
+ this.paymentRepository = paymentRepository;
8910
+ }
8911
+ async pay(checkout) {
8912
+ try {
8913
+ const payload = MercadoPagoRequestHelper.build({
8914
+ checkout,
8915
+ method: 'boleto',
8916
+ postback: this.credentials.postback,
8917
+ });
8918
+ console.warn('[MERCADO PAGO BOLETO DATA TO SEND]', JSON.stringify(payload));
8919
+ const { data } = await axios({
8920
+ method: 'POST',
8921
+ url: `${this.credentials.url}/v1/payments`,
8922
+ headers: {
8923
+ 'X-Idempotency-Key': `${checkout.id}-${new Date().getTime()}`,
8924
+ Authorization: `Bearer ${this.credentials.api_key}`,
8925
+ 'Content-Type': 'application/json',
8926
+ },
8927
+ data: payload,
8928
+ });
8929
+ console.warn('[MERCADO PAGO RESPONSE BOLETO DATA]', JSON.stringify(data));
8930
+ const payment = await this.paymentRepository.create(MercadoPagoResponseHelper.build(TransactionPaymentMethods.PIX, checkout, data));
8931
+ return payment;
8932
+ }
8933
+ catch (error) {
8934
+ if (error instanceof AxiosError) {
8935
+ console.warn(error.response);
8936
+ console.warn(error.response.data);
8937
+ console.warn(error.response.data.cause);
8938
+ }
8939
+ }
8940
+ }
8941
+ getBoletoTransaction(paymentId) {
8942
+ throw new Error('Method not implemented.');
8943
+ }
8944
+ }
8945
+
8877
8946
  class MercadoPagoCardAxiosAdapter {
8878
8947
  constructor(credentials, paymentRepository, orderBlockedRepository) {
8879
8948
  this.credentials = credentials;
@@ -9000,7 +9069,7 @@ class MercadoPagoPixAxiosAdapter {
9000
9069
  method: 'POST',
9001
9070
  url: `${this.credentials.url}/v1/payments`,
9002
9071
  headers: {
9003
- 'X-Idempotency-Key': checkout.id,
9072
+ 'X-Idempotency-Key': `${checkout.id}-${new Date().getTime()}`,
9004
9073
  Authorization: `Bearer ${this.credentials.api_key}`,
9005
9074
  'Content-Type': 'application/json',
9006
9075
  },
@@ -10014,4 +10083,4 @@ class ProductsVertexSearch {
10014
10083
  }
10015
10084
  }
10016
10085
 
10017
- 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, MercadoPagoCardAxiosAdapter, 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 };
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrab4a/connect",
3
- "version": "5.4.0-beta.20",
3
+ "version": "5.4.0-beta.21",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },
@@ -1,5 +1,6 @@
1
1
  export * from './adyen-payment-method.factory';
2
2
  export * from './antifraud-provider.factory';
3
3
  export * from './glampoints-payment-method.factory';
4
+ export * from './mercado-pago-payment-method.factory';
4
5
  export * from './pagarme-payment-method.factory';
5
6
  export * from './payment-provider.factory';
@@ -1,8 +1,9 @@
1
- import { PaymentProviderCard } from '../interfaces';
1
+ import { 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
+ pix?: PaymentProviderPix;
6
7
  };
7
8
  export declare class MercadoPagoPaymentMethodFactory extends BasePaymentMethodFactory<MercadoPagoPaymentFactoryMethods> {
8
9
  }
@@ -1,2 +1,3 @@
1
+ export * from './mercado-pago-boleto-payment-axios.adapter';
1
2
  export * from './mercado-pago-card-payment-axios.adapter';
2
3
  export * from './mercado-pago-pix-payment-axios.adapter';
@@ -0,0 +1,8 @@
1
+ import { Checkout, MercadoPagoCredentials, Payment, PaymentProviderBankSlip, PaymentRepository, PaymentTransaction } from '../../../domain';
2
+ export declare class MercadoPagoBankSlipAxiosAdapter implements PaymentProviderBankSlip {
3
+ private credentials;
4
+ private paymentRepository;
5
+ constructor(credentials: MercadoPagoCredentials, paymentRepository: PaymentRepository);
6
+ pay(checkout: Checkout): Promise<Payment>;
7
+ getBoletoTransaction(paymentId: number): Promise<PaymentTransaction>;
8
+ }
@@ -8,6 +8,22 @@ export declare class MercadoPagoRequestHelper {
8
8
  }): {
9
9
  payment_method_id: string;
10
10
  date_of_expiration: string;
11
+ payer: {
12
+ first_name: string;
13
+ last_name: string;
14
+ phone: {
15
+ area_code: string;
16
+ number: string;
17
+ };
18
+ address: {
19
+ zip_code: string;
20
+ street_name: string;
21
+ street_number: string;
22
+ neighborhood: string;
23
+ city: string;
24
+ federal_unit: string;
25
+ };
26
+ };
11
27
  installments: any;
12
28
  token: any;
13
29
  transaction_amount: number;
@@ -15,15 +31,6 @@ export declare class MercadoPagoRequestHelper {
15
31
  metadata: {
16
32
  checkoutId: string;
17
33
  };
18
- payer: {
19
- first_name: string;
20
- last_name: string;
21
- email: string;
22
- identification: {
23
- type: string;
24
- number: string;
25
- };
26
- };
27
34
  statement_descriptor: string;
28
35
  additional_info: {
29
36
  items: {
@@ -46,6 +53,9 @@ export declare class MercadoPagoRequestHelper {
46
53
  zip_code: string;
47
54
  street_name: string;
48
55
  street_number: string;
56
+ neighborhood: string;
57
+ city: string;
58
+ federal_unit: string;
49
59
  };
50
60
  };
51
61
  };
@@ -55,4 +65,5 @@ export declare class MercadoPagoRequestHelper {
55
65
  private static buildFullPayer;
56
66
  private static buildCardPayment;
57
67
  private static buildPixPayment;
68
+ private static buildBoletoPayment;
58
69
  }