@infrab4a/connect 5.2.0-beta.2 → 5.2.0-beta.4

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
@@ -8718,7 +8718,7 @@ class PagarMeV5RequestHelper {
8718
8718
  static getCardOrder(checkout, card) {
8719
8719
  return {
8720
8720
  installments: card.installments,
8721
- statement_descriptor: checkout.shop === exports.Shops.GLAMSHOP ? 'Glam' : "Men's Market",
8721
+ statement_descriptor: checkout.shop === exports.Shops.GLAMSHOP ? 'Glam' : 'Mens Market',
8722
8722
  card_id: card.cardId,
8723
8723
  card: {
8724
8724
  cvv: card.cardCvv,
@@ -9069,9 +9069,8 @@ class PagarmeV5BankSlipAxiosAdapter {
9069
9069
  return payment;
9070
9070
  }
9071
9071
  catch (error) {
9072
- console.error('Full error: ', JSON.stringify(error));
9073
9072
  if (error instanceof axios.AxiosError) {
9074
- console.error('Error response: ', error.response, 'error data: ', error.response?.data);
9073
+ console.error('error data: ', JSON.stringify(error.response?.data));
9075
9074
  }
9076
9075
  throw new PaymentError('Houve uma falha ao gerar o boleto. Tente novamente', {
9077
9076
  checkoutId: checkout.id,
@@ -9141,9 +9140,8 @@ class PagarmeV5CardAxiosAdapter {
9141
9140
  if (error instanceof PaymentError) {
9142
9141
  throw error;
9143
9142
  }
9144
- console.error('Full error: ', JSON.stringify(error));
9145
9143
  if (error instanceof axios.AxiosError) {
9146
- console.error('Error response: ', error.response, 'error data: ', error.response?.data);
9144
+ console.error('error data: ', JSON.stringify(error.response?.data));
9147
9145
  }
9148
9146
  throw PagarmeBlockedOrderHelper.createGenericPaymentError(checkout, error.response?.data);
9149
9147
  }
@@ -9301,10 +9299,8 @@ class PagarmeV5PixAxiosAdapter {
9301
9299
  return payment;
9302
9300
  }
9303
9301
  catch (error) {
9304
- console.error('Full error: ', JSON.stringify(error));
9305
9302
  if (error instanceof axios.AxiosError) {
9306
- console.error('Error: ', error.message);
9307
- console.error('Error response: ', error.response, 'error data: ', error.response?.data);
9303
+ console.error('error data: ', JSON.stringify(error.response?.data));
9308
9304
  }
9309
9305
  throw new PaymentError('Houve uma falha ao processar pagamento com pix', {
9310
9306
  checkoutId: checkout.id,
package/index.esm.js CHANGED
@@ -8693,7 +8693,7 @@ class PagarMeV5RequestHelper {
8693
8693
  static getCardOrder(checkout, card) {
8694
8694
  return {
8695
8695
  installments: card.installments,
8696
- statement_descriptor: checkout.shop === Shops.GLAMSHOP ? 'Glam' : "Men's Market",
8696
+ statement_descriptor: checkout.shop === Shops.GLAMSHOP ? 'Glam' : 'Mens Market',
8697
8697
  card_id: card.cardId,
8698
8698
  card: {
8699
8699
  cvv: card.cardCvv,
@@ -9044,9 +9044,8 @@ class PagarmeV5BankSlipAxiosAdapter {
9044
9044
  return payment;
9045
9045
  }
9046
9046
  catch (error) {
9047
- console.error('Full error: ', JSON.stringify(error));
9048
9047
  if (error instanceof AxiosError) {
9049
- console.error('Error response: ', error.response, 'error data: ', error.response?.data);
9048
+ console.error('error data: ', JSON.stringify(error.response?.data));
9050
9049
  }
9051
9050
  throw new PaymentError('Houve uma falha ao gerar o boleto. Tente novamente', {
9052
9051
  checkoutId: checkout.id,
@@ -9116,9 +9115,8 @@ class PagarmeV5CardAxiosAdapter {
9116
9115
  if (error instanceof PaymentError) {
9117
9116
  throw error;
9118
9117
  }
9119
- console.error('Full error: ', JSON.stringify(error));
9120
9118
  if (error instanceof AxiosError) {
9121
- console.error('Error response: ', error.response, 'error data: ', error.response?.data);
9119
+ console.error('error data: ', JSON.stringify(error.response?.data));
9122
9120
  }
9123
9121
  throw PagarmeBlockedOrderHelper.createGenericPaymentError(checkout, error.response?.data);
9124
9122
  }
@@ -9276,10 +9274,8 @@ class PagarmeV5PixAxiosAdapter {
9276
9274
  return payment;
9277
9275
  }
9278
9276
  catch (error) {
9279
- console.error('Full error: ', JSON.stringify(error));
9280
9277
  if (error instanceof AxiosError) {
9281
- console.error('Error: ', error.message);
9282
- console.error('Error response: ', error.response, 'error data: ', error.response?.data);
9278
+ console.error('error data: ', JSON.stringify(error.response?.data));
9283
9279
  }
9284
9280
  throw new PaymentError('Houve uma falha ao processar pagamento com pix', {
9285
9281
  checkoutId: checkout.id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrab4a/connect",
3
- "version": "5.2.0-beta.2",
3
+ "version": "5.2.0-beta.4",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },
@@ -4,13 +4,19 @@ export interface PagarMeCard extends BaseCard {
4
4
  id: string;
5
5
  date_created: string;
6
6
  date_updated: string;
7
- brand: string;
7
+ brand?: string;
8
8
  holder_name: string;
9
- first_digits: string;
10
- last_digits: string;
9
+ first_digits?: string;
10
+ first_six_digits?: string;
11
+ last_digits?: string;
12
+ last_four_digits?: string;
13
+ exp_month?: number;
14
+ exp_year?: number;
11
15
  country: string;
12
16
  fingerprint: string;
13
17
  customer: string;
14
18
  valid: boolean;
19
+ status?: string;
15
20
  expiration_date: string;
21
+ type: string;
16
22
  }
@@ -5,6 +5,8 @@ export declare class UserPaymentMethod extends BaseModel<UserPaymentMethod, User
5
5
  cpf: string;
6
6
  holderName: string;
7
7
  last4: string;
8
+ last_digits?: string;
9
+ first_digits?: string;
8
10
  pagarmeToken: string;
9
11
  validUntil: string;
10
12
  userId: string;