@infrab4a/connect 4.17.2 → 4.18.0-beta.0
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 +751 -83
- package/index.esm.js +728 -86
- package/package.json +1 -1
- package/src/domain/general/models/index.d.ts +1 -0
- package/src/domain/general/models/sequences.d.ts +9 -0
- package/src/domain/general/repositories/index.d.ts +1 -0
- package/src/domain/general/repositories/sequences.repository.d.ts +4 -0
- package/src/domain/shopping/enums/antifraud-providers.enum.d.ts +6 -0
- package/src/domain/shopping/enums/index.d.ts +3 -0
- package/src/domain/shopping/enums/payment-methods.enum.d.ts +6 -0
- package/src/domain/shopping/enums/payment-providers.enum.d.ts +5 -0
- package/src/domain/shopping/factories/adyen-payment-method.factory.d.ts +8 -0
- package/src/domain/shopping/factories/antifraud-provider.factory.d.ts +15 -0
- package/src/domain/shopping/factories/base-payment-method.factory.d.ts +7 -0
- package/src/domain/shopping/factories/glampoints-payment-method.factory.d.ts +8 -0
- package/src/domain/shopping/factories/index.d.ts +5 -0
- package/src/domain/shopping/factories/pagarme-payment-method.factory.d.ts +10 -0
- package/src/domain/shopping/factories/payment-provider.factory.d.ts +15 -0
- package/src/domain/shopping/index.d.ts +4 -0
- package/src/domain/shopping/interfaces/antifraud-method-factory.interface.d.ts +11 -0
- package/src/domain/shopping/interfaces/antifraud-provider.interface.d.ts +5 -0
- package/src/domain/shopping/interfaces/index.d.ts +7 -0
- package/src/domain/shopping/interfaces/payment-method-factory.interface.d.ts +14 -0
- package/src/domain/shopping/interfaces/payment-provider-bank-slip.interface.d.ts +5 -0
- package/src/domain/shopping/interfaces/payment-provider-card.interface.d.ts +7 -0
- package/src/domain/shopping/interfaces/payment-provider-glampoints.interface.d.ts +5 -0
- package/src/domain/shopping/interfaces/payment-provider-pix.interface.d.ts +5 -0
- package/src/domain/shopping/models/index.d.ts +1 -0
- package/src/domain/shopping/models/order.d.ts +2 -2
- package/src/domain/shopping/models/payment-transaction.d.ts +67 -0
- package/src/domain/shopping/models/payment.d.ts +10 -63
- package/src/domain/shopping/models/types/index.d.ts +4 -4
- package/src/domain/shopping/services/adyen-card-payment.service.d.ts +13 -0
- package/src/domain/shopping/services/antifraud-bankslip.service.d.ts +9 -0
- package/src/domain/shopping/services/antifraud-card.service.d.ts +18 -0
- package/src/domain/shopping/services/antifraud-glampoints.service.d.ts +6 -0
- package/src/domain/shopping/services/antifraud-pix.service.d.ts +6 -0
- package/src/domain/shopping/services/glampoints-payment.service.d.ts +8 -0
- package/src/domain/shopping/services/index.d.ts +9 -0
- package/src/domain/shopping/services/pagarme-bank-slip-payment.service.d.ts +11 -0
- package/src/domain/shopping/services/pagarme-card-payment.service.d.ts +13 -0
- package/src/domain/shopping/services/pagarme-pix-payment.service.d.ts +11 -0
- package/src/domain/shopping/types/adyen-credentials.type.d.ts +6 -0
- package/src/domain/shopping/types/antifraud-provider.type.d.ts +2 -0
- package/src/domain/shopping/types/index.d.ts +5 -0
- package/src/domain/shopping/types/pagarme-credentials.type.d.ts +5 -0
- package/src/domain/shopping/types/payment-method.type.d.ts +2 -0
- package/src/domain/shopping/types/payment-provider.type.d.ts +2 -0
- package/src/errors/business.error.d.ts +7 -0
- package/src/errors/fraud-validation.error.d.ts +7 -0
- package/src/errors/index.d.ts +7 -2
- package/src/errors/payment.error.d.ts +7 -0
- package/src/errors/stock-limit.error.d.ts +5 -0
- package/src/errors/stock-out.error.d.ts +5 -0
- package/src/errors/types/checkout-additional-data-erro.type.d.ts +5 -0
- package/src/errors/types/index.d.ts +1 -0
- package/src/infra/firebase/firestore/repositories/general/index.d.ts +1 -0
- package/src/infra/firebase/firestore/repositories/general/sequences-firestore.repository.d.ts +7 -0
- package/src/infra/firebase/firestore/repositories/shopping/index.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/shopping/order-blocked-firestore.repository.d.ts +9 -0
- package/src/infra/hasura-graphql/mixins/with-find-hasura-graphql.mixin.d.ts +0 -1
- package/src/utils/index.d.ts +2 -2
package/package.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseModel, GenericIdentifier } from '../../generic';
|
|
2
|
+
export declare class Sequence extends BaseModel<Sequence> {
|
|
3
|
+
id?: string;
|
|
4
|
+
type: string;
|
|
5
|
+
counter: number;
|
|
6
|
+
month: number;
|
|
7
|
+
year: number;
|
|
8
|
+
static get identifiersFields(): GenericIdentifier[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AdyenCardService } from '../services';
|
|
2
|
+
import { BasePaymentMethodFactory } from './base-payment-method.factory';
|
|
3
|
+
type AdyenPaymentFactoryMethods = {
|
|
4
|
+
card: AdyenCardService;
|
|
5
|
+
};
|
|
6
|
+
export declare class AdyenPaymentMethodFactory extends BasePaymentMethodFactory<AdyenPaymentFactoryMethods> {
|
|
7
|
+
}
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AntifraudMethodFactory } from '../interfaces';
|
|
2
|
+
import { AntifraudBankSlipService, AntifraudCardService, AntifraudGlampointsService, AntifraudPixService } from '../services';
|
|
3
|
+
import { AntifraudeProvider } from '../types';
|
|
4
|
+
type AntifraudMethods = {
|
|
5
|
+
bankSlip?: AntifraudBankSlipService;
|
|
6
|
+
card?: AntifraudCardService;
|
|
7
|
+
pix?: AntifraudPixService;
|
|
8
|
+
glampoints?: AntifraudGlampointsService;
|
|
9
|
+
};
|
|
10
|
+
export declare class AntifraudProviderFactory implements AntifraudMethodFactory {
|
|
11
|
+
private readonly antifraudProviders;
|
|
12
|
+
constructor(antifraudProviders: AntifraudMethods);
|
|
13
|
+
build<T extends AntifraudeProvider>(provider: T): AntifraudProviderFactory['antifraudProviders'][T];
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PaymentMethodFactory, PaymentMethodFactoryMethods } from '../interfaces';
|
|
2
|
+
import { PaymentMethod } from '../types';
|
|
3
|
+
export declare abstract class BasePaymentMethodFactory<T extends PaymentMethodFactoryMethods = PaymentMethodFactoryMethods> implements PaymentMethodFactory {
|
|
4
|
+
private readonly methods;
|
|
5
|
+
constructor(methods: T);
|
|
6
|
+
build<T extends PaymentMethod>(method: T): BasePaymentMethodFactory['methods'][T];
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GlampointsPaymentService } from '../services';
|
|
2
|
+
import { BasePaymentMethodFactory } from './base-payment-method.factory';
|
|
3
|
+
type GlampointsPaymentFactoryMethods = {
|
|
4
|
+
glampoints: GlampointsPaymentService;
|
|
5
|
+
};
|
|
6
|
+
export declare class GlampointsPaymentMethodFactory extends BasePaymentMethodFactory<GlampointsPaymentFactoryMethods> {
|
|
7
|
+
}
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PagarmeBankSlipService, PagarmeCardService, PagarmePixService } from '../services';
|
|
2
|
+
import { BasePaymentMethodFactory } from './base-payment-method.factory';
|
|
3
|
+
type PagarmePaymentFactoryMethods = {
|
|
4
|
+
card?: PagarmeCardService;
|
|
5
|
+
bankSlip?: PagarmeBankSlipService;
|
|
6
|
+
pix?: PagarmePixService;
|
|
7
|
+
};
|
|
8
|
+
export declare class PagarmePaymentMethodFactory extends BasePaymentMethodFactory<PagarmePaymentFactoryMethods> {
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PaymentProvider } from '../types';
|
|
2
|
+
import { AdyenPaymentMethodFactory } from './adyen-payment-method.factory';
|
|
3
|
+
import { GlampointsPaymentMethodFactory } from './glampoints-payment-method.factory';
|
|
4
|
+
import { PagarmePaymentMethodFactory } from './pagarme-payment-method.factory';
|
|
5
|
+
type PaymentProviderFactoryFactories = {
|
|
6
|
+
pagarMe?: PagarmePaymentMethodFactory;
|
|
7
|
+
adyen?: AdyenPaymentMethodFactory;
|
|
8
|
+
glampoints?: GlampointsPaymentMethodFactory;
|
|
9
|
+
};
|
|
10
|
+
export declare class PaymentProviderFactory {
|
|
11
|
+
private readonly paymentProviders;
|
|
12
|
+
constructor(paymentProviders: PaymentProviderFactoryFactories);
|
|
13
|
+
build<T extends PaymentProvider>(provider: T): PaymentProviderFactory['paymentProviders'][T];
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AntifraudeProvider } from '../types';
|
|
2
|
+
import { AntifraudProvider } from './antifraud-provider.interface';
|
|
3
|
+
export type AntifraudMethods = {
|
|
4
|
+
bankSlip?: AntifraudProvider;
|
|
5
|
+
card?: AntifraudProvider;
|
|
6
|
+
pix?: AntifraudProvider;
|
|
7
|
+
glampoints?: AntifraudProvider;
|
|
8
|
+
};
|
|
9
|
+
export interface AntifraudMethodFactory {
|
|
10
|
+
build<T extends AntifraudeProvider>(method: T): AntifraudMethods[T];
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './antifraud-method-factory.interface';
|
|
2
|
+
export * from './antifraud-provider.interface';
|
|
3
|
+
export * from './payment-method-factory.interface';
|
|
4
|
+
export * from './payment-provider-bank-slip.interface';
|
|
5
|
+
export * from './payment-provider-card.interface';
|
|
6
|
+
export * from './payment-provider-glampoints.interface';
|
|
7
|
+
export * from './payment-provider-pix.interface';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PaymentMethod } from '../types';
|
|
2
|
+
import { PaymentProviderBankSlip } from './payment-provider-bank-slip.interface';
|
|
3
|
+
import { PaymentProviderCard } from './payment-provider-card.interface';
|
|
4
|
+
import { PaymentProviderGlampoints } from './payment-provider-glampoints.interface';
|
|
5
|
+
import { PaymentProviderPix } from './payment-provider-pix.interface';
|
|
6
|
+
export type PaymentMethodFactoryMethods = {
|
|
7
|
+
card?: PaymentProviderCard;
|
|
8
|
+
bankSlip?: PaymentProviderBankSlip;
|
|
9
|
+
pix?: PaymentProviderPix;
|
|
10
|
+
glampoints?: PaymentProviderGlampoints;
|
|
11
|
+
};
|
|
12
|
+
export interface PaymentMethodFactory {
|
|
13
|
+
build<T extends PaymentMethod>(method: T): PaymentMethodFactoryMethods[T];
|
|
14
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Checkout } from '../models/checkout';
|
|
2
|
+
import { Payment } from '../models/payment';
|
|
3
|
+
import { PaymentCardInfo } from '../types';
|
|
4
|
+
export interface PaymentProviderCard {
|
|
5
|
+
addCard(): Promise<any>;
|
|
6
|
+
pay(checkout: Checkout, card: PaymentCardInfo): Promise<Payment>;
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OrderTrackingEvent } from '../types';
|
|
2
2
|
import { Checkout } from './checkout';
|
|
3
3
|
import { OrderStatus } from './enums/order-status.enum';
|
|
4
|
-
import {
|
|
4
|
+
import { PaymentTransaction } from './payment-transaction';
|
|
5
5
|
export declare class Order extends Checkout {
|
|
6
6
|
status: OrderStatus;
|
|
7
7
|
orderNumber?: string;
|
|
@@ -10,5 +10,5 @@ export declare class Order extends Checkout {
|
|
|
10
10
|
sentAt?: string;
|
|
11
11
|
deliveredAt?: string;
|
|
12
12
|
trackingEvents?: OrderTrackingEvent[];
|
|
13
|
-
payment:
|
|
13
|
+
payment: PaymentTransaction;
|
|
14
14
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { BaseModel } from '../../generic/model/base.model';
|
|
2
|
+
import { PaymentBilling, PaymentCard, PaymentCustomer, PaymentItem, PaymentShipping } from './types';
|
|
3
|
+
export declare class PaymentTransaction extends BaseModel<PaymentTransaction> {
|
|
4
|
+
id: number;
|
|
5
|
+
object: string;
|
|
6
|
+
status: string;
|
|
7
|
+
tid: number;
|
|
8
|
+
nsu: number;
|
|
9
|
+
amount: number;
|
|
10
|
+
cost: number;
|
|
11
|
+
installments: number;
|
|
12
|
+
referer: string;
|
|
13
|
+
ip: string;
|
|
14
|
+
phone: string;
|
|
15
|
+
address: string;
|
|
16
|
+
metadata: any;
|
|
17
|
+
device: string;
|
|
18
|
+
payment: string;
|
|
19
|
+
addition: string;
|
|
20
|
+
discount: string;
|
|
21
|
+
customer: PaymentCustomer;
|
|
22
|
+
billing: PaymentBilling;
|
|
23
|
+
shipping: PaymentShipping;
|
|
24
|
+
items: PaymentItem[];
|
|
25
|
+
card: PaymentCard;
|
|
26
|
+
refuseReason: string;
|
|
27
|
+
statusReason: string;
|
|
28
|
+
acquirerResponseCode: string;
|
|
29
|
+
acquirerName: string;
|
|
30
|
+
acquirerId: string;
|
|
31
|
+
authorizationCode: string;
|
|
32
|
+
softDescriptor: string;
|
|
33
|
+
dateCreated: string;
|
|
34
|
+
dateUpdated: string;
|
|
35
|
+
authorizedAmount: number;
|
|
36
|
+
paidAmount: number;
|
|
37
|
+
paidAt: string;
|
|
38
|
+
refundedAmount: number;
|
|
39
|
+
cardHolderName: string;
|
|
40
|
+
cardLastDigits: string;
|
|
41
|
+
cardFirstDigits: string;
|
|
42
|
+
cardBrand: string;
|
|
43
|
+
cardPinMode: string;
|
|
44
|
+
cardMagstripeFallback: boolean;
|
|
45
|
+
cvmPin: boolean;
|
|
46
|
+
postbackUrl: string;
|
|
47
|
+
paymentMethod: string;
|
|
48
|
+
captureMethod: string;
|
|
49
|
+
antifraudScore: string;
|
|
50
|
+
boletoUrl: string;
|
|
51
|
+
boletoBarcode: string;
|
|
52
|
+
boletoExpirationDate: string;
|
|
53
|
+
subscriptionId: string;
|
|
54
|
+
splitRules: string;
|
|
55
|
+
antifraudMetadata: any;
|
|
56
|
+
referenceKey: string;
|
|
57
|
+
localTransactionId: string;
|
|
58
|
+
localTime: string;
|
|
59
|
+
fraudCovered: boolean;
|
|
60
|
+
fraudReimbursed: string;
|
|
61
|
+
orderId: string;
|
|
62
|
+
riskLevel: string;
|
|
63
|
+
receiptUrl: string;
|
|
64
|
+
privateLabel: string;
|
|
65
|
+
pixQrCode: string;
|
|
66
|
+
pixExpirationDate: string;
|
|
67
|
+
}
|
|
@@ -1,68 +1,15 @@
|
|
|
1
1
|
import { BaseModel, GenericIdentifier } from '../../generic/model/base.model';
|
|
2
|
-
import {
|
|
2
|
+
import { PaymentProvider } from '../types';
|
|
3
|
+
import { PaymentTransaction } from './payment-transaction';
|
|
3
4
|
export declare class Payment extends BaseModel<Payment> {
|
|
4
5
|
id: number;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
ip: string;
|
|
14
|
-
phone: string;
|
|
15
|
-
address: string;
|
|
16
|
-
metadata: any;
|
|
17
|
-
device: string;
|
|
18
|
-
payment: string;
|
|
19
|
-
addition: string;
|
|
20
|
-
discount: string;
|
|
21
|
-
customer: PaymentCustomer;
|
|
22
|
-
billing: PaymentBilling;
|
|
23
|
-
shipping: PaymentShipping;
|
|
24
|
-
items: PaymentItem[];
|
|
25
|
-
card: PaymentCard;
|
|
26
|
-
refuseReason: string;
|
|
27
|
-
statusReason: string;
|
|
28
|
-
acquirerResponseCode: string;
|
|
29
|
-
acquirerName: string;
|
|
30
|
-
acquirerId: string;
|
|
31
|
-
authorizationCode: string;
|
|
32
|
-
softDescriptor: string;
|
|
33
|
-
dateCreated: string;
|
|
34
|
-
dateUpdated: string;
|
|
35
|
-
authorizedAmount: number;
|
|
36
|
-
paidAmount: number;
|
|
37
|
-
paidAt: string;
|
|
38
|
-
refundedAmount: number;
|
|
39
|
-
cardHolderName: string;
|
|
40
|
-
cardLastDigits: string;
|
|
41
|
-
cardFirstDigits: string;
|
|
42
|
-
cardBrand: string;
|
|
43
|
-
cardPinMode: string;
|
|
44
|
-
cardMagstripeFallback: boolean;
|
|
45
|
-
cvmPin: boolean;
|
|
46
|
-
postbackUrl: string;
|
|
47
|
-
paymentMethod: string;
|
|
48
|
-
captureMethod: string;
|
|
49
|
-
antifraudScore: string;
|
|
50
|
-
boletoUrl: string;
|
|
51
|
-
boletoBarcode: string;
|
|
52
|
-
boletoExpirationDate: string;
|
|
53
|
-
subscriptionId: string;
|
|
54
|
-
splitRules: string;
|
|
55
|
-
antifraudMetadata: any;
|
|
56
|
-
referenceKey: string;
|
|
57
|
-
localTransactionId: string;
|
|
58
|
-
localTime: string;
|
|
59
|
-
fraudCovered: boolean;
|
|
60
|
-
fraudReimbursed: string;
|
|
61
|
-
orderId: string;
|
|
62
|
-
riskLevel: string;
|
|
63
|
-
receiptUrl: string;
|
|
64
|
-
privateLabel: string;
|
|
65
|
-
pixQrCode: string;
|
|
66
|
-
pixExpirationDate: string;
|
|
6
|
+
checkoutId: string;
|
|
7
|
+
orderId?: string;
|
|
8
|
+
totalPrice: number;
|
|
9
|
+
userId: string;
|
|
10
|
+
paymentProvider: PaymentProvider;
|
|
11
|
+
createdAt: Date;
|
|
12
|
+
updatedAt?: Date;
|
|
13
|
+
transaction: PaymentTransaction;
|
|
67
14
|
static get identifiersFields(): GenericIdentifier[];
|
|
68
15
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from './payment-customer.type';
|
|
2
|
-
export * from './payment-document.type';
|
|
3
1
|
export * from './payment-address.type';
|
|
4
2
|
export * from './payment-billing.type';
|
|
5
|
-
export * from './payment-shipping.type';
|
|
6
|
-
export * from './payment-item.type';
|
|
7
3
|
export * from './payment-card.type';
|
|
4
|
+
export * from './payment-customer.type';
|
|
5
|
+
export * from './payment-document.type';
|
|
6
|
+
export * from './payment-item.type';
|
|
7
|
+
export * from './payment-shipping.type';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PaymentProviderCard } from '../interfaces';
|
|
2
|
+
import { Checkout, Payment } from '../models';
|
|
3
|
+
import { OrderBlockedRepository, PaymentRepository } from '../repositories';
|
|
4
|
+
import { AdyenCredentials, PaymentCardInfo } from '../types';
|
|
5
|
+
export declare class AdyenCardService implements PaymentProviderCard {
|
|
6
|
+
private credentials;
|
|
7
|
+
private paymentRepository;
|
|
8
|
+
private orderBlockedRepository;
|
|
9
|
+
constructor(credentials: AdyenCredentials, paymentRepository: PaymentRepository, orderBlockedRepository: OrderBlockedRepository);
|
|
10
|
+
pay(checkout: Checkout, card: PaymentCardInfo): Promise<Payment>;
|
|
11
|
+
private createCardPayment;
|
|
12
|
+
addCard(): Promise<any>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AntifraudProvider } from '../interfaces';
|
|
2
|
+
import { Checkout } from '../models';
|
|
3
|
+
import { OrderBlockedRepository } from '../repositories';
|
|
4
|
+
export declare class AntifraudBankSlipService implements AntifraudProvider {
|
|
5
|
+
private orderBlockedRepository;
|
|
6
|
+
private MAX_ORDER_VALUE;
|
|
7
|
+
constructor(orderBlockedRepository: OrderBlockedRepository);
|
|
8
|
+
validate(checkout: Checkout): Promise<Boolean>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AntifraudProvider } from '../interfaces';
|
|
2
|
+
import { Checkout } from '../models';
|
|
3
|
+
import { OrderBlockedRepository, OrderRepository } from '../repositories';
|
|
4
|
+
import { PaymentCardInfo } from '../types';
|
|
5
|
+
export declare class AntifraudCardService implements AntifraudProvider {
|
|
6
|
+
private orderRepository;
|
|
7
|
+
private orderBlockedRepository;
|
|
8
|
+
private LIMIT_ORDERS_DAY;
|
|
9
|
+
private LIMIT_ORDERS_WEEK;
|
|
10
|
+
private LIMIT_BLOCKED_ORDERS_DAY;
|
|
11
|
+
constructor(orderRepository: OrderRepository, orderBlockedRepository: OrderBlockedRepository);
|
|
12
|
+
validate(checkout: Checkout, card: PaymentCardInfo): Promise<Boolean>;
|
|
13
|
+
private verifyBlockedOrderAttempts;
|
|
14
|
+
private verifyDayAndWeekOrders;
|
|
15
|
+
private validateOrdersByRange;
|
|
16
|
+
private countOrdersByField;
|
|
17
|
+
private getDateRange;
|
|
18
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PaymentProviderGlampoints } from '../interfaces';
|
|
2
|
+
import { Checkout, Payment } from '../models';
|
|
3
|
+
import { PaymentRepository } from '../repositories';
|
|
4
|
+
export declare class GlampointsPaymentService implements PaymentProviderGlampoints {
|
|
5
|
+
private paymentRepository;
|
|
6
|
+
constructor(paymentRepository: PaymentRepository);
|
|
7
|
+
pay(checkout: Checkout): Promise<Payment>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './adyen-card-payment.service';
|
|
2
|
+
export * from './antifraud-bankslip.service';
|
|
3
|
+
export * from './antifraud-card.service';
|
|
4
|
+
export * from './antifraud-glampoints.service';
|
|
5
|
+
export * from './antifraud-pix.service';
|
|
6
|
+
export * from './glampoints-payment.service';
|
|
7
|
+
export * from './pagarme-bank-slip-payment.service';
|
|
8
|
+
export * from './pagarme-card-payment.service';
|
|
9
|
+
export * from './pagarme-pix-payment.service';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PaymentProviderBankSlip } from '../interfaces';
|
|
2
|
+
import { Checkout, Payment } from '../models';
|
|
3
|
+
import { PaymentRepository } from '../repositories';
|
|
4
|
+
import { PagarmeCredentials } from '../types';
|
|
5
|
+
export declare class PagarmeBankSlipService implements PaymentProviderBankSlip {
|
|
6
|
+
private credentials;
|
|
7
|
+
private paymentRepository;
|
|
8
|
+
constructor(credentials: PagarmeCredentials, paymentRepository: PaymentRepository);
|
|
9
|
+
pay(checkout: Checkout): Promise<Payment>;
|
|
10
|
+
private createBoletoPayment;
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PaymentProviderCard } from '../interfaces';
|
|
2
|
+
import { Checkout, Payment } from '../models';
|
|
3
|
+
import { OrderBlockedRepository, PaymentRepository } from '../repositories';
|
|
4
|
+
import { PagarmeCredentials, PaymentCardInfo } from '../types';
|
|
5
|
+
export declare class PagarmeCardService implements PaymentProviderCard {
|
|
6
|
+
private credentials;
|
|
7
|
+
private paymentRepository;
|
|
8
|
+
private orderBlockedRepository;
|
|
9
|
+
constructor(credentials: PagarmeCredentials, paymentRepository: PaymentRepository, orderBlockedRepository: OrderBlockedRepository);
|
|
10
|
+
pay(checkout: Checkout, card: PaymentCardInfo): Promise<Payment>;
|
|
11
|
+
addCard(): Promise<any>;
|
|
12
|
+
private createCardPayment;
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PaymentProviderPix } from '../interfaces';
|
|
2
|
+
import { Checkout, Payment } from '../models';
|
|
3
|
+
import { PaymentRepository } from '../repositories';
|
|
4
|
+
import { PagarmeCredentials } from '../types';
|
|
5
|
+
export declare class PagarmePixService 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,2 +1,7 @@
|
|
|
1
|
+
export * from './adyen-credentials.type';
|
|
2
|
+
export * from './antifraud-provider.type';
|
|
1
3
|
export * from './order-tracking-events.type';
|
|
4
|
+
export * from './pagarme-credentials.type';
|
|
2
5
|
export * from './payment-card-info.type';
|
|
6
|
+
export * from './payment-method.type';
|
|
7
|
+
export * from './payment-provider.type';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CustomError } from 'ts-custom-error';
|
|
2
|
+
import { checkoutAdditionalDataError } from './types';
|
|
3
|
+
export declare class BusinessError extends CustomError {
|
|
4
|
+
additionalData?: checkoutAdditionalDataError;
|
|
5
|
+
type: string;
|
|
6
|
+
constructor(message: string, additionalData?: checkoutAdditionalDataError, type?: string);
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CustomError } from 'ts-custom-error';
|
|
2
|
+
import { checkoutAdditionalDataError } from './types';
|
|
3
|
+
export declare class FraudValidationError extends CustomError {
|
|
4
|
+
additionalData?: checkoutAdditionalDataError;
|
|
5
|
+
type: string;
|
|
6
|
+
constructor(message: string, additionalData?: checkoutAdditionalDataError);
|
|
7
|
+
}
|
package/src/errors/index.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
export * from './business.error';
|
|
2
|
+
export * from './duplicated-results.error';
|
|
3
|
+
export * from './fraud-validation.error';
|
|
1
4
|
export * from './invalid-argument.error';
|
|
2
|
-
export * from './required-argument.error';
|
|
3
5
|
export * from './not-found.error';
|
|
4
|
-
export * from './
|
|
6
|
+
export * from './payment.error';
|
|
7
|
+
export * from './required-argument.error';
|
|
8
|
+
export * from './stock-limit.error';
|
|
9
|
+
export * from './stock-out.error';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CustomError } from 'ts-custom-error';
|
|
2
|
+
import { checkoutAdditionalDataError } from './types';
|
|
3
|
+
export declare class PaymentError extends CustomError {
|
|
4
|
+
additionalData?: checkoutAdditionalDataError;
|
|
5
|
+
type: string;
|
|
6
|
+
constructor(message: string, additionalData?: checkoutAdditionalDataError);
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './checkout-additional-data-erro.type';
|