@infrab4a/connect 5.0.0 → 5.1.0-beta.1
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 +450 -0
- package/index.esm.js +448 -1
- package/package.json +1 -1
- package/src/domain/shopping/enums/index.d.ts +1 -0
- package/src/domain/shopping/enums/pagarme-v5-payment-status.enum.d.ts +24 -0
- package/src/domain/shopping/models/payment-transaction.d.ts +14 -0
- package/src/domain/shopping/models/payment.d.ts +1 -0
- package/src/domain/shopping/types/index.d.ts +1 -0
- package/src/domain/shopping/types/pagarme-credentials-v5.type.d.ts +4 -0
- package/src/infra/pagarme/adapters/helpers/index.d.ts +2 -0
- package/src/infra/pagarme/adapters/helpers/pagarme-v5-request.helper.d.ts +12 -0
- package/src/infra/pagarme/adapters/helpers/pagarme-v5-response.helper.d.ts +9 -0
- package/src/infra/pagarme/adapters/index.d.ts +2 -3
- package/src/infra/pagarme/adapters/v4/index.d.ts +3 -0
- package/src/infra/pagarme/adapters/{pagarme-bank-slip-payment-axios.adapter.d.ts → v4/pagarme-bank-slip-payment-axios.adapter.d.ts} +4 -4
- package/src/infra/pagarme/adapters/{pagarme-card-payment-axios.adapter.d.ts → v4/pagarme-card-payment-axios.adapter.d.ts} +5 -5
- package/src/infra/pagarme/adapters/v4/pagarme-pix-payment-axios.adapter.d.ts +11 -0
- package/src/infra/pagarme/adapters/v5/index.d.ts +3 -0
- package/src/infra/pagarme/adapters/v5/pagarmev5-bank-slip-payment-axios.adapter.d.ts +11 -0
- package/src/infra/pagarme/adapters/v5/pagarmev5-card-payment-axios.adapter.d.ts +16 -0
- package/src/infra/pagarme/adapters/v5/pagarmev5-pix-payment-axios.adapter.d.ts +10 -0
- package/src/infra/pagarme/index.d.ts +1 -0
- package/src/infra/pagarme/types/index.d.ts +1 -0
- package/src/infra/pagarme/types/v5/index.d.ts +3 -0
- package/src/infra/pagarme/types/v5/pagarmev5-order-request-payload.type.d.ts +85 -0
- package/src/infra/pagarme/types/v5/pagarmev5-order-response.type.d.ts +126 -0
- package/src/infra/pagarme/types/v5/pagarmev5-postback-response.type.d.ts +11 -0
- package/src/infra/pagarme/adapters/pagarme-pix-payment-axios.adapter.d.ts +0 -11
package/index.esm.js
CHANGED
|
@@ -48,6 +48,33 @@ var PagarmePaymentStatus;
|
|
|
48
48
|
PagarmePaymentStatus["Chargedback"] = "chargedback";
|
|
49
49
|
})(PagarmePaymentStatus || (PagarmePaymentStatus = {}));
|
|
50
50
|
|
|
51
|
+
var PagarMeV5PaymentStatus;
|
|
52
|
+
(function (PagarMeV5PaymentStatus) {
|
|
53
|
+
PagarMeV5PaymentStatus["Em processamento"] = "processing";
|
|
54
|
+
PagarMeV5PaymentStatus["Gerado"] = "generated";
|
|
55
|
+
PagarMeV5PaymentStatus["Visualizado"] = "viewed";
|
|
56
|
+
PagarMeV5PaymentStatus["Pago a menor"] = "underpaid";
|
|
57
|
+
PagarMeV5PaymentStatus["Pago a maior"] = "overpaid";
|
|
58
|
+
PagarMeV5PaymentStatus["Aguardando pagamento"] = "waiting_payment";
|
|
59
|
+
PagarMeV5PaymentStatus["Pago"] = "paid";
|
|
60
|
+
PagarMeV5PaymentStatus["Aguardando estorno"] = "pending_refund";
|
|
61
|
+
PagarMeV5PaymentStatus["Autorizada pendente de captura"] = "authorized_pending_capture";
|
|
62
|
+
PagarMeV5PaymentStatus["N\u00E3o autorizada"] = "not_authorized";
|
|
63
|
+
PagarMeV5PaymentStatus["Capturada"] = "captured";
|
|
64
|
+
PagarMeV5PaymentStatus["Aguardando captura"] = "waiting_capture";
|
|
65
|
+
PagarMeV5PaymentStatus["Com erro"] = "with_error";
|
|
66
|
+
PagarMeV5PaymentStatus["Estornado"] = "refunded";
|
|
67
|
+
PagarMeV5PaymentStatus["Cancelado"] = "voided";
|
|
68
|
+
PagarMeV5PaymentStatus["Falha"] = "failed";
|
|
69
|
+
})(PagarMeV5PaymentStatus || (PagarMeV5PaymentStatus = {}));
|
|
70
|
+
var PagarMeV5OrderStatus;
|
|
71
|
+
(function (PagarMeV5OrderStatus) {
|
|
72
|
+
PagarMeV5OrderStatus["Pendente"] = "pending";
|
|
73
|
+
PagarMeV5OrderStatus["Pago"] = "paid";
|
|
74
|
+
PagarMeV5OrderStatus["Cancelado"] = "canceled";
|
|
75
|
+
PagarMeV5OrderStatus["Falha"] = "failed";
|
|
76
|
+
})(PagarMeV5OrderStatus || (PagarMeV5OrderStatus = {}));
|
|
77
|
+
|
|
51
78
|
var PaymentMethods;
|
|
52
79
|
(function (PaymentMethods) {
|
|
53
80
|
PaymentMethods["CARD"] = "card";
|
|
@@ -8535,6 +8562,178 @@ class PagarmePaymentOperationsHelper {
|
|
|
8535
8562
|
}
|
|
8536
8563
|
}
|
|
8537
8564
|
|
|
8565
|
+
class PagarMeV5RequestHelper {
|
|
8566
|
+
static build(checkout, type, card) {
|
|
8567
|
+
return {
|
|
8568
|
+
items: this.buildItems(checkout),
|
|
8569
|
+
customer: this.buildCustomer(checkout),
|
|
8570
|
+
shipping: this.buildShipping(checkout),
|
|
8571
|
+
payments: this.buildPayment(checkout, type, card),
|
|
8572
|
+
};
|
|
8573
|
+
}
|
|
8574
|
+
static buildItems(checkout) {
|
|
8575
|
+
return checkout.lineItems.map((item) => {
|
|
8576
|
+
return {
|
|
8577
|
+
amount: Math.floor(item.pricePaid * 100),
|
|
8578
|
+
description: item.name,
|
|
8579
|
+
quantity: item.quantity,
|
|
8580
|
+
};
|
|
8581
|
+
});
|
|
8582
|
+
}
|
|
8583
|
+
static buildCustomer(checkout) {
|
|
8584
|
+
return {
|
|
8585
|
+
name: checkout.user.displayName,
|
|
8586
|
+
email: checkout.user.email,
|
|
8587
|
+
type: 'individual',
|
|
8588
|
+
document: checkout.user.cpf,
|
|
8589
|
+
phones: {
|
|
8590
|
+
mobile_phone: {
|
|
8591
|
+
country_code: '55',
|
|
8592
|
+
number: checkout.user.phone.slice(2),
|
|
8593
|
+
area_code: checkout.user.phone.slice(0, 1),
|
|
8594
|
+
},
|
|
8595
|
+
},
|
|
8596
|
+
address: {
|
|
8597
|
+
line_1: `${checkout.billingAddress.number}, ${checkout.billingAddress.street}, ${checkout.billingAddress.district}`,
|
|
8598
|
+
line_2: `${checkout.billingAddress.extension}`,
|
|
8599
|
+
zip_code: checkout.shippingAddress.zip,
|
|
8600
|
+
city: checkout.billingAddress.city,
|
|
8601
|
+
state: checkout.billingAddress.state,
|
|
8602
|
+
country: checkout.billingAddress.country,
|
|
8603
|
+
},
|
|
8604
|
+
};
|
|
8605
|
+
}
|
|
8606
|
+
static buildShipping(checkout) {
|
|
8607
|
+
return {
|
|
8608
|
+
amount: checkout.shipping.ShippingPrice,
|
|
8609
|
+
description: '',
|
|
8610
|
+
recipient_name: checkout.shippingAddress.recipient,
|
|
8611
|
+
recipient_phone: checkout.user.phone,
|
|
8612
|
+
address: {
|
|
8613
|
+
line_1: `${checkout.shippingAddress.number}, ${checkout.shippingAddress.street}, ${checkout.shippingAddress.district}`,
|
|
8614
|
+
line_2: `${checkout.shippingAddress.extension}`,
|
|
8615
|
+
zip_code: checkout.shippingAddress.zip,
|
|
8616
|
+
city: checkout.shippingAddress.city,
|
|
8617
|
+
state: checkout.shippingAddress.state,
|
|
8618
|
+
country: checkout.shippingAddress.country,
|
|
8619
|
+
},
|
|
8620
|
+
};
|
|
8621
|
+
}
|
|
8622
|
+
static buildPayment(checkout, type, card) {
|
|
8623
|
+
return [
|
|
8624
|
+
{
|
|
8625
|
+
payment_method: type,
|
|
8626
|
+
amount: Math.floor(checkout.totalPrice * 100),
|
|
8627
|
+
...(type === 'pix' && {
|
|
8628
|
+
pix: this.getPixOrder(),
|
|
8629
|
+
}),
|
|
8630
|
+
...(type === 'boleto' && {
|
|
8631
|
+
boleto: this.getBoletoOrder(),
|
|
8632
|
+
}),
|
|
8633
|
+
...(type === 'credit_card' && {
|
|
8634
|
+
credit_card: this.getCardOrder(checkout, card),
|
|
8635
|
+
}),
|
|
8636
|
+
},
|
|
8637
|
+
];
|
|
8638
|
+
}
|
|
8639
|
+
static getPixOrder() {
|
|
8640
|
+
return {
|
|
8641
|
+
expires_at: format(addDays(new Date(), 1), 'yyyy-MM-dd'),
|
|
8642
|
+
};
|
|
8643
|
+
}
|
|
8644
|
+
static getBoletoOrder() {
|
|
8645
|
+
return {
|
|
8646
|
+
due_at: format(addDays(new Date(), 3), 'yyyy-MM-dd'),
|
|
8647
|
+
instructions: 'Sr. Caixa, NÃO aceitar o pagamento após o vencimento.',
|
|
8648
|
+
type: 'DM',
|
|
8649
|
+
document_number: new Date().getTime().toString(),
|
|
8650
|
+
};
|
|
8651
|
+
}
|
|
8652
|
+
static getCardOrder(checkout, card) {
|
|
8653
|
+
return {
|
|
8654
|
+
installments: card.installments,
|
|
8655
|
+
statement_descriptor: checkout.shop === Shops.GLAMSHOP ? 'Glam' : "Men's Market",
|
|
8656
|
+
card_id: card.cardId,
|
|
8657
|
+
card: {
|
|
8658
|
+
cvv: card.cardCvv,
|
|
8659
|
+
},
|
|
8660
|
+
};
|
|
8661
|
+
}
|
|
8662
|
+
}
|
|
8663
|
+
|
|
8664
|
+
class PagarMeV5ResponseHelper {
|
|
8665
|
+
static build(checkout, response) {
|
|
8666
|
+
return Payment.toInstance({
|
|
8667
|
+
createdAt: new Date(),
|
|
8668
|
+
updatedAt: new Date(),
|
|
8669
|
+
userId: checkout.user.id,
|
|
8670
|
+
checkoutId: checkout.id,
|
|
8671
|
+
totalPrice: checkout.totalPrice,
|
|
8672
|
+
paymentProvider: PaymentProviders.PAGARME,
|
|
8673
|
+
pagarMeOrderId: response.id,
|
|
8674
|
+
transaction: this.buildPaymentTransaction(response),
|
|
8675
|
+
});
|
|
8676
|
+
}
|
|
8677
|
+
static buildPaymentTransaction(response) {
|
|
8678
|
+
const charger = response.charges.at(0);
|
|
8679
|
+
const transaction = charger.last_transaction;
|
|
8680
|
+
return PaymentTransaction.toInstance({
|
|
8681
|
+
acquirer_name: 'pagar_me',
|
|
8682
|
+
amount: charger.amount,
|
|
8683
|
+
currency: charger.currency,
|
|
8684
|
+
gateway_id: charger.gateway_id,
|
|
8685
|
+
status: charger.status,
|
|
8686
|
+
payment_method: charger.payment_method,
|
|
8687
|
+
date_created: charger.created_at,
|
|
8688
|
+
date_updated: charger.updated_at,
|
|
8689
|
+
paid_amount: charger.paid_amount,
|
|
8690
|
+
paid_at: charger.paid_at,
|
|
8691
|
+
order_id: response.id,
|
|
8692
|
+
tid: +transaction.id,
|
|
8693
|
+
id: +transaction.id,
|
|
8694
|
+
...this.getBoletoReponse(transaction),
|
|
8695
|
+
...this.getPixReponse(transaction),
|
|
8696
|
+
...this.getCardReponse(transaction),
|
|
8697
|
+
});
|
|
8698
|
+
}
|
|
8699
|
+
static getBoletoReponse(transaction) {
|
|
8700
|
+
return {
|
|
8701
|
+
boleto_url: transaction.url?.toString(),
|
|
8702
|
+
boleto_barcode: transaction.barcode?.toString(),
|
|
8703
|
+
boleto_qr_code: transaction.qr_code?.toString(),
|
|
8704
|
+
boleto_expiration_date: transaction.due_at?.toString(),
|
|
8705
|
+
boleto_instructions: transaction.instructions?.toString(),
|
|
8706
|
+
boleto_nosso_numero: transaction.nosso_numero?.toString(),
|
|
8707
|
+
boleto_type: transaction.type?.toString(),
|
|
8708
|
+
boleto_document_number: transaction.document_number?.toString(),
|
|
8709
|
+
};
|
|
8710
|
+
}
|
|
8711
|
+
static getPixReponse(transaction) {
|
|
8712
|
+
return {
|
|
8713
|
+
pix_qr_code: transaction.qr_code?.toString(),
|
|
8714
|
+
pix_qr_code_url: transaction.qr_code_url?.toString(),
|
|
8715
|
+
pix_expiration_date: transaction.expires_at?.toString(),
|
|
8716
|
+
};
|
|
8717
|
+
}
|
|
8718
|
+
static getCardReponse(transaction) {
|
|
8719
|
+
return {
|
|
8720
|
+
soft_descriptor: transaction.statement_descriptor?.toString(),
|
|
8721
|
+
acquirer_name: transaction.acquirer_name?.toString(),
|
|
8722
|
+
acquirer_id: transaction.acquirer_tid?.toString(),
|
|
8723
|
+
acquirer_nsu: transaction.acquirer_nsu?.toString(),
|
|
8724
|
+
acquirer_auth_code: transaction.acquirer_auth_code?.toString(),
|
|
8725
|
+
acquirer_message: transaction.acquirer_message?.toString(),
|
|
8726
|
+
acquirer_return_code: transaction.acquirer_return_code?.toString(),
|
|
8727
|
+
installments: transaction.installments ?? null,
|
|
8728
|
+
card_holder_name: transaction.card.holder_name?.toString(),
|
|
8729
|
+
card_last_digits: transaction.card.last_four_digits?.toString(),
|
|
8730
|
+
card_first_digits: transaction.card.first_six_digits?.toString(),
|
|
8731
|
+
card_brand: transaction.card.brand?.toString(),
|
|
8732
|
+
card_id: transaction.card.id?.toString(),
|
|
8733
|
+
};
|
|
8734
|
+
}
|
|
8735
|
+
}
|
|
8736
|
+
|
|
8538
8737
|
class PagarmeCardAxiosAdapter {
|
|
8539
8738
|
constructor(credentials, paymentRepository, orderBlockedRepository) {
|
|
8540
8739
|
this.credentials = credentials;
|
|
@@ -8755,6 +8954,254 @@ class PagarmePixAxiosAdapter {
|
|
|
8755
8954
|
}
|
|
8756
8955
|
}
|
|
8757
8956
|
|
|
8957
|
+
class PagarmeV5BankSlipAxiosAdapter {
|
|
8958
|
+
constructor(credentials, paymentRepository) {
|
|
8959
|
+
this.credentials = credentials;
|
|
8960
|
+
this.paymentRepository = paymentRepository;
|
|
8961
|
+
}
|
|
8962
|
+
async pay(checkout) {
|
|
8963
|
+
try {
|
|
8964
|
+
const payload = PagarMeV5RequestHelper.build(checkout, 'boleto');
|
|
8965
|
+
console.warn('[PAGARME BOLETO DATA TO SEND]', JSON.stringify(payload));
|
|
8966
|
+
const { data } = await axios({
|
|
8967
|
+
method: 'POST',
|
|
8968
|
+
url: `${this.credentials.URL}/orders`,
|
|
8969
|
+
headers: {
|
|
8970
|
+
Authorization: 'Basic ' + Buffer.from(`${this.credentials.API_KEY}:`).toString('base64'),
|
|
8971
|
+
'Content-Type': 'application/json',
|
|
8972
|
+
},
|
|
8973
|
+
data: payload,
|
|
8974
|
+
});
|
|
8975
|
+
console.warn('[PAGARME RESPONSE BOLETO DATA]', JSON.stringify(data));
|
|
8976
|
+
if (data.charges.at(0).status !== PagarMeV5OrderStatus['Em processamento'] ||
|
|
8977
|
+
data.charges.at(0).status !== PagarMeV5PaymentStatus['Falha']) {
|
|
8978
|
+
return Promise.reject(new PaymentError('Houve uma falha ao gerar o boleto. Tente novamente', {
|
|
8979
|
+
checkoutId: checkout.id,
|
|
8980
|
+
userEmail: checkout.user.email,
|
|
8981
|
+
info: data,
|
|
8982
|
+
}));
|
|
8983
|
+
}
|
|
8984
|
+
const paymentData = PagarMeV5ResponseHelper.build(checkout, data);
|
|
8985
|
+
const payment = await this.paymentRepository.create(paymentData);
|
|
8986
|
+
return payment;
|
|
8987
|
+
}
|
|
8988
|
+
catch (error) {
|
|
8989
|
+
console.warn(error.response?.data);
|
|
8990
|
+
console.warn(error.response?.data?.errors);
|
|
8991
|
+
console.warn(error.response?.data?.request);
|
|
8992
|
+
throw new PaymentError('Houve uma falha ao gerar o boleto. Tente novamente', {
|
|
8993
|
+
checkoutId: checkout.id,
|
|
8994
|
+
userEmail: checkout.user.email,
|
|
8995
|
+
info: error.response.data,
|
|
8996
|
+
});
|
|
8997
|
+
}
|
|
8998
|
+
}
|
|
8999
|
+
async getBoletoTransaction(paymentId) {
|
|
9000
|
+
try {
|
|
9001
|
+
const { data } = await axios({
|
|
9002
|
+
method: 'GET',
|
|
9003
|
+
url: `${this.credentials.URL}/charges/${paymentId}`,
|
|
9004
|
+
headers: {
|
|
9005
|
+
Authorization: 'Basic ' + Buffer.from(`${this.credentials.API_KEY}:`).toString('base64'),
|
|
9006
|
+
'Content-Type': 'application/json',
|
|
9007
|
+
},
|
|
9008
|
+
});
|
|
9009
|
+
const payment = await this.paymentRepository.get({
|
|
9010
|
+
id: +data.id,
|
|
9011
|
+
});
|
|
9012
|
+
return payment.transaction;
|
|
9013
|
+
}
|
|
9014
|
+
catch (error) {
|
|
9015
|
+
throw new BusinessError('Houve uma falha buscar o boleto com paymentId: ' + paymentId, {
|
|
9016
|
+
paymentId,
|
|
9017
|
+
info: error.response.data,
|
|
9018
|
+
});
|
|
9019
|
+
}
|
|
9020
|
+
}
|
|
9021
|
+
}
|
|
9022
|
+
|
|
9023
|
+
class PagarmeV5CardAxiosAdapter {
|
|
9024
|
+
constructor(credentials, paymentRepository, orderBlockedRepository) {
|
|
9025
|
+
this.credentials = credentials;
|
|
9026
|
+
this.paymentRepository = paymentRepository;
|
|
9027
|
+
this.orderBlockedRepository = orderBlockedRepository;
|
|
9028
|
+
}
|
|
9029
|
+
async pay(checkout, card) {
|
|
9030
|
+
try {
|
|
9031
|
+
const payload = PagarMeV5RequestHelper.build(checkout, 'credit_card', card);
|
|
9032
|
+
console.warn('[PAGARME CARD DATA TO SEND]', JSON.stringify(payload));
|
|
9033
|
+
const { data } = await axios({
|
|
9034
|
+
method: 'POST',
|
|
9035
|
+
url: `${this.credentials.URL}/orders`,
|
|
9036
|
+
headers: {
|
|
9037
|
+
Authorization: 'Basic ' + Buffer.from(`${this.credentials.API_KEY}:`).toString('base64'),
|
|
9038
|
+
'Content-Type': 'application/json',
|
|
9039
|
+
},
|
|
9040
|
+
data: payload,
|
|
9041
|
+
});
|
|
9042
|
+
console.warn('[RESPONSE PAGARME CARD DATA]', JSON.stringify(data));
|
|
9043
|
+
if (data.charges.at(0).status !== PagarMeV5PaymentStatus.Pago ||
|
|
9044
|
+
data.charges.at(0).status !== PagarMeV5PaymentStatus.Capturada) {
|
|
9045
|
+
await PagarmeBlockedOrderHelper.createBlockedOrderForUnauthorizedCard({
|
|
9046
|
+
checkout,
|
|
9047
|
+
card,
|
|
9048
|
+
orderBlockedRepository: this.orderBlockedRepository,
|
|
9049
|
+
});
|
|
9050
|
+
throw PagarmeBlockedOrderHelper.createPaymentError(checkout, data);
|
|
9051
|
+
}
|
|
9052
|
+
const paymentData = PagarMeV5ResponseHelper.build(checkout, data);
|
|
9053
|
+
const payment = await this.paymentRepository.create(paymentData);
|
|
9054
|
+
return payment;
|
|
9055
|
+
}
|
|
9056
|
+
catch (error) {
|
|
9057
|
+
if (error instanceof PaymentError) {
|
|
9058
|
+
throw error;
|
|
9059
|
+
}
|
|
9060
|
+
console.warn(error.response?.data);
|
|
9061
|
+
console.warn(error.response?.data?.errors);
|
|
9062
|
+
console.warn(error.response?.data?.request);
|
|
9063
|
+
throw PagarmeBlockedOrderHelper.createGenericPaymentError(checkout, error.response?.data);
|
|
9064
|
+
}
|
|
9065
|
+
}
|
|
9066
|
+
// Dúvidas: preciso criar um cliente? como faz na mens?
|
|
9067
|
+
async addCard(card) {
|
|
9068
|
+
try {
|
|
9069
|
+
const { data } = await axios({
|
|
9070
|
+
method: 'POST',
|
|
9071
|
+
url: `${this.credentials.URL}/cards`,
|
|
9072
|
+
data: {
|
|
9073
|
+
api_key: this.credentials.API_KEY,
|
|
9074
|
+
card_number: card.number,
|
|
9075
|
+
card_expiration_date: card.expirationDate.replace('/', ''),
|
|
9076
|
+
card_holder_name: card.name,
|
|
9077
|
+
card_cvv: card.cvv,
|
|
9078
|
+
// number: '4000000000000010',
|
|
9079
|
+
// holder_name: 'Tony Stark',
|
|
9080
|
+
// holder_document: '93095135270',
|
|
9081
|
+
// exp_month: 1,
|
|
9082
|
+
// exp_year: 30,
|
|
9083
|
+
// cvv: '351',
|
|
9084
|
+
// brand: 'Mastercard',
|
|
9085
|
+
// label: 'Sua bandeira',
|
|
9086
|
+
// billing_address: {
|
|
9087
|
+
// line_1: '375, Av. General Osorio, Centro',
|
|
9088
|
+
// line_2: '7º Andar',
|
|
9089
|
+
// zip_code: '220000111',
|
|
9090
|
+
// city: 'Rio de Janeiro',
|
|
9091
|
+
// state: 'RJ',
|
|
9092
|
+
// country: 'BR',
|
|
9093
|
+
// },
|
|
9094
|
+
// options: {
|
|
9095
|
+
// verify_card: true,
|
|
9096
|
+
// },
|
|
9097
|
+
},
|
|
9098
|
+
});
|
|
9099
|
+
return data;
|
|
9100
|
+
}
|
|
9101
|
+
catch (error) {
|
|
9102
|
+
throw new BusinessError('Houve uma falha adicionar o cartão', {
|
|
9103
|
+
info: error.response.data,
|
|
9104
|
+
});
|
|
9105
|
+
}
|
|
9106
|
+
}
|
|
9107
|
+
async createCardHash(bu) {
|
|
9108
|
+
const key = bu === BusinessUnitEnum.SHOP ? this.credentials.SHOP_API_KEY : this.credentials.SUBSCRIPTION_API_KEY;
|
|
9109
|
+
try {
|
|
9110
|
+
const { data } = await axios({
|
|
9111
|
+
method: 'GET',
|
|
9112
|
+
headers: {
|
|
9113
|
+
'content-type': 'application/json',
|
|
9114
|
+
},
|
|
9115
|
+
url: `${this.credentials.URL}/transactions/card_hash_key`,
|
|
9116
|
+
data: JSON.stringify({
|
|
9117
|
+
api_key: key,
|
|
9118
|
+
}),
|
|
9119
|
+
});
|
|
9120
|
+
return data;
|
|
9121
|
+
}
|
|
9122
|
+
catch (error) {
|
|
9123
|
+
throw new BusinessError('Houve uma falha gerar o hash', {
|
|
9124
|
+
info: error.response.data,
|
|
9125
|
+
});
|
|
9126
|
+
}
|
|
9127
|
+
}
|
|
9128
|
+
async getCardByToken(id) {
|
|
9129
|
+
try {
|
|
9130
|
+
const { data } = await axios({
|
|
9131
|
+
method: 'POST',
|
|
9132
|
+
url: `${this.credentials.URL}/cards/${id}`,
|
|
9133
|
+
data: {
|
|
9134
|
+
api_key: this.credentials.API_KEY,
|
|
9135
|
+
},
|
|
9136
|
+
});
|
|
9137
|
+
return data;
|
|
9138
|
+
}
|
|
9139
|
+
catch (error) {
|
|
9140
|
+
throw new BusinessError('Houve uma falha buscar o cartão com id: ' + id, {
|
|
9141
|
+
info: error.response.data,
|
|
9142
|
+
});
|
|
9143
|
+
}
|
|
9144
|
+
}
|
|
9145
|
+
async createTransaction(info) {
|
|
9146
|
+
try {
|
|
9147
|
+
const { data } = await axios({
|
|
9148
|
+
method: 'POST',
|
|
9149
|
+
url: `${this.credentials.URL}/transactions`,
|
|
9150
|
+
headers: {
|
|
9151
|
+
Authorization: 'Basic ' + Buffer.from(this.credentials.API_KEY).toString('base64'),
|
|
9152
|
+
'Content-Type': 'application/json',
|
|
9153
|
+
},
|
|
9154
|
+
data: {
|
|
9155
|
+
...info,
|
|
9156
|
+
api_key: this.credentials.API_KEY,
|
|
9157
|
+
},
|
|
9158
|
+
});
|
|
9159
|
+
return data;
|
|
9160
|
+
}
|
|
9161
|
+
catch (error) {
|
|
9162
|
+
throw new BusinessError('Houve uma falha ao criar a transação', {
|
|
9163
|
+
info: error.response.data,
|
|
9164
|
+
});
|
|
9165
|
+
}
|
|
9166
|
+
}
|
|
9167
|
+
}
|
|
9168
|
+
|
|
9169
|
+
class PagarmeV5PixAxiosAdapter {
|
|
9170
|
+
constructor(credentials, paymentRepository) {
|
|
9171
|
+
this.credentials = credentials;
|
|
9172
|
+
this.paymentRepository = paymentRepository;
|
|
9173
|
+
}
|
|
9174
|
+
async pay(checkout) {
|
|
9175
|
+
try {
|
|
9176
|
+
const payload = PagarMeV5RequestHelper.build(checkout, 'pix');
|
|
9177
|
+
console.warn('[PAGARME PIX DATA TO SEND]', JSON.stringify(payload));
|
|
9178
|
+
const { data } = await axios({
|
|
9179
|
+
method: 'POST',
|
|
9180
|
+
url: `${this.credentials.URL}/orders`,
|
|
9181
|
+
headers: {
|
|
9182
|
+
Authorization: 'Basic ' + Buffer.from(`${this.credentials.API_KEY}:`).toString('base64'),
|
|
9183
|
+
'Content-Type': 'application/json',
|
|
9184
|
+
},
|
|
9185
|
+
data: payload,
|
|
9186
|
+
});
|
|
9187
|
+
console.warn('[RESPONSE PAGARME PIX DATA]', JSON.stringify(data));
|
|
9188
|
+
const paymentData = PagarMeV5ResponseHelper.build(checkout, data);
|
|
9189
|
+
const payment = await this.paymentRepository.create(paymentData);
|
|
9190
|
+
return payment;
|
|
9191
|
+
}
|
|
9192
|
+
catch (error) {
|
|
9193
|
+
console.warn(error.response?.data);
|
|
9194
|
+
console.warn(error.response?.data?.errors);
|
|
9195
|
+
console.warn(error.response?.data?.request);
|
|
9196
|
+
throw new PaymentError('Houve uma falha ao processar pagamento com pix', {
|
|
9197
|
+
checkoutId: checkout.id,
|
|
9198
|
+
userEmail: checkout.user.email,
|
|
9199
|
+
info: error.response?.data,
|
|
9200
|
+
});
|
|
9201
|
+
}
|
|
9202
|
+
}
|
|
9203
|
+
}
|
|
9204
|
+
|
|
8758
9205
|
class VertexAxiosAdapter {
|
|
8759
9206
|
constructor(config) {
|
|
8760
9207
|
this.config = config;
|
|
@@ -8908,4 +9355,4 @@ class ProductsVertexSearch {
|
|
|
8908
9355
|
}
|
|
8909
9356
|
}
|
|
8910
9357
|
|
|
8911
|
-
export { AccessoryImportances, Address, AdyenCardAxiosAdapter, AdyenPaymentMethodFactory, AntifraudBankSlipService, AntifraudCardService, AntifraudGlampointsService, AntifraudPixService, AntifraudProviderFactory, AntifraudProviders, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, BrandEquityOptions, BusinessError, BusinessUnitEnum, Buy2Win, Buy2WinFirestoreRepository, Campaign, CampaignBanner, CampaignDashboard, CampaignDashboardFirestoreRepository, CampaignHashtag, CampaignHashtagFirestoreRepository, Category, CategoryCollectionChildren, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryFilter, CategoryFilterHasuraGraphQLRepository, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, CategoryProduct, CategoryProductHasuraGraphQLRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, ClassNameHelper, ConnectBaseDocumentSnapshot, ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, Coupon, CouponCategories, CouponCategory, CouponChannels, CouponFirestoreRepository, CouponOldCategories, CouponSubtypes, CouponTypes, Debug, DebugDecoratorHelper, DebugHelper, DebugNamespaces, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FirebaseFileUploaderService, FragranceImportances, FraudValidationError, GenderDestination, GlampointsPaymentMethodFactory, GlampointsPaymentService, Group, GroupFirestoreRepository, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, Log, LogDocument, LogFirestoreRepository, Logger, NotFoundError, ObsEmitter, OfficePosition, Order, OrderBlocked, OrderBlockedFirestoreRepository, OrderBlockedType, OrderFirestoreRepository, OrderStatus, PagarmeBankSlipAxiosAdapter, PagarmeCardAxiosAdapter, PagarmePaymentMethodFactory, PagarmePaymentStatus, PagarmePixAxiosAdapter, Payment, PaymentError, PaymentFirestoreRepository, PaymentMethods, PaymentProviderFactory, PaymentProviders, PaymentTransaction, PaymentType, PersonTypes, Plans, Product, ProductErrors, ProductErrorsHasuraGraphQL, ProductErrorsHasuraGraphQLRepository, ProductFirestoreRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductLabelEnum, ProductReview, ProductReviewHasuraGraphQLRepository, ProductSpents, ProductStockNotification, ProductStockNotificationHasuraGraphQLRepository, ProductVariantFirestoreRepository, ProductsIndex, ProductsVertexSearch, QuestionsFilters, RecoveryPassword, ReflectHelper, Register, RegisterFirebaseAuthService, RequiredArgumentError, RestCacheAdapter, RoundProductPricesHelper, Sequence, SequenceFirestoreRepository, ShippingMethod, ShopMenu, ShopMenuFirestoreRepository, ShopPageName, ShopSettings, ShopSettingsFirestoreRepository, Shops, SignInMethods, SignOut, Status, StockLimitError, StockOutError, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionMaterialization, SubscriptionMaterializationFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionSummary, SubscriptionSummaryFirestoreRepository, Trace, UnauthorizedError, UpdateOptionActions, UpdateUserImage, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserType, Variant, VariantHasuraGraphQL, VariantHasuraGraphQLRepository, VertexAxiosAdapter, WeakPasswordError, Where, Wishlist, WishlistHasuraGraphQLRepository, WishlistLogType, deserialize, getClass, is, isDebuggable, isUUID, parseDateTime, registerClass, resolveClass, serialize, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|
|
9358
|
+
export { AccessoryImportances, Address, AdyenCardAxiosAdapter, AdyenPaymentMethodFactory, AntifraudBankSlipService, AntifraudCardService, AntifraudGlampointsService, AntifraudPixService, AntifraudProviderFactory, AntifraudProviders, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, BrandEquityOptions, BusinessError, BusinessUnitEnum, Buy2Win, Buy2WinFirestoreRepository, Campaign, CampaignBanner, CampaignDashboard, CampaignDashboardFirestoreRepository, CampaignHashtag, CampaignHashtagFirestoreRepository, Category, CategoryCollectionChildren, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryFilter, CategoryFilterHasuraGraphQLRepository, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, CategoryProduct, CategoryProductHasuraGraphQLRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, ClassNameHelper, ConnectBaseDocumentSnapshot, ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, Coupon, CouponCategories, CouponCategory, CouponChannels, CouponFirestoreRepository, CouponOldCategories, CouponSubtypes, CouponTypes, Debug, DebugDecoratorHelper, DebugHelper, DebugNamespaces, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FirebaseFileUploaderService, FragranceImportances, FraudValidationError, GenderDestination, GlampointsPaymentMethodFactory, GlampointsPaymentService, Group, GroupFirestoreRepository, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, Log, LogDocument, LogFirestoreRepository, Logger, NotFoundError, ObsEmitter, OfficePosition, Order, OrderBlocked, OrderBlockedFirestoreRepository, OrderBlockedType, OrderFirestoreRepository, OrderStatus, PagarMeV5OrderStatus, PagarMeV5PaymentStatus, PagarmeBankSlipAxiosAdapter, PagarmeCardAxiosAdapter, PagarmePaymentMethodFactory, PagarmePaymentStatus, PagarmePixAxiosAdapter, PagarmeV5BankSlipAxiosAdapter, PagarmeV5CardAxiosAdapter, PagarmeV5PixAxiosAdapter, Payment, PaymentError, PaymentFirestoreRepository, PaymentMethods, PaymentProviderFactory, PaymentProviders, PaymentTransaction, PaymentType, PersonTypes, Plans, Product, ProductErrors, ProductErrorsHasuraGraphQL, ProductErrorsHasuraGraphQLRepository, ProductFirestoreRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductLabelEnum, ProductReview, ProductReviewHasuraGraphQLRepository, ProductSpents, ProductStockNotification, ProductStockNotificationHasuraGraphQLRepository, ProductVariantFirestoreRepository, ProductsIndex, ProductsVertexSearch, QuestionsFilters, RecoveryPassword, ReflectHelper, Register, RegisterFirebaseAuthService, RequiredArgumentError, RestCacheAdapter, RoundProductPricesHelper, Sequence, SequenceFirestoreRepository, ShippingMethod, ShopMenu, ShopMenuFirestoreRepository, ShopPageName, ShopSettings, ShopSettingsFirestoreRepository, Shops, SignInMethods, SignOut, Status, StockLimitError, StockOutError, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionMaterialization, SubscriptionMaterializationFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionSummary, SubscriptionSummaryFirestoreRepository, Trace, UnauthorizedError, UpdateOptionActions, UpdateUserImage, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserType, Variant, VariantHasuraGraphQL, VariantHasuraGraphQLRepository, VertexAxiosAdapter, WeakPasswordError, Where, Wishlist, WishlistHasuraGraphQLRepository, WishlistLogType, deserialize, getClass, is, isDebuggable, isUUID, parseDateTime, registerClass, resolveClass, serialize, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|
package/package.json
CHANGED
|
@@ -2,5 +2,6 @@ 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';
|
|
5
6
|
export * from './payment-methods.enum';
|
|
6
7
|
export * from './payment-providers.enum';
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
}
|
|
@@ -5,8 +5,10 @@ export declare class PaymentTransaction extends BaseModel<PaymentTransaction> {
|
|
|
5
5
|
object?: string;
|
|
6
6
|
status?: string;
|
|
7
7
|
tid?: number;
|
|
8
|
+
gateway_id?: string;
|
|
8
9
|
nsu?: number;
|
|
9
10
|
amount: number;
|
|
11
|
+
currency?: string;
|
|
10
12
|
cost: number;
|
|
11
13
|
installments?: number;
|
|
12
14
|
referer: string;
|
|
@@ -26,8 +28,12 @@ export declare class PaymentTransaction extends BaseModel<PaymentTransaction> {
|
|
|
26
28
|
refuse_reason?: string;
|
|
27
29
|
status_reason?: string;
|
|
28
30
|
acquirer_response_code?: string;
|
|
31
|
+
acquirer_auth_code?: string;
|
|
32
|
+
acquirer_return_code?: string;
|
|
29
33
|
acquirer_name?: string;
|
|
34
|
+
acquirer_message?: string;
|
|
30
35
|
acquirer_id?: string;
|
|
36
|
+
acquirer_nsu?: string;
|
|
31
37
|
authorization_code?: string;
|
|
32
38
|
soft_descriptor?: string;
|
|
33
39
|
date_created?: string;
|
|
@@ -36,6 +42,7 @@ export declare class PaymentTransaction extends BaseModel<PaymentTransaction> {
|
|
|
36
42
|
paid_amount?: number;
|
|
37
43
|
paid_at?: string;
|
|
38
44
|
refunded_amount?: number;
|
|
45
|
+
card_id?: string;
|
|
39
46
|
card_holder_name?: string;
|
|
40
47
|
card_last_digits?: string;
|
|
41
48
|
card_first_digits?: string;
|
|
@@ -48,8 +55,14 @@ export declare class PaymentTransaction extends BaseModel<PaymentTransaction> {
|
|
|
48
55
|
capture_method?: string;
|
|
49
56
|
antifraud_score?: string;
|
|
50
57
|
boleto_url?: string;
|
|
58
|
+
boleto_line?: string;
|
|
51
59
|
boleto_barcode?: string;
|
|
60
|
+
boleto_qr_code?: string;
|
|
52
61
|
boleto_expiration_date?: string;
|
|
62
|
+
boleto_instructions?: string;
|
|
63
|
+
boleto_nosso_numero?: string;
|
|
64
|
+
boleto_type?: string;
|
|
65
|
+
boleto_document_number?: string;
|
|
53
66
|
subscription_id?: string;
|
|
54
67
|
split_rules?: string;
|
|
55
68
|
antifraud_metadata?: any;
|
|
@@ -63,5 +76,6 @@ export declare class PaymentTransaction extends BaseModel<PaymentTransaction> {
|
|
|
63
76
|
receipt_url?: string;
|
|
64
77
|
private_label?: string;
|
|
65
78
|
pix_qr_code?: string;
|
|
79
|
+
pix_qr_code_url?: string;
|
|
66
80
|
pix_expiration_date?: string;
|
|
67
81
|
}
|
|
@@ -8,6 +8,7 @@ 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';
|
|
11
12
|
export * from './pagarme-credentials.type';
|
|
12
13
|
export * from './payment-card-info.type';
|
|
13
14
|
export * from './payment-method.type';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Checkout, PaymentCardInfo } from '../../../../domain';
|
|
2
|
+
import { PagarMeV5RequestPayload } from '../../types';
|
|
3
|
+
export declare class PagarMeV5RequestHelper {
|
|
4
|
+
static build(checkout: Checkout, type: '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
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Checkout, Payment } from '../../../../domain';
|
|
2
|
+
import { PagarMeV5Response } from '../../types';
|
|
3
|
+
export declare class PagarMeV5ResponseHelper {
|
|
4
|
+
static build(checkout: Checkout, response: PagarMeV5Response): Payment;
|
|
5
|
+
private static buildPaymentTransaction;
|
|
6
|
+
private static getBoletoReponse;
|
|
7
|
+
private static getPixReponse;
|
|
8
|
+
private static getCardReponse;
|
|
9
|
+
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './pagarme-pix-payment-axios.adapter';
|
|
1
|
+
export * from './v4';
|
|
2
|
+
export * from './v5';
|
|
@@ -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;
|