@infrab4a/connect 5.2.0-beta.1 → 5.2.0-beta.10
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 +82 -519
- package/index.esm.js +83 -517
- package/package.json +1 -1
- package/src/domain/catalog/models/product-base.d.ts +3 -1
- package/src/domain/catalog/repositories/product.repository.d.ts +3 -0
- package/src/domain/catalog/repositories/variant.repository.d.ts +1 -0
- package/src/domain/shopping/enums/index.d.ts +0 -2
- package/src/domain/shopping/interfaces/payment-provider-card.interface.d.ts +2 -10
- package/src/domain/shopping/models/payment-transaction.d.ts +2 -17
- package/src/domain/shopping/models/payment.d.ts +1 -2
- package/src/domain/shopping/types/card-info.type.d.ts +0 -1
- package/src/domain/shopping/types/index.d.ts +0 -1
- package/src/domain/shopping/types/pagarme-credentials.type.d.ts +3 -9
- package/src/infra/firebase/firestore/repositories/catalog/product-firestore.repository.d.ts +4 -1
- package/src/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.d.ts +1 -0
- package/src/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.d.ts +3 -0
- package/src/infra/hasura-graphql/repositories/catalog/variant-hasura-graphql.repository.d.ts +1 -0
- package/src/infra/pagarme/adapters/helpers/index.d.ts +0 -2
- package/src/infra/pagarme/adapters/index.d.ts +3 -2
- package/src/infra/pagarme/adapters/{v4/pagarme-bank-slip-payment-axios.adapter.d.ts → pagarme-bank-slip-payment-axios.adapter.d.ts} +4 -4
- package/src/infra/pagarme/adapters/{v4/pagarme-card-payment-axios.adapter.d.ts → pagarme-card-payment-axios.adapter.d.ts} +6 -7
- package/src/infra/pagarme/adapters/pagarme-pix-payment-axios.adapter.d.ts +11 -0
- package/src/infra/pagarme/index.d.ts +0 -1
- package/src/domain/shopping/enums/pagarme-v5-payment-status.enum.d.ts +0 -24
- package/src/domain/shopping/enums/transaction-payment-methods.enum.d.ts +0 -5
- package/src/domain/shopping/types/pagarme-credentials-v5.type.d.ts +0 -4
- package/src/infra/pagarme/adapters/helpers/pagarme-v5-request.helper.d.ts +0 -12
- package/src/infra/pagarme/adapters/helpers/pagarme-v5-response.helper.d.ts +0 -10
- package/src/infra/pagarme/adapters/v4/index.d.ts +0 -3
- package/src/infra/pagarme/adapters/v4/pagarme-pix-payment-axios.adapter.d.ts +0 -11
- package/src/infra/pagarme/adapters/v5/index.d.ts +0 -3
- package/src/infra/pagarme/adapters/v5/pagarmev5-bank-slip-payment-axios.adapter.d.ts +0 -11
- package/src/infra/pagarme/adapters/v5/pagarmev5-card-payment-axios.adapter.d.ts +0 -24
- package/src/infra/pagarme/adapters/v5/pagarmev5-pix-payment-axios.adapter.d.ts +0 -10
- package/src/infra/pagarme/types/index.d.ts +0 -1
- package/src/infra/pagarme/types/v5/index.d.ts +0 -4
- package/src/infra/pagarme/types/v5/pagarmev5-customer.type.d.ts +0 -19
- package/src/infra/pagarme/types/v5/pagarmev5-order-request-payload.type.d.ts +0 -89
- package/src/infra/pagarme/types/v5/pagarmev5-order-response.type.d.ts +0 -126
- package/src/infra/pagarme/types/v5/pagarmev5-postback-response.type.d.ts +0 -11
package/package.json
CHANGED
|
@@ -23,7 +23,8 @@ export declare class ProductBase<T extends ProductBase<T, I>, I = ProductIdentif
|
|
|
23
23
|
createdAt?: Date;
|
|
24
24
|
updatedAt?: Date;
|
|
25
25
|
brand: string;
|
|
26
|
-
|
|
26
|
+
tagsCollection?: string[];
|
|
27
|
+
tagsProfile?: string[];
|
|
27
28
|
filters?: string[];
|
|
28
29
|
type?: string;
|
|
29
30
|
categories?: string[];
|
|
@@ -37,6 +38,7 @@ export declare class ProductBase<T extends ProductBase<T, I>, I = ProductIdentif
|
|
|
37
38
|
label?: ProductLabel;
|
|
38
39
|
group?: number;
|
|
39
40
|
validity: boolean;
|
|
41
|
+
daysOfUse?: number;
|
|
40
42
|
category: Category;
|
|
41
43
|
kitProducts?: KitProduct[];
|
|
42
44
|
reviews?: ProductReview[];
|
|
@@ -23,6 +23,9 @@ export interface ProductRepository extends CrudRepository<Product> {
|
|
|
23
23
|
getBySlug(slug: string, options?: {
|
|
24
24
|
cache?: RepositoryCacheOptions;
|
|
25
25
|
}): Promise<Product>;
|
|
26
|
+
getByEAN(EAN: string, options?: {
|
|
27
|
+
cache?: RepositoryCacheOptions;
|
|
28
|
+
}): Promise<Product>;
|
|
26
29
|
fetchReviews(status: ReviewStatusParams, options?: {
|
|
27
30
|
cache?: RepositoryCacheOptions;
|
|
28
31
|
}): Promise<ReviewWithProductData[]>;
|
|
@@ -2,7 +2,5 @@ export * from './antifraud-providers.enum';
|
|
|
2
2
|
export * from './business-unit.enum';
|
|
3
3
|
export * from './order-blocked.enum';
|
|
4
4
|
export * from './pagarme-payment-status.enum';
|
|
5
|
-
export * from './pagarme-v5-payment-status.enum';
|
|
6
5
|
export * from './payment-methods.enum';
|
|
7
6
|
export * from './payment-providers.enum';
|
|
8
|
-
export * from './transaction-payment-methods.enum';
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Shops } from '../../catalog';
|
|
2
|
-
import { User, UserAddress } from '../../users';
|
|
3
1
|
import { BusinessUnitEnum } from '../enums';
|
|
4
2
|
import { PaymentTransaction } from '../models';
|
|
5
3
|
import { Checkout } from '../models/checkout';
|
|
@@ -8,14 +6,8 @@ import { CardInfo, PaymentCardInfo } from '../types';
|
|
|
8
6
|
import { BaseCard } from '../types/base-card.type';
|
|
9
7
|
export interface PaymentProviderCard<Card extends BaseCard = BaseCard> {
|
|
10
8
|
pay(checkout: Checkout, card: PaymentCardInfo): Promise<Payment>;
|
|
11
|
-
addCard
|
|
12
|
-
billingAddress: Partial<UserAddress>;
|
|
13
|
-
}): Promise<Card>;
|
|
9
|
+
addCard(card: CardInfo): Promise<Card>;
|
|
14
10
|
getCardByToken(token: string): Promise<Card>;
|
|
15
|
-
|
|
16
|
-
createCardHash<T>(bu: BusinessUnitEnum, shop: Shops, card?: CardInfo): Promise<string | T>;
|
|
11
|
+
createCardHash<T>(bu: BusinessUnitEnum, card?: CardInfo): Promise<string | T>;
|
|
17
12
|
createTransaction(info: any): Promise<PaymentTransaction>;
|
|
18
|
-
createOrUpdateCustomer?(customer: User & {
|
|
19
|
-
billingAddress: Partial<UserAddress>;
|
|
20
|
-
}): any;
|
|
21
13
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { BaseModel } from '../../generic/model/base.model';
|
|
2
2
|
import { PaymentBilling, PaymentCard, PaymentCustomer, PaymentItem, PaymentShipping } from './types';
|
|
3
3
|
export declare class PaymentTransaction extends BaseModel<PaymentTransaction> {
|
|
4
|
-
id?:
|
|
4
|
+
id?: number;
|
|
5
5
|
object?: string;
|
|
6
6
|
status?: string;
|
|
7
|
-
tid?:
|
|
8
|
-
gateway_id?: string;
|
|
7
|
+
tid?: number;
|
|
9
8
|
nsu?: number;
|
|
10
9
|
amount: number;
|
|
11
|
-
currency?: string;
|
|
12
10
|
cost: number;
|
|
13
11
|
installments?: number;
|
|
14
12
|
referer: string;
|
|
@@ -28,12 +26,8 @@ export declare class PaymentTransaction extends BaseModel<PaymentTransaction> {
|
|
|
28
26
|
refuse_reason?: string;
|
|
29
27
|
status_reason?: string;
|
|
30
28
|
acquirer_response_code?: string;
|
|
31
|
-
acquirer_auth_code?: string;
|
|
32
|
-
acquirer_return_code?: string;
|
|
33
29
|
acquirer_name?: string;
|
|
34
|
-
acquirer_message?: string;
|
|
35
30
|
acquirer_id?: string;
|
|
36
|
-
acquirer_nsu?: string;
|
|
37
31
|
authorization_code?: string;
|
|
38
32
|
soft_descriptor?: string;
|
|
39
33
|
date_created?: string;
|
|
@@ -42,7 +36,6 @@ export declare class PaymentTransaction extends BaseModel<PaymentTransaction> {
|
|
|
42
36
|
paid_amount?: number;
|
|
43
37
|
paid_at?: string;
|
|
44
38
|
refunded_amount?: number;
|
|
45
|
-
card_id?: string;
|
|
46
39
|
card_holder_name?: string;
|
|
47
40
|
card_last_digits?: string;
|
|
48
41
|
card_first_digits?: string;
|
|
@@ -55,14 +48,8 @@ export declare class PaymentTransaction extends BaseModel<PaymentTransaction> {
|
|
|
55
48
|
capture_method?: string;
|
|
56
49
|
antifraud_score?: string;
|
|
57
50
|
boleto_url?: string;
|
|
58
|
-
boleto_line?: string;
|
|
59
51
|
boleto_barcode?: string;
|
|
60
|
-
boleto_qr_code?: string;
|
|
61
52
|
boleto_expiration_date?: string;
|
|
62
|
-
boleto_instructions?: string;
|
|
63
|
-
boleto_nosso_numero?: string;
|
|
64
|
-
boleto_type?: string;
|
|
65
|
-
boleto_document_number?: string;
|
|
66
53
|
subscription_id?: string;
|
|
67
54
|
split_rules?: string;
|
|
68
55
|
antifraud_metadata?: any;
|
|
@@ -72,11 +59,9 @@ export declare class PaymentTransaction extends BaseModel<PaymentTransaction> {
|
|
|
72
59
|
fraudCovered?: boolean;
|
|
73
60
|
fraud_reimbursed?: string;
|
|
74
61
|
order_id?: string;
|
|
75
|
-
charger_id?: string;
|
|
76
62
|
risk_level?: string;
|
|
77
63
|
receipt_url?: string;
|
|
78
64
|
private_label?: string;
|
|
79
65
|
pix_qr_code?: string;
|
|
80
|
-
pix_qr_code_url?: string;
|
|
81
66
|
pix_expiration_date?: string;
|
|
82
67
|
}
|
|
@@ -2,10 +2,9 @@ import { BaseModel, GenericIdentifier } from '../../generic/model/base.model';
|
|
|
2
2
|
import { PaymentProvider } from '../types';
|
|
3
3
|
import { PaymentTransaction } from './payment-transaction';
|
|
4
4
|
export declare class Payment extends BaseModel<Payment> {
|
|
5
|
-
id:
|
|
5
|
+
id: number;
|
|
6
6
|
checkoutId: string;
|
|
7
7
|
orderId?: string;
|
|
8
|
-
pagarMeOrderId?: string;
|
|
9
8
|
totalPrice: number;
|
|
10
9
|
userId: string;
|
|
11
10
|
paymentProvider: PaymentProvider;
|
|
@@ -8,7 +8,6 @@ export * from './checkout-stock-validation.type';
|
|
|
8
8
|
export * from './glam-credentials.type';
|
|
9
9
|
export * from './order-tracking-events.type';
|
|
10
10
|
export * from './pagarme-card.type';
|
|
11
|
-
export * from './pagarme-credentials-v5.type';
|
|
12
11
|
export * from './pagarme-credentials.type';
|
|
13
12
|
export * from './payment-card-info.type';
|
|
14
13
|
export * from './payment-method.type';
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
export type PagarmeCredentials = {
|
|
2
2
|
URL: string;
|
|
3
|
-
URL_POSTBACK
|
|
3
|
+
URL_POSTBACK: string;
|
|
4
4
|
API_KEY: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
SHOP_API_KEY: string;
|
|
8
|
-
};
|
|
9
|
-
mensmarket: {
|
|
10
|
-
SUBSCRIPTION_API_KEY: string;
|
|
11
|
-
SHOP_API_KEY: string;
|
|
12
|
-
};
|
|
5
|
+
SUBSCRIPTION_API_KEY: string;
|
|
6
|
+
SHOP_API_KEY: string;
|
|
13
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FindRepositoryParams, PaginatedReviewFilters, Product, ProductRepository, ProductVariantReport, RepositoryFindResult, ReviewStatusParams, ReviewWithProductData } from '../../../../../domain';
|
|
1
|
+
import { FindRepositoryParams, PaginatedReviewFilters, Product, ProductRepository, ProductVariantReport, RepositoryCacheOptions, RepositoryFindResult, ReviewStatusParams, ReviewWithProductData } from '../../../../../domain';
|
|
2
2
|
import { FirestoreConstructorParams } from '../../mixins';
|
|
3
3
|
declare const ProductFirestoreRepository_base: import("../../../../../utils").MixinCtor<import("../..").FirestoreRepository<Product> & import("../../../../../domain").CrudRepository<Product, import("../../../../../domain").CrudParams<Product>> & import("../..").FirestoreHelpers, [FirestoreConstructorParams<Product>, ...any[]]>;
|
|
4
4
|
export declare class ProductFirestoreRepository extends ProductFirestoreRepository_base implements ProductRepository {
|
|
@@ -11,5 +11,8 @@ export declare class ProductFirestoreRepository extends ProductFirestoreReposito
|
|
|
11
11
|
findCatalog(params: FindRepositoryParams<Product>): Promise<RepositoryFindResult<Product>>;
|
|
12
12
|
fetchPaginatedReviews(): Promise<ReviewWithProductData[]>;
|
|
13
13
|
productVariantFullReport(): Promise<ProductVariantReport[]>;
|
|
14
|
+
getByEAN(EAN: string, options?: {
|
|
15
|
+
cache?: RepositoryCacheOptions;
|
|
16
|
+
}): Promise<Product>;
|
|
14
17
|
}
|
|
15
18
|
export {};
|
package/src/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.d.ts
CHANGED
|
@@ -8,5 +8,6 @@ declare const ProductVariantFirestoreRepository_base: import("../../../../../uti
|
|
|
8
8
|
export declare class ProductVariantFirestoreRepository extends ProductVariantFirestoreRepository_base implements VariantRepository {
|
|
9
9
|
readonly parentRepository: ProductFirestoreRepository;
|
|
10
10
|
constructor({ firestore, interceptors }: Pick<FirestoreConstructorParams<Variant>, 'firestore' | 'interceptors'>, parentRepository: ProductFirestoreRepository);
|
|
11
|
+
getByEAN(EAN: string): Promise<Variant>;
|
|
11
12
|
}
|
|
12
13
|
export {};
|
package/src/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.d.ts
CHANGED
|
@@ -15,6 +15,9 @@ export declare class ProductHasuraGraphQLRepository extends ProductHasuraGraphQL
|
|
|
15
15
|
getBySlug(slug: string, options?: {
|
|
16
16
|
cache?: RepositoryCacheOptions;
|
|
17
17
|
}): Promise<ProductHasuraGraphQL>;
|
|
18
|
+
getByEAN(EAN: string, options?: {
|
|
19
|
+
cache?: RepositoryCacheOptions;
|
|
20
|
+
}): Promise<ProductHasuraGraphQL>;
|
|
18
21
|
update(params: UpdateRepositoryParams<ProductHasuraGraphQL>): Promise<ProductHasuraGraphQL>;
|
|
19
22
|
fetchProductReviews(filters: PaginatedReviewFilters, options?: {
|
|
20
23
|
cache?: RepositoryCacheOptions;
|
package/src/infra/hasura-graphql/repositories/catalog/variant-hasura-graphql.repository.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare class VariantHasuraGraphQLRepository extends VariantHasuraGraphQL
|
|
|
6
6
|
constructor({ endpoint, authOptions, interceptors, cache, }: Pick<HasuraConstructorParams<VariantHasuraGraphQL>, 'endpoint' | 'authOptions' | 'interceptors' | 'cache'>);
|
|
7
7
|
get(identifiers: GetRepositoryParams<VariantHasuraGraphQL>): Promise<VariantHasuraGraphQL>;
|
|
8
8
|
find(params?: FindRepositoryParams<VariantHasuraGraphQL>): Promise<RepositoryFindResult<VariantHasuraGraphQL>>;
|
|
9
|
+
getByEAN(EAN: string): Promise<VariantHasuraGraphQL>;
|
|
9
10
|
update(params: UpdateRepositoryParams<VariantHasuraGraphQL>): Promise<VariantHasuraGraphQL>;
|
|
10
11
|
private getId;
|
|
11
12
|
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
1
|
+
export * from './pagarme-bank-slip-payment-axios.adapter';
|
|
2
|
+
export * from './pagarme-card-payment-axios.adapter';
|
|
3
|
+
export * from './pagarme-pix-payment-axios.adapter';
|
|
@@ -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,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { CardInfo, PagarMeCard, PagarmeCredentials, PaymentCardInfo } from '../../../../domain/shopping/types';
|
|
1
|
+
import { BusinessUnitEnum } from '../../../domain/shopping/enums';
|
|
2
|
+
import { PaymentProviderCard } from '../../../domain/shopping/interfaces';
|
|
3
|
+
import { Checkout, Payment, PaymentTransaction } from '../../../domain/shopping/models';
|
|
4
|
+
import { OrderBlockedRepository, PaymentRepository } from '../../../domain/shopping/repositories';
|
|
5
|
+
import { CardInfo, PagarMeCard, PagarmeCredentials, PaymentCardInfo } from '../../../domain/shopping/types';
|
|
7
6
|
export declare class PagarmeCardAxiosAdapter implements PaymentProviderCard<PagarMeCard> {
|
|
8
7
|
private credentials;
|
|
9
8
|
private paymentRepository;
|
|
@@ -11,7 +10,7 @@ export declare class PagarmeCardAxiosAdapter implements PaymentProviderCard<Paga
|
|
|
11
10
|
constructor(credentials: PagarmeCredentials, paymentRepository: PaymentRepository, orderBlockedRepository: OrderBlockedRepository);
|
|
12
11
|
pay(checkout: Checkout, card: PaymentCardInfo): Promise<Payment>;
|
|
13
12
|
addCard(card: CardInfo): Promise<PagarMeCard>;
|
|
14
|
-
createCardHash<PagarMeCardManualHash>(bu: BusinessUnitEnum
|
|
13
|
+
createCardHash<PagarMeCardManualHash>(bu: BusinessUnitEnum): Promise<PagarMeCardManualHash>;
|
|
15
14
|
getCardByToken(id: string): Promise<PagarMeCard>;
|
|
16
15
|
createTransaction(info: any): Promise<PaymentTransaction>;
|
|
17
16
|
private createCardPayment;
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
export declare class PagarmePixAxiosAdapter implements PaymentProviderPix {
|
|
6
|
+
private credentials;
|
|
7
|
+
private paymentRepository;
|
|
8
|
+
constructor(credentials: PagarmeCredentials, paymentRepository: PaymentRepository);
|
|
9
|
+
pay(checkout: Checkout): Promise<Payment>;
|
|
10
|
+
private createPixPayment;
|
|
11
|
+
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export declare enum PagarMeV5PaymentStatus {
|
|
2
|
-
'Em processamento' = "processing",
|
|
3
|
-
'Gerado' = "generated",
|
|
4
|
-
'Visualizado' = "viewed",
|
|
5
|
-
'Pago a menor' = "underpaid",
|
|
6
|
-
'Pago a maior' = "overpaid",
|
|
7
|
-
'Aguardando pagamento' = "waiting_payment",
|
|
8
|
-
'Pago' = "paid",
|
|
9
|
-
'Aguardando estorno' = "pending_refund",
|
|
10
|
-
'Autorizada pendente de captura' = "authorized_pending_capture",
|
|
11
|
-
'Não autorizada' = "not_authorized",
|
|
12
|
-
'Capturada' = "captured",
|
|
13
|
-
'Aguardando captura' = "waiting_capture",
|
|
14
|
-
'Com erro' = "with_error",
|
|
15
|
-
'Estornado' = "refunded",
|
|
16
|
-
'Cancelado' = "voided",
|
|
17
|
-
'Falha' = "failed"
|
|
18
|
-
}
|
|
19
|
-
export declare enum PagarMeV5OrderStatus {
|
|
20
|
-
'Pendente' = "pending",
|
|
21
|
-
'Pago' = "paid",
|
|
22
|
-
'Cancelado' = "canceled",
|
|
23
|
-
'Falha' = "failed"
|
|
24
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
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,11 +0,0 @@
|
|
|
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
|
-
export declare class PagarmePixAxiosAdapter implements PaymentProviderPix {
|
|
6
|
-
private credentials;
|
|
7
|
-
private paymentRepository;
|
|
8
|
-
constructor(credentials: PagarmeCredentials, paymentRepository: PaymentRepository);
|
|
9
|
-
pay(checkout: Checkout): Promise<Payment>;
|
|
10
|
-
private createPixPayment;
|
|
11
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './v5';
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
export type PagarMeV5RequestPayload = {
|
|
2
|
-
items: PagarMeV5Orderitems[];
|
|
3
|
-
customer: PagarMeV5OrderCustomer;
|
|
4
|
-
payments: PagarMeV5OrderPaymentInfo[];
|
|
5
|
-
shipping?: PagarMeV5OrderShippingInfo;
|
|
6
|
-
};
|
|
7
|
-
export type PagarMeV5OrderCustomer = {
|
|
8
|
-
name: string;
|
|
9
|
-
email: string;
|
|
10
|
-
type: string;
|
|
11
|
-
document: string;
|
|
12
|
-
phones: {
|
|
13
|
-
home_phone?: {
|
|
14
|
-
country_code: string;
|
|
15
|
-
number: string;
|
|
16
|
-
area_code: string;
|
|
17
|
-
};
|
|
18
|
-
mobile_phone: {
|
|
19
|
-
country_code: string;
|
|
20
|
-
number: string;
|
|
21
|
-
area_code: string;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
address?: {
|
|
25
|
-
line_1: string;
|
|
26
|
-
line_2: string;
|
|
27
|
-
zip_code: string;
|
|
28
|
-
city: string;
|
|
29
|
-
state: string;
|
|
30
|
-
country: string;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
export type PagarMeV5Orderitems = {
|
|
34
|
-
amount: number;
|
|
35
|
-
description: string;
|
|
36
|
-
quantity: number;
|
|
37
|
-
code?: string;
|
|
38
|
-
};
|
|
39
|
-
export type PagarMeV5OrderPaymentInfo = {
|
|
40
|
-
payment_method: 'boleto' | 'pix' | 'credit_card';
|
|
41
|
-
amount: number;
|
|
42
|
-
pix?: PagarMeV5OrderPaymentPixInfo;
|
|
43
|
-
boleto?: PagarMeV5OrderPaymentBoletoInfo;
|
|
44
|
-
credit_card?: PagarMeV5OrderPaymentCardInfo;
|
|
45
|
-
};
|
|
46
|
-
export type PagarMeV5OrderPaymentPixInfo = {
|
|
47
|
-
expires_at: string;
|
|
48
|
-
additional_information?: [
|
|
49
|
-
{
|
|
50
|
-
name: string;
|
|
51
|
-
value: string;
|
|
52
|
-
}
|
|
53
|
-
];
|
|
54
|
-
};
|
|
55
|
-
export type PagarMeV5OrderPaymentBoletoInfo = {
|
|
56
|
-
instructions: string;
|
|
57
|
-
due_at: string;
|
|
58
|
-
type: 'DM' | 'BDP';
|
|
59
|
-
document_number?: string;
|
|
60
|
-
};
|
|
61
|
-
export type PagarMeV5OrderPaymentCardInfo = {
|
|
62
|
-
installments: number;
|
|
63
|
-
statement_descriptor: string;
|
|
64
|
-
card_id: string;
|
|
65
|
-
card: {
|
|
66
|
-
cvv: string;
|
|
67
|
-
billing_address?: {
|
|
68
|
-
line_1: string;
|
|
69
|
-
zip_code: string;
|
|
70
|
-
city: string;
|
|
71
|
-
state: string;
|
|
72
|
-
country: string;
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
export type PagarMeV5OrderShippingInfo = {
|
|
77
|
-
amount: number;
|
|
78
|
-
description: string;
|
|
79
|
-
recipient_name: string;
|
|
80
|
-
recipient_phone: string;
|
|
81
|
-
address: {
|
|
82
|
-
line_1: string;
|
|
83
|
-
line_2?: string;
|
|
84
|
-
zip_code: string;
|
|
85
|
-
city: string;
|
|
86
|
-
state: string;
|
|
87
|
-
country: string;
|
|
88
|
-
};
|
|
89
|
-
};
|