@infrab4a/connect 4.20.0-beta.7 → 4.20.0-beta.8
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 +9 -2
- package/index.esm.js +9 -2
- package/package.json +1 -1
- package/src/domain/shopping/interfaces/payment-provider-card.interface.d.ts +2 -0
- package/src/infra/adyen/adapters/adyen-card-payment-axios.adapter.d.ts +2 -0
- package/src/infra/pagarme/adapters/pagarme-card-payment-axios.adapter.d.ts +1 -1
package/index.cjs.js
CHANGED
|
@@ -2830,6 +2830,9 @@ class AdyenCardAxiosAdapter {
|
|
|
2830
2830
|
this.paymentRepository = paymentRepository;
|
|
2831
2831
|
this.orderBlockedRepository = orderBlockedRepository;
|
|
2832
2832
|
}
|
|
2833
|
+
createCardHash(bu) {
|
|
2834
|
+
throw new Error('Method not implemented.');
|
|
2835
|
+
}
|
|
2833
2836
|
async pay(checkout, card) {
|
|
2834
2837
|
try {
|
|
2835
2838
|
const result = await axios__default["default"]({
|
|
@@ -7096,14 +7099,18 @@ class PagarmeCardAxiosAdapter {
|
|
|
7096
7099
|
try {
|
|
7097
7100
|
const { data } = await axios__default["default"]({
|
|
7098
7101
|
method: 'GET',
|
|
7102
|
+
headers: {
|
|
7103
|
+
'content-type': 'application/json',
|
|
7104
|
+
},
|
|
7099
7105
|
url: `${this.credentials.URL}/transactions/card_hash_key`,
|
|
7100
|
-
data: {
|
|
7106
|
+
data: JSON.stringify({
|
|
7101
7107
|
api_key: key,
|
|
7102
|
-
},
|
|
7108
|
+
}),
|
|
7103
7109
|
});
|
|
7104
7110
|
return data;
|
|
7105
7111
|
}
|
|
7106
7112
|
catch (error) {
|
|
7113
|
+
console.log('createCardHash axios error', error);
|
|
7107
7114
|
throw new BusinessError('Houve uma falha gerar o hash', {
|
|
7108
7115
|
info: error.response.data,
|
|
7109
7116
|
});
|
package/index.esm.js
CHANGED
|
@@ -2824,6 +2824,9 @@ class AdyenCardAxiosAdapter {
|
|
|
2824
2824
|
this.paymentRepository = paymentRepository;
|
|
2825
2825
|
this.orderBlockedRepository = orderBlockedRepository;
|
|
2826
2826
|
}
|
|
2827
|
+
createCardHash(bu) {
|
|
2828
|
+
throw new Error('Method not implemented.');
|
|
2829
|
+
}
|
|
2827
2830
|
async pay(checkout, card) {
|
|
2828
2831
|
try {
|
|
2829
2832
|
const result = await axios({
|
|
@@ -7090,14 +7093,18 @@ class PagarmeCardAxiosAdapter {
|
|
|
7090
7093
|
try {
|
|
7091
7094
|
const { data } = await axios({
|
|
7092
7095
|
method: 'GET',
|
|
7096
|
+
headers: {
|
|
7097
|
+
'content-type': 'application/json',
|
|
7098
|
+
},
|
|
7093
7099
|
url: `${this.credentials.URL}/transactions/card_hash_key`,
|
|
7094
|
-
data: {
|
|
7100
|
+
data: JSON.stringify({
|
|
7095
7101
|
api_key: key,
|
|
7096
|
-
},
|
|
7102
|
+
}),
|
|
7097
7103
|
});
|
|
7098
7104
|
return data;
|
|
7099
7105
|
}
|
|
7100
7106
|
catch (error) {
|
|
7107
|
+
console.log('createCardHash axios error', error);
|
|
7101
7108
|
throw new BusinessError('Houve uma falha gerar o hash', {
|
|
7102
7109
|
info: error.response.data,
|
|
7103
7110
|
});
|
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BusinessUnitEnum } from '../enums';
|
|
1
2
|
import { PaymentTransaction } from '../models';
|
|
2
3
|
import { Checkout } from '../models/checkout';
|
|
3
4
|
import { Payment } from '../models/payment';
|
|
@@ -7,5 +8,6 @@ export interface PaymentProviderCard<Card extends BaseCard = BaseCard> {
|
|
|
7
8
|
pay(checkout: Checkout, card: PaymentCardInfo): Promise<Payment>;
|
|
8
9
|
addCard(card: CardInfo): Promise<Card>;
|
|
9
10
|
getCardByToken(token: string): Promise<Card>;
|
|
11
|
+
createCardHash<T>(bu: BusinessUnitEnum, card?: CardInfo): Promise<string | T>;
|
|
10
12
|
createTransaction(info: any): Promise<PaymentTransaction>;
|
|
11
13
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BusinessUnitEnum } from '../../../domain';
|
|
1
2
|
import { PaymentProviderCard } from '../../../domain/shopping/interfaces';
|
|
2
3
|
import { Checkout, Payment, PaymentTransaction } from '../../../domain/shopping/models';
|
|
3
4
|
import { OrderBlockedRepository, PaymentRepository } from '../../../domain/shopping/repositories';
|
|
@@ -7,6 +8,7 @@ export declare class AdyenCardAxiosAdapter implements PaymentProviderCard<AdyenC
|
|
|
7
8
|
private paymentRepository;
|
|
8
9
|
private orderBlockedRepository;
|
|
9
10
|
constructor(credentials: AdyenCredentials, paymentRepository: PaymentRepository, orderBlockedRepository: OrderBlockedRepository);
|
|
11
|
+
createCardHash(bu: BusinessUnitEnum): Promise<string>;
|
|
10
12
|
pay(checkout: Checkout, card: PaymentCardInfo): Promise<Payment>;
|
|
11
13
|
private createCardPayment;
|
|
12
14
|
addCard(): Promise<AdyenCard>;
|
|
@@ -10,7 +10,7 @@ export declare class PagarmeCardAxiosAdapter implements PaymentProviderCard<Paga
|
|
|
10
10
|
constructor(credentials: PagarmeCredentials, paymentRepository: PaymentRepository, orderBlockedRepository: OrderBlockedRepository);
|
|
11
11
|
pay(checkout: Checkout, card: PaymentCardInfo): Promise<Payment>;
|
|
12
12
|
addCard(card: CardInfo): Promise<PagarMeCard>;
|
|
13
|
-
createCardHash(bu: BusinessUnitEnum): Promise<
|
|
13
|
+
createCardHash<PagarMeCardManualHash>(bu: BusinessUnitEnum): Promise<PagarMeCardManualHash>;
|
|
14
14
|
getCardByToken(id: string): Promise<PagarMeCard>;
|
|
15
15
|
createTransaction(info: any): Promise<PaymentTransaction>;
|
|
16
16
|
private createCardPayment;
|