Add ZarinPal e-payment and related checkout/search fixes.
Business settings can store ZarinPal merchant credentials, and the payment registry can initiate and verify ZarinPal alongside Mellat. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
c76c3967bb
commit
b991a60cbc
@@ -58,8 +58,17 @@ export type MellatGatewaySettings = {
|
||||
password: string;
|
||||
};
|
||||
|
||||
/** ZarinPal merchant credentials. */
|
||||
export type ZarinpalGatewaySettings = {
|
||||
enabled: boolean;
|
||||
/** Merchant code from the ZarinPal panel. */
|
||||
merchantId: string;
|
||||
/** When true, use sandbox.zarinpal.com endpoints. */
|
||||
sandbox: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* Placeholder for gateways not yet wired (SEP, Snapp Pay, DigiPay, Zarinpal).
|
||||
* Placeholder for gateways not yet wired (SEP, Snapp Pay, DigiPay).
|
||||
* Credential fields are added when each adapter ships.
|
||||
*/
|
||||
export type StubGatewaySettings = {
|
||||
@@ -71,7 +80,7 @@ export type PaymentGatewaysSettings = {
|
||||
sep: StubGatewaySettings;
|
||||
snappay: StubGatewaySettings;
|
||||
digipay: StubGatewaySettings;
|
||||
zarinpal: StubGatewaySettings;
|
||||
zarinpal: ZarinpalGatewaySettings;
|
||||
};
|
||||
|
||||
/** Online e-payment (website checkout). */
|
||||
@@ -192,6 +201,12 @@ export const DEFAULT_STUB_GATEWAY_SETTINGS: StubGatewaySettings = {
|
||||
enabled: false,
|
||||
};
|
||||
|
||||
export const DEFAULT_ZARINPAL_GATEWAY_SETTINGS: ZarinpalGatewaySettings = {
|
||||
enabled: false,
|
||||
merchantId: '',
|
||||
sandbox: false,
|
||||
};
|
||||
|
||||
export const DEFAULT_EPAYMENT_SETTINGS: EPaymentSettings = {
|
||||
enabled: false,
|
||||
defaultGateway: null,
|
||||
@@ -200,7 +215,7 @@ export const DEFAULT_EPAYMENT_SETTINGS: EPaymentSettings = {
|
||||
sep: { ...DEFAULT_STUB_GATEWAY_SETTINGS },
|
||||
snappay: { ...DEFAULT_STUB_GATEWAY_SETTINGS },
|
||||
digipay: { ...DEFAULT_STUB_GATEWAY_SETTINGS },
|
||||
zarinpal: { ...DEFAULT_STUB_GATEWAY_SETTINGS },
|
||||
zarinpal: { ...DEFAULT_ZARINPAL_GATEWAY_SETTINGS },
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user