remove logs, add readmy
This commit is contained in:
@@ -36,8 +36,6 @@ export async function makePaymentOperation(email: string, tariffId: number, oper
|
||||
}
|
||||
|
||||
export async function yooKasaCreatePayment(amount: number, tariff: number, operationType: 'TARIFF' | 'TOKEN') {
|
||||
console.log('yooKasaCreatePayment');
|
||||
console.log(`amount => ${amount}`);
|
||||
const userEmail = await getSessionData('email');
|
||||
const timestamp = Date.now();
|
||||
const random = Math.random().toString(36).substring(2, 10);
|
||||
@@ -47,10 +45,6 @@ export async function yooKasaCreatePayment(amount: number, tariff: number, opera
|
||||
return null;
|
||||
}
|
||||
|
||||
console.log(`converted amount => ${amount.toLocaleString()}`);
|
||||
console.log(`amount => ${amount.toLocaleString()}`);
|
||||
console.log(`amount => ${amount.toLocaleString().replace(/[,\s.]/g, '')}`);
|
||||
|
||||
const createPayload: ICreatePayment = {
|
||||
amount: {
|
||||
value: amount.toLocaleString().replace(/[,\s.]/g, ''),
|
||||
@@ -68,22 +62,17 @@ export async function yooKasaCreatePayment(amount: number, tariff: number, opera
|
||||
...(operationType === 'TOKEN' && {save_payment_method: false})
|
||||
};
|
||||
|
||||
console.log(createPayload);
|
||||
|
||||
try {
|
||||
const payment = await checkout.createPayment(createPayload, idempotenceKey);
|
||||
const response = await makePaymentOperation(userEmail, tariff, payment.id, operationType);
|
||||
console.log(payment);
|
||||
console.log('payment-------response');
|
||||
console.log(response);
|
||||
|
||||
if (payment && response) {
|
||||
return payment?.confirmation.confirmation_token;
|
||||
} else {
|
||||
return null
|
||||
return null;
|
||||
}
|
||||
} catch (error) {
|
||||
return null
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user