This commit is contained in:
2025-12-01 10:47:26 +03:30
parent d82c850fab
commit 1bc3ba8cdc
3 changed files with 6 additions and 4 deletions
@@ -17,7 +17,7 @@ export class PaymentGatewayService {
/**
* Generate payment gateway redirect URL for online payment methods
*/
generateRedirectUrl(order: Order, restaurantPaymentMethod: RestaurantPaymentMethod): Promise<PaymentGatewayRedirect> {
generateRedirectUrl(order: Order, restaurantPaymentMethod: RestaurantPaymentMethod): PaymentGatewayRedirect {
const paymentMethod = restaurantPaymentMethod.paymentMethod;
if (!paymentMethod.isOnline) {
@@ -56,7 +56,7 @@ export class PaymentGatewayService {
callbackUrl: string;
description: string;
},
) {
): string {
// Convert amount to smallest currency unit (e.g., Toman to Rials for Iranian gateways)
const amountInSmallestUnit = Math.round(params.amount * 10); // Assuming Toman to Rials conversion