zarin url

This commit is contained in:
2026-02-24 15:05:42 +03:30
parent a95a8c2d87
commit c8e65d48be
@@ -19,9 +19,9 @@ export class ZarinpalGateway implements IPaymentGateway {
private readonly logger = new Logger(ZarinpalGateway.name); private readonly logger = new Logger(ZarinpalGateway.name);
private readonly zarinpalRequestUrl: string; private readonly zarinpalRequestUrl: string;
private readonly zarinpalVerifyUrl: string; private readonly zarinpalVerifyUrl: string;
private readonly zarinpalPaymentBaseUrl: string; private readonly zarinpalBaseUrl: string;
private readonly zarinpalMerchantId: string; private readonly zarinpalMerchantId: string;
private readonly apiUrl: string = 'https://negareh-api.dev.danakcorp.com/' private readonly apiUrl: string
private readonly axiosConfig = { private readonly axiosConfig = {
timeout: 10_000, timeout: 10_000,
headers: { headers: {
@@ -30,9 +30,9 @@ export class ZarinpalGateway implements IPaymentGateway {
}; };
constructor(private readonly configService: ConfigService) { constructor(private readonly configService: ConfigService) {
const zarinpalBaseUrl = this.configService.get<string>('ZARINPAL_BASE_URL') || 'https://sandbox.zarinpal.com'; this.zarinpalBaseUrl = this.configService.get<string>('ZARINPAL_BASE_URL') || 'https://sandbox.zarinpal.com';
this.zarinpalRequestUrl = `${zarinpalBaseUrl}/pg/v4/payment/request.json`; this.zarinpalRequestUrl = `${this.zarinpalBaseUrl}/pg/v4/payment/request.json`;
this.zarinpalVerifyUrl = `${zarinpalBaseUrl}/pg/v4/payment/verify.json`; this.zarinpalVerifyUrl = `${this.zarinpalBaseUrl}/pg/v4/payment/verify.json`;
this.zarinpalMerchantId = this.configService.getOrThrow<string>('ZARINPAL_BASE_MERCHANT') this.zarinpalMerchantId = this.configService.getOrThrow<string>('ZARINPAL_BASE_MERCHANT')
this.apiUrl = this.configService.get<string>('API_URL') || 'https://negareh-api.dev.danakcorp.com/' this.apiUrl = this.configService.get<string>('API_URL') || 'https://negareh-api.dev.danakcorp.com/'
} }
@@ -87,7 +87,7 @@ export class ZarinpalGateway implements IPaymentGateway {
throw new BadRequestException(message ?? PaymentMessage.ZARINPAL_PAYMENT_REQUEST_ERROR); throw new BadRequestException(message ?? PaymentMessage.ZARINPAL_PAYMENT_REQUEST_ERROR);
} }
const paymentUrl = `${this.zarinpalPaymentBaseUrl}/pg/StartPay/${authority}` const paymentUrl = `${this.zarinpalBaseUrl}/pg/StartPay/${authority}`
return { token: authority, paymentUrl }; return { token: authority, paymentUrl };
} catch (error) { } catch (error) {