@infrab4a/connect 5.3.0-beta.2 → 5.3.0-beta.20
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 +1990 -242
- package/index.esm.js +1976 -244
- package/package.json +4 -3
- package/src/domain/catalog/models/category-brand.d.ts +17 -0
- package/src/domain/catalog/models/index.d.ts +1 -0
- package/src/domain/catalog/models/product-base.d.ts +1 -0
- package/src/domain/catalog/models/product-review.d.ts +2 -0
- package/src/domain/catalog/models/product.d.ts +1 -0
- package/src/domain/catalog/models/types/brands-shop-menu.type.d.ts +13 -0
- package/src/domain/catalog/models/types/index.d.ts +1 -0
- package/src/domain/catalog/repositories/category-brand.repository.d.ts +4 -0
- package/src/domain/catalog/repositories/category.repository.d.ts +1 -0
- package/src/domain/catalog/repositories/index.d.ts +2 -0
- package/src/domain/catalog/repositories/product-catalog.repository.d.ts +17 -0
- package/src/domain/shopping/enums/index.d.ts +3 -0
- package/src/domain/shopping/enums/order-payment-status.enum.d.ts +10 -0
- package/src/domain/shopping/enums/pagarme-v5-payment-status.enum.d.ts +24 -0
- package/src/domain/shopping/enums/payment-providers.enum.d.ts +2 -1
- package/src/domain/shopping/enums/transaction-payment-methods.enum.d.ts +5 -0
- package/src/domain/shopping/factories/index.d.ts +1 -0
- package/src/domain/shopping/factories/mercado-pago-payment-method.factory.d.ts +11 -0
- package/src/domain/shopping/factories/payment-provider.factory.d.ts +2 -0
- package/src/domain/shopping/interfaces/payment-provider-card.interface.d.ts +10 -2
- package/src/domain/shopping/models/order.d.ts +7 -0
- package/src/domain/shopping/models/payment-transaction.d.ts +19 -2
- package/src/domain/shopping/models/payment.d.ts +3 -1
- package/src/domain/shopping/services/antifraud-card.service.d.ts +2 -0
- package/src/domain/shopping/types/card-info.type.d.ts +1 -0
- package/src/domain/shopping/types/checkout-paylod-request.type.d.ts +2 -7
- package/src/domain/shopping/types/index.d.ts +3 -0
- package/src/domain/shopping/types/mercado-pago-card.type.d.ts +14 -0
- package/src/domain/shopping/types/mercado-pago-credentials.type.d.ts +5 -0
- package/src/domain/shopping/types/pagarme-card.type.d.ts +9 -3
- package/src/domain/shopping/types/pagarme-credentials-v5.type.d.ts +4 -0
- package/src/domain/shopping/types/pagarme-credentials.type.d.ts +9 -3
- package/src/domain/shopping/types/payment-card-info.type.d.ts +3 -0
- package/src/domain/users/models/user-payment-method.d.ts +2 -0
- package/src/infra/firebase/firestore/repositories/catalog/category-brand-firestore.repository.d.ts +7 -0
- package/src/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +1 -0
- package/src/infra/firebase/firestore/repositories/catalog/index.d.ts +1 -0
- package/src/infra/hasura-graphql/models/index.d.ts +1 -0
- package/src/infra/hasura-graphql/models/product-catalog-hasura-graphql.d.ts +16 -0
- package/src/infra/hasura-graphql/models/variant-hasura-graphql.d.ts +7 -0
- package/src/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.d.ts +1 -0
- package/src/infra/hasura-graphql/repositories/catalog/index.d.ts +1 -0
- package/src/infra/hasura-graphql/repositories/catalog/product-catalog-hasura-graphql.repository.d.ts +22 -0
- package/src/infra/hasura-graphql/repositories/catalog/variant-hasura-graphql.repository.d.ts +1 -0
- package/src/infra/hasura-graphql/repositories/catalog/wishlist-hasura-graphql.repository.d.ts +1 -0
- package/src/infra/index.d.ts +1 -0
- package/src/infra/mercado-pago/adapters/index.d.ts +3 -0
- package/src/infra/mercado-pago/adapters/mercado-pago-boleto-payment-axios.adapter.d.ts +8 -0
- package/src/infra/mercado-pago/adapters/mercado-pago-card-payment-axios.adapter.d.ts +20 -0
- package/src/infra/mercado-pago/adapters/mercado-pago-pix-payment-axios.adapter.d.ts +7 -0
- 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/index.d.ts +2 -0
- package/src/infra/mercado-pago/helpers/mercado-pago-request.helper.d.ts +60 -0
- package/src/infra/mercado-pago/helpers/mercado-pago-response.helper.d.ts +10 -0
- package/src/infra/mercado-pago/index.d.ts +4 -0
- package/src/infra/mercado-pago/types/index.d.ts +3 -0
- package/src/infra/mercado-pago/types/mercado-pago-request.type.d.ts +1 -0
- package/src/infra/mercado-pago/types/mercado-pago-response.type.d.ts +188 -0
- 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/src/infra/pagarme/adapters/helpers/index.d.ts +2 -0
- package/src/infra/pagarme/adapters/helpers/pagarme-v5-request.helper.d.ts +13 -0
- package/src/infra/pagarme/adapters/helpers/pagarme-v5-response.helper.d.ts +10 -0
- package/src/infra/pagarme/adapters/index.d.ts +2 -3
- package/src/infra/pagarme/adapters/v4/index.d.ts +3 -0
- package/src/infra/pagarme/adapters/{pagarme-bank-slip-payment-axios.adapter.d.ts → v4/pagarme-bank-slip-payment-axios.adapter.d.ts} +4 -4
- package/src/infra/pagarme/adapters/{pagarme-card-payment-axios.adapter.d.ts → v4/pagarme-card-payment-axios.adapter.d.ts} +7 -6
- package/src/infra/pagarme/adapters/{pagarme-pix-payment-axios.adapter.d.ts → v4/pagarme-pix-payment-axios.adapter.d.ts} +4 -4
- package/src/infra/pagarme/adapters/v5/index.d.ts +3 -0
- package/src/infra/pagarme/adapters/v5/pagarmev5-bank-slip-payment-axios.adapter.d.ts +11 -0
- package/src/infra/pagarme/adapters/v5/pagarmev5-card-payment-axios.adapter.d.ts +24 -0
- package/src/infra/pagarme/adapters/v5/pagarmev5-pix-payment-axios.adapter.d.ts +10 -0
- package/src/infra/pagarme/index.d.ts +1 -0
- package/src/infra/pagarme/types/index.d.ts +1 -0
- package/src/infra/pagarme/types/v5/index.d.ts +4 -0
- package/src/infra/pagarme/types/v5/pagarmev5-customer.type.d.ts +19 -0
- package/src/infra/pagarme/types/v5/pagarmev5-order-request-payload.type.d.ts +90 -0
- package/src/infra/pagarme/types/v5/pagarmev5-order-response.type.d.ts +126 -0
- package/src/infra/pagarme/types/v5/pagarmev5-postback-response.type.d.ts +11 -0
- package/src/utils/index.d.ts +2 -1
package/src/infra/index.d.ts
CHANGED
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BusinessUnitEnum, CardInfo, Checkout, MercadoPagoCard, MercadoPagoCardTokenResponse, MercadoPagoCredentials, OrderBlockedRepository, Payment, PaymentCardInfo, PaymentProviderCard, PaymentRepository, PaymentTransaction, Shops, User, UserAddress } from '../../../domain';
|
|
2
|
+
import { MercadoPagoResponse } from '../types';
|
|
3
|
+
export declare class MercadoPagoCardAxiosAdapter implements PaymentProviderCard<MercadoPagoCard> {
|
|
4
|
+
private credentials;
|
|
5
|
+
private paymentRepository;
|
|
6
|
+
private orderBlockedRepository;
|
|
7
|
+
constructor(credentials: MercadoPagoCredentials, paymentRepository: PaymentRepository, orderBlockedRepository: OrderBlockedRepository);
|
|
8
|
+
pay(checkout: Checkout, card: PaymentCardInfo): Promise<Payment>;
|
|
9
|
+
private getPaymentPayload;
|
|
10
|
+
addCard?(card: CardInfo, customer: User & {
|
|
11
|
+
billingAddress: Partial<UserAddress>;
|
|
12
|
+
}): Promise<MercadoPagoCard>;
|
|
13
|
+
getCardByToken(token: string): Promise<MercadoPagoCardTokenResponse>;
|
|
14
|
+
getCardByToken(customerId: string, token: string, cardCvv: string): Promise<MercadoPagoCardTokenResponse>;
|
|
15
|
+
createCardHash<T>(bu: BusinessUnitEnum, shop: Shops, card?: CardInfo): Promise<string | T>;
|
|
16
|
+
createTransaction(info: any): Promise<PaymentTransaction>;
|
|
17
|
+
createOrUpdateCustomer?(customer: User & {
|
|
18
|
+
billingAddress: Partial<UserAddress>;
|
|
19
|
+
}): Promise<MercadoPagoResponse>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Checkout, MercadoPagoCredentials, Payment, PaymentProviderPix, PaymentRepository } from '../../../domain';
|
|
2
|
+
export declare class MercadoPagoPixAxiosAdapter implements PaymentProviderPix {
|
|
3
|
+
private credentials;
|
|
4
|
+
private paymentRepository;
|
|
5
|
+
constructor(credentials: MercadoPagoCredentials, paymentRepository: PaymentRepository);
|
|
6
|
+
pay(checkout: Checkout): Promise<Payment>;
|
|
7
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Checkout, PaymentCardInfo } from '../../../domain';
|
|
2
|
+
export declare class MercadoPagoRequestHelper {
|
|
3
|
+
static build(data: {
|
|
4
|
+
checkout: Checkout;
|
|
5
|
+
method: 'pix' | 'boleto' | 'credit_card';
|
|
6
|
+
postback: string;
|
|
7
|
+
card?: PaymentCardInfo;
|
|
8
|
+
}): {
|
|
9
|
+
payment_method_id: string;
|
|
10
|
+
date_of_expiration: string;
|
|
11
|
+
payer: {
|
|
12
|
+
first_name: string;
|
|
13
|
+
last_name: string;
|
|
14
|
+
email: string;
|
|
15
|
+
identification: {
|
|
16
|
+
type: string;
|
|
17
|
+
number: string;
|
|
18
|
+
};
|
|
19
|
+
phone: {
|
|
20
|
+
area_code: string;
|
|
21
|
+
number: string;
|
|
22
|
+
};
|
|
23
|
+
address: {
|
|
24
|
+
zip_code: string;
|
|
25
|
+
street_name: string;
|
|
26
|
+
street_number: string;
|
|
27
|
+
neighborhood: string;
|
|
28
|
+
city: string;
|
|
29
|
+
federal_unit: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
installments: any;
|
|
33
|
+
token: any;
|
|
34
|
+
binary_mode: boolean;
|
|
35
|
+
capture: boolean;
|
|
36
|
+
transaction_amount: number;
|
|
37
|
+
notification_url: string;
|
|
38
|
+
metadata: {
|
|
39
|
+
checkoutId: string;
|
|
40
|
+
};
|
|
41
|
+
statement_descriptor: string;
|
|
42
|
+
additional_info: {
|
|
43
|
+
items: {
|
|
44
|
+
id: string;
|
|
45
|
+
title: string;
|
|
46
|
+
description: string;
|
|
47
|
+
picture_url: string;
|
|
48
|
+
category_id: string;
|
|
49
|
+
quantity: number;
|
|
50
|
+
unit_price: number;
|
|
51
|
+
}[];
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
private static buildItems;
|
|
55
|
+
private static buildPayer;
|
|
56
|
+
private static buildFullPayer;
|
|
57
|
+
private static buildCardPayment;
|
|
58
|
+
private static buildPixPayment;
|
|
59
|
+
private static buildBoletoPayment;
|
|
60
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Checkout, Payment, TransactionPaymentMethods } from '../../../domain';
|
|
2
|
+
import { MercadoPagoResponse } from '../types';
|
|
3
|
+
export declare class MercadoPagoResponseHelper {
|
|
4
|
+
static build(method: TransactionPaymentMethods, checkout: Checkout, response: MercadoPagoResponse): Payment;
|
|
5
|
+
private static buildPaymentTransaction;
|
|
6
|
+
private static getBoletoReponse;
|
|
7
|
+
private static getPixReponse;
|
|
8
|
+
private static getCardReponse;
|
|
9
|
+
static statusMapping(status: string): string;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type MercadoPagoRequest = {};
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { MercadoPagoStatusDetail } from './mercado-pago-status-detail.type';
|
|
2
|
+
import { MercadoPagoStatus } from './mercado-pago-status.type';
|
|
3
|
+
export type MercadoPagoResponse = {
|
|
4
|
+
id: number;
|
|
5
|
+
date_created?: string;
|
|
6
|
+
date_approved?: string;
|
|
7
|
+
date_last_updated?: string;
|
|
8
|
+
date_of_expiration?: string;
|
|
9
|
+
money_release_date?: string;
|
|
10
|
+
money_release_status?: string;
|
|
11
|
+
operation_type?: string;
|
|
12
|
+
issuer_id?: string;
|
|
13
|
+
payment_method_id?: string;
|
|
14
|
+
payment_type_id?: string;
|
|
15
|
+
payment_method?: {
|
|
16
|
+
id?: string;
|
|
17
|
+
type?: string;
|
|
18
|
+
issuer_id?: string;
|
|
19
|
+
data?: {
|
|
20
|
+
routing_data?: {
|
|
21
|
+
merchant_account_id?: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
status: MercadoPagoStatus;
|
|
26
|
+
status_detail?: MercadoPagoStatusDetail;
|
|
27
|
+
currency_id?: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
live_mode?: boolean;
|
|
30
|
+
sponsor_id?: string;
|
|
31
|
+
authorization_code?: string;
|
|
32
|
+
money_release_schema?: string;
|
|
33
|
+
taxes_amount?: number;
|
|
34
|
+
counter_currency?: string;
|
|
35
|
+
brand_id?: any;
|
|
36
|
+
shipping_amount?: number;
|
|
37
|
+
build_version?: string;
|
|
38
|
+
pos_id?: any;
|
|
39
|
+
store_id?: any;
|
|
40
|
+
integrator_id?: any;
|
|
41
|
+
platform_id?: any;
|
|
42
|
+
corporation_id?: any;
|
|
43
|
+
payer?: {
|
|
44
|
+
type?: string;
|
|
45
|
+
id?: string;
|
|
46
|
+
operator_id?: string;
|
|
47
|
+
email?: string;
|
|
48
|
+
identification: {
|
|
49
|
+
number?: string;
|
|
50
|
+
type?: string;
|
|
51
|
+
};
|
|
52
|
+
phone: {
|
|
53
|
+
number?: string;
|
|
54
|
+
extension?: string;
|
|
55
|
+
area_code?: string;
|
|
56
|
+
};
|
|
57
|
+
first_name?: string;
|
|
58
|
+
last_name?: string;
|
|
59
|
+
entity_type?: string;
|
|
60
|
+
};
|
|
61
|
+
collector_id?: number;
|
|
62
|
+
marketplace_owner?: any;
|
|
63
|
+
metadata?: {
|
|
64
|
+
order_number?: string;
|
|
65
|
+
};
|
|
66
|
+
additional_info?: {
|
|
67
|
+
items?: [
|
|
68
|
+
{
|
|
69
|
+
id?: string;
|
|
70
|
+
title?: string;
|
|
71
|
+
description?: string;
|
|
72
|
+
picture_url?: string;
|
|
73
|
+
category_id?: string;
|
|
74
|
+
quantity?: string;
|
|
75
|
+
unit_price?: string;
|
|
76
|
+
}
|
|
77
|
+
];
|
|
78
|
+
payer?: {
|
|
79
|
+
phone: {
|
|
80
|
+
area_code?: string;
|
|
81
|
+
number?: string;
|
|
82
|
+
};
|
|
83
|
+
address: {
|
|
84
|
+
zip_code?: string;
|
|
85
|
+
street_name?: string;
|
|
86
|
+
street_number?: string;
|
|
87
|
+
};
|
|
88
|
+
first_name?: string;
|
|
89
|
+
last_name?: string;
|
|
90
|
+
registration_date?: string;
|
|
91
|
+
};
|
|
92
|
+
available_balance?: any;
|
|
93
|
+
nsu_processadora?: any;
|
|
94
|
+
authentication_code?: any;
|
|
95
|
+
};
|
|
96
|
+
order?: any;
|
|
97
|
+
external_reference?: string;
|
|
98
|
+
transaction_amount?: number;
|
|
99
|
+
transaction_amount_refunded?: number;
|
|
100
|
+
coupon_amount?: number;
|
|
101
|
+
differential_pricing_id?: any;
|
|
102
|
+
financing_group?: any;
|
|
103
|
+
deduction_schema?: string;
|
|
104
|
+
installments?: number;
|
|
105
|
+
barcode?: {
|
|
106
|
+
content?: string;
|
|
107
|
+
};
|
|
108
|
+
transaction_details?: {
|
|
109
|
+
payment_method_reference_id?: any;
|
|
110
|
+
acquirer_reference?: any;
|
|
111
|
+
net_received_amount?: number;
|
|
112
|
+
total_paid_amount?: number;
|
|
113
|
+
overpaid_amount?: number;
|
|
114
|
+
external_resource_url?: any;
|
|
115
|
+
installment_amount?: number;
|
|
116
|
+
financial_institution?: any;
|
|
117
|
+
payable_deferral_period?: any;
|
|
118
|
+
digitable_line?: string;
|
|
119
|
+
barcode?: {
|
|
120
|
+
content?: string;
|
|
121
|
+
};
|
|
122
|
+
verification_code?: string;
|
|
123
|
+
};
|
|
124
|
+
fee_details?: any[];
|
|
125
|
+
charges_details?: [
|
|
126
|
+
{
|
|
127
|
+
id?: string;
|
|
128
|
+
name?: string;
|
|
129
|
+
type?: string;
|
|
130
|
+
accounts?: {
|
|
131
|
+
from?: string;
|
|
132
|
+
to?: string;
|
|
133
|
+
};
|
|
134
|
+
client_id?: number;
|
|
135
|
+
date_created?: string;
|
|
136
|
+
last_updated?: string;
|
|
137
|
+
amounts?: {
|
|
138
|
+
original?: number;
|
|
139
|
+
refunded?: number;
|
|
140
|
+
};
|
|
141
|
+
metadata?: any;
|
|
142
|
+
reserve_id?: any;
|
|
143
|
+
refund_charges?: any[];
|
|
144
|
+
}
|
|
145
|
+
];
|
|
146
|
+
captured?: boolean;
|
|
147
|
+
binary_mode?: boolean;
|
|
148
|
+
call_for_authorize_id?: any;
|
|
149
|
+
statement_descriptor?: string;
|
|
150
|
+
card?: {
|
|
151
|
+
id?: string;
|
|
152
|
+
first_six_digits?: string;
|
|
153
|
+
last_four_digits?: string;
|
|
154
|
+
bin?: string;
|
|
155
|
+
expiration_month?: number;
|
|
156
|
+
expiration_year?: number;
|
|
157
|
+
date_created?: string;
|
|
158
|
+
date_last_updated?: string;
|
|
159
|
+
cardholder?: {
|
|
160
|
+
name?: string;
|
|
161
|
+
identification?: {
|
|
162
|
+
number?: string;
|
|
163
|
+
type?: string;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
notification_url?: string;
|
|
168
|
+
refunds?: any;
|
|
169
|
+
processing_mode?: string;
|
|
170
|
+
merchant_account_id?: any;
|
|
171
|
+
merchant_number?: any;
|
|
172
|
+
acquirer_reconciliation?: any[];
|
|
173
|
+
point_of_interaction?: {
|
|
174
|
+
type?: string;
|
|
175
|
+
business_info?: {
|
|
176
|
+
unit?: string;
|
|
177
|
+
sub_unit?: string;
|
|
178
|
+
branch?: string;
|
|
179
|
+
};
|
|
180
|
+
transaction_data?: {
|
|
181
|
+
qr_code?: string;
|
|
182
|
+
qr_code_base64?: string;
|
|
183
|
+
ticket_url?: string;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
accounts_info?: any;
|
|
187
|
+
tags?: any;
|
|
188
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Checkout, PaymentCardInfo } from '../../../../domain';
|
|
2
|
+
import { PagarMeV5RequestPayload } from '../../types';
|
|
3
|
+
export declare class PagarMeV5RequestHelper {
|
|
4
|
+
static build(checkout: Checkout, method: 'pix' | 'boleto' | 'credit_card', card?: PaymentCardInfo): PagarMeV5RequestPayload;
|
|
5
|
+
private static buildItems;
|
|
6
|
+
private static buildCustomer;
|
|
7
|
+
private static buildShipping;
|
|
8
|
+
private static buildPayment;
|
|
9
|
+
private static getPixOrder;
|
|
10
|
+
private static getBoletoOrder;
|
|
11
|
+
private static getCardOrder;
|
|
12
|
+
private static buildAdditionalInfo;
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Checkout, Payment, TransactionPaymentMethods } from '../../../../domain';
|
|
2
|
+
import { PagarMeV5Response } from '../../types';
|
|
3
|
+
export declare class PagarMeV5ResponseHelper {
|
|
4
|
+
static build(method: TransactionPaymentMethods, checkout: Checkout, response: PagarMeV5Response): Payment;
|
|
5
|
+
private static buildPaymentTransaction;
|
|
6
|
+
private static getPaymentStatus;
|
|
7
|
+
private static getBoletoReponse;
|
|
8
|
+
private static getPixReponse;
|
|
9
|
+
private static getCardReponse;
|
|
10
|
+
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './pagarme-pix-payment-axios.adapter';
|
|
1
|
+
export * from './v4';
|
|
2
|
+
export * from './v5';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PaymentProviderBankSlip } from '
|
|
2
|
-
import { Checkout, Payment, PaymentTransaction } from '
|
|
3
|
-
import { PaymentRepository } from '
|
|
4
|
-
import { PagarmeCredentials } from '
|
|
1
|
+
import { PaymentProviderBankSlip } from '../../../../domain/shopping/interfaces';
|
|
2
|
+
import { Checkout, Payment, PaymentTransaction } from '../../../../domain/shopping/models';
|
|
3
|
+
import { PaymentRepository } from '../../../../domain/shopping/repositories';
|
|
4
|
+
import { PagarmeCredentials } from '../../../../domain/shopping/types';
|
|
5
5
|
export declare class PagarmeBankSlipAxiosAdapter implements PaymentProviderBankSlip {
|
|
6
6
|
private credentials;
|
|
7
7
|
private paymentRepository;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { Shops } from '../../../../domain/catalog';
|
|
2
|
+
import { BusinessUnitEnum } from '../../../../domain/shopping/enums';
|
|
3
|
+
import { PaymentProviderCard } from '../../../../domain/shopping/interfaces';
|
|
4
|
+
import { Checkout, Payment, PaymentTransaction } from '../../../../domain/shopping/models';
|
|
5
|
+
import { OrderBlockedRepository, PaymentRepository } from '../../../../domain/shopping/repositories';
|
|
6
|
+
import { CardInfo, PagarMeCard, PagarmeCredentials, PaymentCardInfo } from '../../../../domain/shopping/types';
|
|
6
7
|
export declare class PagarmeCardAxiosAdapter implements PaymentProviderCard<PagarMeCard> {
|
|
7
8
|
private credentials;
|
|
8
9
|
private paymentRepository;
|
|
@@ -10,7 +11,7 @@ export declare class PagarmeCardAxiosAdapter implements PaymentProviderCard<Paga
|
|
|
10
11
|
constructor(credentials: PagarmeCredentials, paymentRepository: PaymentRepository, orderBlockedRepository: OrderBlockedRepository);
|
|
11
12
|
pay(checkout: Checkout, card: PaymentCardInfo): Promise<Payment>;
|
|
12
13
|
addCard(card: CardInfo): Promise<PagarMeCard>;
|
|
13
|
-
createCardHash<PagarMeCardManualHash>(bu: BusinessUnitEnum): Promise<PagarMeCardManualHash>;
|
|
14
|
+
createCardHash<PagarMeCardManualHash>(bu: BusinessUnitEnum, shop?: Shops): Promise<PagarMeCardManualHash>;
|
|
14
15
|
getCardByToken(id: string): Promise<PagarMeCard>;
|
|
15
16
|
createTransaction(info: any): Promise<PaymentTransaction>;
|
|
16
17
|
private createCardPayment;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PaymentProviderPix } from '
|
|
2
|
-
import { Checkout, Payment } from '
|
|
3
|
-
import { PaymentRepository } from '
|
|
4
|
-
import { PagarmeCredentials } from '
|
|
1
|
+
import { PaymentProviderPix } from '../../../../domain/shopping/interfaces';
|
|
2
|
+
import { Checkout, Payment } from '../../../../domain/shopping/models';
|
|
3
|
+
import { PaymentRepository } from '../../../../domain/shopping/repositories';
|
|
4
|
+
import { PagarmeCredentials } from '../../../../domain/shopping/types';
|
|
5
5
|
export declare class PagarmePixAxiosAdapter implements PaymentProviderPix {
|
|
6
6
|
private credentials;
|
|
7
7
|
private paymentRepository;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PaymentProviderBankSlip } from '../../../../domain/shopping/interfaces';
|
|
2
|
+
import { Checkout, Payment, PaymentTransaction } from '../../../../domain/shopping/models';
|
|
3
|
+
import { PaymentRepository } from '../../../../domain/shopping/repositories';
|
|
4
|
+
import { PagarmeCredentialsV5 } from '../../../../domain/shopping/types';
|
|
5
|
+
export declare class PagarmeV5BankSlipAxiosAdapter implements PaymentProviderBankSlip {
|
|
6
|
+
private credentials;
|
|
7
|
+
private paymentRepository;
|
|
8
|
+
constructor(credentials: PagarmeCredentialsV5, paymentRepository: PaymentRepository);
|
|
9
|
+
pay(checkout: Checkout): Promise<Payment>;
|
|
10
|
+
getBoletoTransaction(paymentId: number): Promise<PaymentTransaction>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Shops, User, UserAddress } from '../../../../domain';
|
|
2
|
+
import { BusinessUnitEnum } from '../../../../domain/shopping/enums';
|
|
3
|
+
import { PaymentProviderCard } from '../../../../domain/shopping/interfaces';
|
|
4
|
+
import { Checkout, Payment, PaymentTransaction } from '../../../../domain/shopping/models';
|
|
5
|
+
import { OrderBlockedRepository, PaymentRepository } from '../../../../domain/shopping/repositories';
|
|
6
|
+
import { CardInfo, PagarMeCard, PagarmeCredentialsV5, PaymentCardInfo } from '../../../../domain/shopping/types';
|
|
7
|
+
import { PagarMeV5Customer } from '../../types';
|
|
8
|
+
export declare class PagarmeV5CardAxiosAdapter implements PaymentProviderCard<PagarMeCard> {
|
|
9
|
+
private credentials;
|
|
10
|
+
private paymentRepository;
|
|
11
|
+
private orderBlockedRepository;
|
|
12
|
+
constructor(credentials: PagarmeCredentialsV5, paymentRepository: PaymentRepository, orderBlockedRepository: OrderBlockedRepository);
|
|
13
|
+
pay(checkout: Checkout, card: PaymentCardInfo): Promise<Payment>;
|
|
14
|
+
addCard(card: CardInfo, customer: User & {
|
|
15
|
+
billingAddress: Partial<UserAddress>;
|
|
16
|
+
}): Promise<PagarMeCard>;
|
|
17
|
+
createCardHash<PagarMeCardManualHash>(bu: BusinessUnitEnum, shop?: Shops): Promise<PagarMeCardManualHash>;
|
|
18
|
+
getCardByToken(token: string): Promise<PagarMeCard>;
|
|
19
|
+
getCardByToken(customerId: string, token: string): Promise<PagarMeCard>;
|
|
20
|
+
createTransaction(info: any): Promise<PaymentTransaction>;
|
|
21
|
+
createOrUpdateCustomer(customer: User & {
|
|
22
|
+
billingAddress: Partial<UserAddress>;
|
|
23
|
+
}): Promise<PagarMeV5Customer>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PagarmeCredentialsV5 } from '../../../../domain';
|
|
2
|
+
import { PaymentProviderPix } from '../../../../domain/shopping/interfaces';
|
|
3
|
+
import { Checkout, Payment } from '../../../../domain/shopping/models';
|
|
4
|
+
import { PaymentRepository } from '../../../../domain/shopping/repositories';
|
|
5
|
+
export declare class PagarmeV5PixAxiosAdapter implements PaymentProviderPix {
|
|
6
|
+
private credentials;
|
|
7
|
+
private paymentRepository;
|
|
8
|
+
constructor(credentials: PagarmeCredentialsV5, paymentRepository: PaymentRepository);
|
|
9
|
+
pay(checkout: Checkout): Promise<Payment>;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './v5';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type PagarMeV5Customer = {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
email: string;
|
|
5
|
+
code: string;
|
|
6
|
+
document: string;
|
|
7
|
+
document_type: string;
|
|
8
|
+
type: string;
|
|
9
|
+
gender: string;
|
|
10
|
+
delinquent: boolean;
|
|
11
|
+
address: {
|
|
12
|
+
line_1: string;
|
|
13
|
+
line_2: string;
|
|
14
|
+
zip_code: string;
|
|
15
|
+
city: string;
|
|
16
|
+
state: string;
|
|
17
|
+
country: string;
|
|
18
|
+
};
|
|
19
|
+
};
|