@infrab4a/connect 4.2.4-beta.10 → 4.2.4-beta.12
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
|
@@ -53,6 +53,15 @@ class BasePaymentMethodFactory {
|
|
|
53
53
|
class AdyenPaymentMethodFactory extends BasePaymentMethodFactory {
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
class AntifraudProviderFactory {
|
|
57
|
+
constructor(antifraudProviders) {
|
|
58
|
+
this.antifraudProviders = antifraudProviders;
|
|
59
|
+
}
|
|
60
|
+
build(provider) {
|
|
61
|
+
return this.antifraudProviders[provider];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
56
65
|
class GlampointsPaymentMethodFactory extends BasePaymentMethodFactory {
|
|
57
66
|
}
|
|
58
67
|
|
|
@@ -2224,10 +2233,10 @@ tslib.__decorate([
|
|
|
2224
2233
|
], CheckoutSubscription.prototype, "coupon", void 0);
|
|
2225
2234
|
|
|
2226
2235
|
class AdyenCardService {
|
|
2227
|
-
constructor(credentials,
|
|
2236
|
+
constructor(credentials, paymentRepository, orderBlockedRepository) {
|
|
2228
2237
|
this.credentials = credentials;
|
|
2229
|
-
this.checkoutAntiFraudService = checkoutAntiFraudService;
|
|
2230
2238
|
this.paymentRepository = paymentRepository;
|
|
2239
|
+
this.orderBlockedRepository = orderBlockedRepository;
|
|
2231
2240
|
}
|
|
2232
2241
|
async pay(checkout, card) {
|
|
2233
2242
|
try {
|
|
@@ -2241,7 +2250,7 @@ class AdyenCardService {
|
|
|
2241
2250
|
data: this.createCardPayment(checkout, card),
|
|
2242
2251
|
});
|
|
2243
2252
|
if (result.data.resultCode !== 'Authorised') {
|
|
2244
|
-
this.
|
|
2253
|
+
this.orderBlockedRepository.createBlockedOrderOrPayment(checkout, 'Card not authorized', 'Card', 'day', card);
|
|
2245
2254
|
return Promise.reject(new Error(`Seu pagamento com cartão não foi autorizado. Para não perder seus produtos, pague com PIX ou outro cartão de crédito`));
|
|
2246
2255
|
}
|
|
2247
2256
|
const payment = await this.paymentRepository.create(Payment.toInstance({
|
|
@@ -2761,10 +2770,10 @@ class PagarmeBankSlipService {
|
|
|
2761
2770
|
}
|
|
2762
2771
|
|
|
2763
2772
|
class PagarmeCardService {
|
|
2764
|
-
constructor(credentials,
|
|
2773
|
+
constructor(credentials, paymentRepository, orderBlockedRepository) {
|
|
2765
2774
|
this.credentials = credentials;
|
|
2766
|
-
this.checkoutAntiFraudService = checkoutAntiFraudService;
|
|
2767
2775
|
this.paymentRepository = paymentRepository;
|
|
2776
|
+
this.orderBlockedRepository = orderBlockedRepository;
|
|
2768
2777
|
}
|
|
2769
2778
|
async pay(checkout, card) {
|
|
2770
2779
|
var _a;
|
|
@@ -2775,7 +2784,7 @@ class PagarmeCardService {
|
|
|
2775
2784
|
data: this.createCardPayment(checkout, card),
|
|
2776
2785
|
});
|
|
2777
2786
|
if (result.data.status !== 'paid') {
|
|
2778
|
-
this.
|
|
2787
|
+
this.orderBlockedRepository.createBlockedOrderOrPayment(checkout, 'Card not authorized', 'Card', 'day', card);
|
|
2779
2788
|
return Promise.reject(new Error(`Seu pagamento com cartão não foi autorizado. Para não perder seus produtos, pague com PIX ou outro cartão de crédito`));
|
|
2780
2789
|
}
|
|
2781
2790
|
const payment = await this.paymentRepository.create(Payment.toInstance({
|
|
@@ -6407,6 +6416,7 @@ exports.AntifraudBankSlipService = AntifraudBankSlipService;
|
|
|
6407
6416
|
exports.AntifraudCardService = AntifraudCardService;
|
|
6408
6417
|
exports.AntifraudGlampointsService = AntifraudGlampointsService;
|
|
6409
6418
|
exports.AntifraudPixService = AntifraudPixService;
|
|
6419
|
+
exports.AntifraudProviderFactory = AntifraudProviderFactory;
|
|
6410
6420
|
exports.Authentication = Authentication;
|
|
6411
6421
|
exports.AuthenticationFirebaseAuthService = AuthenticationFirebaseAuthService;
|
|
6412
6422
|
exports.AxiosAdapter = AxiosAdapter;
|
package/index.esm.js
CHANGED
|
@@ -47,6 +47,15 @@ class BasePaymentMethodFactory {
|
|
|
47
47
|
class AdyenPaymentMethodFactory extends BasePaymentMethodFactory {
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
class AntifraudProviderFactory {
|
|
51
|
+
constructor(antifraudProviders) {
|
|
52
|
+
this.antifraudProviders = antifraudProviders;
|
|
53
|
+
}
|
|
54
|
+
build(provider) {
|
|
55
|
+
return this.antifraudProviders[provider];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
50
59
|
class GlampointsPaymentMethodFactory extends BasePaymentMethodFactory {
|
|
51
60
|
}
|
|
52
61
|
|
|
@@ -2218,10 +2227,10 @@ __decorate([
|
|
|
2218
2227
|
], CheckoutSubscription.prototype, "coupon", void 0);
|
|
2219
2228
|
|
|
2220
2229
|
class AdyenCardService {
|
|
2221
|
-
constructor(credentials,
|
|
2230
|
+
constructor(credentials, paymentRepository, orderBlockedRepository) {
|
|
2222
2231
|
this.credentials = credentials;
|
|
2223
|
-
this.checkoutAntiFraudService = checkoutAntiFraudService;
|
|
2224
2232
|
this.paymentRepository = paymentRepository;
|
|
2233
|
+
this.orderBlockedRepository = orderBlockedRepository;
|
|
2225
2234
|
}
|
|
2226
2235
|
async pay(checkout, card) {
|
|
2227
2236
|
try {
|
|
@@ -2235,7 +2244,7 @@ class AdyenCardService {
|
|
|
2235
2244
|
data: this.createCardPayment(checkout, card),
|
|
2236
2245
|
});
|
|
2237
2246
|
if (result.data.resultCode !== 'Authorised') {
|
|
2238
|
-
this.
|
|
2247
|
+
this.orderBlockedRepository.createBlockedOrderOrPayment(checkout, 'Card not authorized', 'Card', 'day', card);
|
|
2239
2248
|
return Promise.reject(new Error(`Seu pagamento com cartão não foi autorizado. Para não perder seus produtos, pague com PIX ou outro cartão de crédito`));
|
|
2240
2249
|
}
|
|
2241
2250
|
const payment = await this.paymentRepository.create(Payment.toInstance({
|
|
@@ -2755,10 +2764,10 @@ class PagarmeBankSlipService {
|
|
|
2755
2764
|
}
|
|
2756
2765
|
|
|
2757
2766
|
class PagarmeCardService {
|
|
2758
|
-
constructor(credentials,
|
|
2767
|
+
constructor(credentials, paymentRepository, orderBlockedRepository) {
|
|
2759
2768
|
this.credentials = credentials;
|
|
2760
|
-
this.checkoutAntiFraudService = checkoutAntiFraudService;
|
|
2761
2769
|
this.paymentRepository = paymentRepository;
|
|
2770
|
+
this.orderBlockedRepository = orderBlockedRepository;
|
|
2762
2771
|
}
|
|
2763
2772
|
async pay(checkout, card) {
|
|
2764
2773
|
var _a;
|
|
@@ -2769,7 +2778,7 @@ class PagarmeCardService {
|
|
|
2769
2778
|
data: this.createCardPayment(checkout, card),
|
|
2770
2779
|
});
|
|
2771
2780
|
if (result.data.status !== 'paid') {
|
|
2772
|
-
this.
|
|
2781
|
+
this.orderBlockedRepository.createBlockedOrderOrPayment(checkout, 'Card not authorized', 'Card', 'day', card);
|
|
2773
2782
|
return Promise.reject(new Error(`Seu pagamento com cartão não foi autorizado. Para não perder seus produtos, pague com PIX ou outro cartão de crédito`));
|
|
2774
2783
|
}
|
|
2775
2784
|
const payment = await this.paymentRepository.create(Payment.toInstance({
|
|
@@ -6278,4 +6287,4 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
6278
6287
|
}
|
|
6279
6288
|
}
|
|
6280
6289
|
|
|
6281
|
-
export { AccessoryImportances, Address, AdyenCardService, AdyenPaymentMethodFactory, AntifraudBankSlipService, AntifraudCardService, AntifraudGlampointsService, AntifraudPixService, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, Buy2Win, Buy2WinFirestoreRepository, Campaign, CampaignBanner, CampaignDashboard, CampaignDashboardFirestoreRepository, CampaignHashtag, CampaignHashtagFirestoreRepository, Category, CategoryCollectionChildren, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryFilter, CategoryFilterHasuraGraphQLRepository, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, Checkout, CheckoutAntiFraudService, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, ClassNameHelper, Coupon, CouponFirestoreRepository, CouponSubtypes, CouponTypes, Debug, DebugDecoratorHelper, DebugHelper, DebugNamespaces, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FragranceImportances, GenderDestination, GlampointsPaymentMethodFactory, GlampointsPaymentService, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, Log, Logger, NotFoundError, OfficePosition, Order, OrderBlocked, OrderBlockedFirestoreRepository, OrderFirestoreRepository, OrderStatus, PagarmeBankSlipService, PagarmeCardService, PagarmePaymentMethodFactory, PagarmePixService, Payment, PaymentFirestoreRepository, PaymentProviderFactory, PaymentTransaction, PaymentType, Product, ProductFirestoreRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductReviews, ProductReviewsHasuraGraphQLRepository, ProductSpents, ProductVariantFirestoreRepository, ProductsIndex, QuestionsFilters, RecoveryPassword, ReflectHelper, Register, RegisterFirebaseAuthService, RequiredArgumentError, RoundProductPricesHelper, Sequence, SequenceFirestoreRepository, ShippingMethod, ShopMenu, ShopMenuFirestoreRepository, ShopPageName, ShopSettings, ShopSettingsFirestoreRepository, Shops, SignInMethods, SignOut, Status, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionMaterialization, SubscriptionMaterializationFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionSummary, SubscriptionSummaryFirestoreRepository, Trace, UnauthorizedError, UpdateOptionActions, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserType, Variant, VariantHasuraGraphQL, VariantHasuraGraphQLRepository, WeakPasswordError, Where, Wishlist, WishlistHasuraGraphQLRepository, antifraudProviders, is, isDebuggable, isUUID, parseDateTime, paymentMethods, paymentProviders, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|
|
6290
|
+
export { AccessoryImportances, Address, AdyenCardService, AdyenPaymentMethodFactory, AntifraudBankSlipService, AntifraudCardService, AntifraudGlampointsService, AntifraudPixService, AntifraudProviderFactory, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, Buy2Win, Buy2WinFirestoreRepository, Campaign, CampaignBanner, CampaignDashboard, CampaignDashboardFirestoreRepository, CampaignHashtag, CampaignHashtagFirestoreRepository, Category, CategoryCollectionChildren, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryFilter, CategoryFilterHasuraGraphQLRepository, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, Checkout, CheckoutAntiFraudService, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, ClassNameHelper, Coupon, CouponFirestoreRepository, CouponSubtypes, CouponTypes, Debug, DebugDecoratorHelper, DebugHelper, DebugNamespaces, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FragranceImportances, GenderDestination, GlampointsPaymentMethodFactory, GlampointsPaymentService, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, Log, Logger, NotFoundError, OfficePosition, Order, OrderBlocked, OrderBlockedFirestoreRepository, OrderFirestoreRepository, OrderStatus, PagarmeBankSlipService, PagarmeCardService, PagarmePaymentMethodFactory, PagarmePixService, Payment, PaymentFirestoreRepository, PaymentProviderFactory, PaymentTransaction, PaymentType, Product, ProductFirestoreRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductReviews, ProductReviewsHasuraGraphQLRepository, ProductSpents, ProductVariantFirestoreRepository, ProductsIndex, QuestionsFilters, RecoveryPassword, ReflectHelper, Register, RegisterFirebaseAuthService, RequiredArgumentError, RoundProductPricesHelper, Sequence, SequenceFirestoreRepository, ShippingMethod, ShopMenu, ShopMenuFirestoreRepository, ShopPageName, ShopSettings, ShopSettingsFirestoreRepository, Shops, SignInMethods, SignOut, Status, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionMaterialization, SubscriptionMaterializationFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionSummary, SubscriptionSummaryFirestoreRepository, Trace, UnauthorizedError, UpdateOptionActions, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserType, Variant, VariantHasuraGraphQL, VariantHasuraGraphQLRepository, WeakPasswordError, Where, Wishlist, WishlistHasuraGraphQLRepository, antifraudProviders, is, isDebuggable, isUUID, parseDateTime, paymentMethods, paymentProviders, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { PaymentProviderCard } from '../interfaces';
|
|
2
2
|
import { Checkout, Payment } from '../models';
|
|
3
|
-
import { PaymentRepository } from '../repositories';
|
|
3
|
+
import { OrderBlockedRepository, PaymentRepository } from '../repositories';
|
|
4
4
|
import { adyenCredentials, paymentCardInfo } from '../types';
|
|
5
|
-
import { CheckoutAntiFraudService } from './antifraud.service';
|
|
6
5
|
export declare class AdyenCardService implements PaymentProviderCard {
|
|
7
6
|
private credentials;
|
|
8
|
-
private checkoutAntiFraudService;
|
|
9
7
|
private paymentRepository;
|
|
10
|
-
|
|
8
|
+
private orderBlockedRepository;
|
|
9
|
+
constructor(credentials: adyenCredentials, paymentRepository: PaymentRepository, orderBlockedRepository: OrderBlockedRepository);
|
|
11
10
|
pay(checkout: Checkout, card: paymentCardInfo): Promise<Payment>;
|
|
12
11
|
private createCardPayment;
|
|
13
12
|
addCard(): Promise<any>;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { PaymentProviderCard } from '../interfaces';
|
|
2
2
|
import { Checkout, Payment } from '../models';
|
|
3
|
-
import { PaymentRepository } from '../repositories';
|
|
3
|
+
import { OrderBlockedRepository, PaymentRepository } from '../repositories';
|
|
4
4
|
import { pagarmeCredentials, paymentCardInfo } from '../types';
|
|
5
|
-
import { CheckoutAntiFraudService } from './antifraud.service';
|
|
6
5
|
export declare class PagarmeCardService implements PaymentProviderCard {
|
|
7
6
|
private credentials;
|
|
8
|
-
private checkoutAntiFraudService;
|
|
9
7
|
private paymentRepository;
|
|
10
|
-
|
|
8
|
+
private orderBlockedRepository;
|
|
9
|
+
constructor(credentials: pagarmeCredentials, paymentRepository: PaymentRepository, orderBlockedRepository: OrderBlockedRepository);
|
|
11
10
|
pay(checkout: Checkout, card: paymentCardInfo): Promise<Payment>;
|
|
12
11
|
addCard(): Promise<any>;
|
|
13
12
|
private createCardPayment;
|