remove logs, add readmy
This commit is contained in:
@@ -34,3 +34,7 @@ docker network inspect no-copy_app-network
|
|||||||
|
|
||||||
docker volume ls - посмотреть все базы данных
|
docker volume ls - посмотреть все базы данных
|
||||||
docker volume prune - удалить неиспользуемые базы данных
|
docker volume prune - удалить неиспользуемые базы данных
|
||||||
|
|
||||||
|
Юкаса
|
||||||
|
эндпоинт для бека.
|
||||||
|
{URL}/api/payments/webhook/yookassa
|
||||||
@@ -36,8 +36,6 @@ export async function makePaymentOperation(email: string, tariffId: number, oper
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function yooKasaCreatePayment(amount: number, tariff: number, operationType: 'TARIFF' | 'TOKEN') {
|
export async function yooKasaCreatePayment(amount: number, tariff: number, operationType: 'TARIFF' | 'TOKEN') {
|
||||||
console.log('yooKasaCreatePayment');
|
|
||||||
console.log(`amount => ${amount}`);
|
|
||||||
const userEmail = await getSessionData('email');
|
const userEmail = await getSessionData('email');
|
||||||
const timestamp = Date.now();
|
const timestamp = Date.now();
|
||||||
const random = Math.random().toString(36).substring(2, 10);
|
const random = Math.random().toString(36).substring(2, 10);
|
||||||
@@ -47,10 +45,6 @@ export async function yooKasaCreatePayment(amount: number, tariff: number, opera
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`converted amount => ${amount.toLocaleString()}`);
|
|
||||||
console.log(`amount => ${amount.toLocaleString()}`);
|
|
||||||
console.log(`amount => ${amount.toLocaleString().replace(/[,\s.]/g, '')}`);
|
|
||||||
|
|
||||||
const createPayload: ICreatePayment = {
|
const createPayload: ICreatePayment = {
|
||||||
amount: {
|
amount: {
|
||||||
value: amount.toLocaleString().replace(/[,\s.]/g, ''),
|
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})
|
...(operationType === 'TOKEN' && {save_payment_method: false})
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log(createPayload);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const payment = await checkout.createPayment(createPayload, idempotenceKey);
|
const payment = await checkout.createPayment(createPayload, idempotenceKey);
|
||||||
const response = await makePaymentOperation(userEmail, tariff, payment.id, operationType);
|
const response = await makePaymentOperation(userEmail, tariff, payment.id, operationType);
|
||||||
console.log(payment);
|
|
||||||
console.log('payment-------response');
|
|
||||||
console.log(response);
|
|
||||||
|
|
||||||
if (payment && response) {
|
if (payment && response) {
|
||||||
return payment?.confirmation.confirmation_token;
|
return payment?.confirmation.confirmation_token;
|
||||||
} else {
|
} else {
|
||||||
return null
|
return null;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return null
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user