@infrab4a/connect 5.1.0-beta.8 → 5.1.0-beta.9
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 +6 -5
- package/index.esm.js +6 -5
- package/package.json +1 -1
- package/src/domain/shopping/interfaces/payment-provider-card.interface.d.ts +1 -0
- package/src/domain/shopping/models/payment-transaction.d.ts +1 -0
- package/src/domain/shopping/models/payment.d.ts +1 -1
- package/src/infra/pagarme/adapters/v5/pagarmev5-card-payment-axios.adapter.d.ts +2 -1
package/index.cjs.js
CHANGED
|
@@ -8729,8 +8729,9 @@ class PagarMeV5ResponseHelper {
|
|
|
8729
8729
|
paid_amount: charger.paid_amount,
|
|
8730
8730
|
paid_at: charger.paid_at,
|
|
8731
8731
|
order_id: response.id,
|
|
8732
|
-
|
|
8733
|
-
|
|
8732
|
+
charger_id: charger.id,
|
|
8733
|
+
tid: charger.id,
|
|
8734
|
+
id: charger.id,
|
|
8734
8735
|
...(method == exports.TransactionPaymentMethods.BANKSLIP && this.getBoletoReponse(transaction)),
|
|
8735
8736
|
...(method == exports.TransactionPaymentMethods.PIX && this.getPixReponse(transaction)),
|
|
8736
8737
|
...(method == exports.TransactionPaymentMethods.CARD && this.getCardReponse(transaction)),
|
|
@@ -9207,11 +9208,11 @@ class PagarmeV5CardAxiosAdapter {
|
|
|
9207
9208
|
});
|
|
9208
9209
|
}
|
|
9209
9210
|
}
|
|
9210
|
-
async getCardByToken(
|
|
9211
|
+
async getCardByToken(customerId, token) {
|
|
9211
9212
|
try {
|
|
9212
9213
|
const { data } = await axios__default["default"]({
|
|
9213
9214
|
method: 'GET',
|
|
9214
|
-
url: `${this.credentials.URL}/cards/${
|
|
9215
|
+
url: `${this.credentials.URL}/cards/${token}`,
|
|
9215
9216
|
data: {
|
|
9216
9217
|
api_key: this.credentials.API_KEY,
|
|
9217
9218
|
},
|
|
@@ -9219,7 +9220,7 @@ class PagarmeV5CardAxiosAdapter {
|
|
|
9219
9220
|
return data;
|
|
9220
9221
|
}
|
|
9221
9222
|
catch (error) {
|
|
9222
|
-
throw new BusinessError('Houve uma falha buscar o cartão com id: ' +
|
|
9223
|
+
throw new BusinessError('Houve uma falha buscar o cartão com id: ' + token, {
|
|
9223
9224
|
info: error.response.data,
|
|
9224
9225
|
});
|
|
9225
9226
|
}
|
package/index.esm.js
CHANGED
|
@@ -8704,8 +8704,9 @@ class PagarMeV5ResponseHelper {
|
|
|
8704
8704
|
paid_amount: charger.paid_amount,
|
|
8705
8705
|
paid_at: charger.paid_at,
|
|
8706
8706
|
order_id: response.id,
|
|
8707
|
-
|
|
8708
|
-
|
|
8707
|
+
charger_id: charger.id,
|
|
8708
|
+
tid: charger.id,
|
|
8709
|
+
id: charger.id,
|
|
8709
8710
|
...(method == TransactionPaymentMethods.BANKSLIP && this.getBoletoReponse(transaction)),
|
|
8710
8711
|
...(method == TransactionPaymentMethods.PIX && this.getPixReponse(transaction)),
|
|
8711
8712
|
...(method == TransactionPaymentMethods.CARD && this.getCardReponse(transaction)),
|
|
@@ -9182,11 +9183,11 @@ class PagarmeV5CardAxiosAdapter {
|
|
|
9182
9183
|
});
|
|
9183
9184
|
}
|
|
9184
9185
|
}
|
|
9185
|
-
async getCardByToken(
|
|
9186
|
+
async getCardByToken(customerId, token) {
|
|
9186
9187
|
try {
|
|
9187
9188
|
const { data } = await axios({
|
|
9188
9189
|
method: 'GET',
|
|
9189
|
-
url: `${this.credentials.URL}/cards/${
|
|
9190
|
+
url: `${this.credentials.URL}/cards/${token}`,
|
|
9190
9191
|
data: {
|
|
9191
9192
|
api_key: this.credentials.API_KEY,
|
|
9192
9193
|
},
|
|
@@ -9194,7 +9195,7 @@ class PagarmeV5CardAxiosAdapter {
|
|
|
9194
9195
|
return data;
|
|
9195
9196
|
}
|
|
9196
9197
|
catch (error) {
|
|
9197
|
-
throw new BusinessError('Houve uma falha buscar o cartão com id: ' +
|
|
9198
|
+
throw new BusinessError('Houve uma falha buscar o cartão com id: ' + token, {
|
|
9198
9199
|
info: error.response.data,
|
|
9199
9200
|
});
|
|
9200
9201
|
}
|
package/package.json
CHANGED
|
@@ -9,6 +9,7 @@ export interface PaymentProviderCard<Card extends BaseCard = BaseCard> {
|
|
|
9
9
|
pay(checkout: Checkout, card: PaymentCardInfo): Promise<Payment>;
|
|
10
10
|
addCard(card: CardInfo): Promise<Card>;
|
|
11
11
|
getCardByToken(token: string): Promise<Card>;
|
|
12
|
+
getCardByToken(customerId: string, token: string): Promise<Card>;
|
|
12
13
|
createCardHash<T>(bu: BusinessUnitEnum, shop: Shops, card?: CardInfo): Promise<string | T>;
|
|
13
14
|
createTransaction(info: any): Promise<PaymentTransaction>;
|
|
14
15
|
}
|
|
@@ -2,7 +2,7 @@ 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: string;
|
|
5
|
+
id: string | number;
|
|
6
6
|
checkoutId: string;
|
|
7
7
|
orderId?: string;
|
|
8
8
|
pagarMeOrderId?: string;
|
|
@@ -12,6 +12,7 @@ export declare class PagarmeV5CardAxiosAdapter implements PaymentProviderCard<Pa
|
|
|
12
12
|
pay(checkout: Checkout, card: PaymentCardInfo): Promise<Payment>;
|
|
13
13
|
addCard(card: CardInfo): Promise<PagarMeCard>;
|
|
14
14
|
createCardHash<PagarMeCardManualHash>(bu: BusinessUnitEnum, shop?: Shops): Promise<PagarMeCardManualHash>;
|
|
15
|
-
getCardByToken(
|
|
15
|
+
getCardByToken(token: string): Promise<PagarMeCard>;
|
|
16
|
+
getCardByToken(customerId: string, token: string): Promise<PagarMeCard>;
|
|
16
17
|
createTransaction(info: any): Promise<PaymentTransaction>;
|
|
17
18
|
}
|