up
This commit is contained in:
@@ -12,8 +12,8 @@ export class RestaurantPaymentMethodRepository extends EntityRepository<Restaura
|
||||
if (!restaurantPaymentMethod) {
|
||||
throw new NotFoundException('Restaurant payment method not found');
|
||||
}
|
||||
await restaurantPaymentMethod.restaurant.load();
|
||||
await restaurantPaymentMethod.paymentMethod.load();
|
||||
// await restaurantPaymentMethod.restaurant.load();
|
||||
// await restaurantPaymentMethod.paymentMethod.load();
|
||||
return restaurantPaymentMethod;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -102,6 +102,8 @@ export class DatabaseSeeder extends Seeder {
|
||||
description: 'درگاه پرداخت زرینپال',
|
||||
isActive: true,
|
||||
order: 1,
|
||||
isOnline: true,
|
||||
callbackUrl: 'https://www.zarinpal.com/pg/StartPay',
|
||||
});
|
||||
em.persist(paymentMethod);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user