Skip to content

Commit

Permalink
fix: make description field required in zarinpal
Browse files Browse the repository at this point in the history
Due to zarinpal documentation, `description` is required to make a
payment request
  • Loading branch information
Keivan-sf committed Jul 29, 2023
1 parent 210474a commit daefe62
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/drivers/zarinpal/api.ts
Expand Up @@ -33,7 +33,7 @@ export interface RequestPaymentReq {
/**
* توضیحات مربوط به تراکنش
*/
description?: string;
description: string;

/**
* صفحه بازگشت مشتري، پس از انجام عمل پرداخت
Expand Down Expand Up @@ -157,7 +157,11 @@ export const tConfig = t.intersection([

export type Config = t.TypeOf<typeof tConfig>;

export const tRequestOptions = t.intersection([t.partial({ mobile: t.string, email: t.string }), tBaseRequestOptions]);
export const tRequestOptions = t.intersection([
t.partial({ mobile: t.string, email: t.string }),
t.type({ description: t.string }),
tBaseRequestOptions,
]);

export type RequestOptions = t.TypeOf<typeof tRequestOptions>;

Expand Down

0 comments on commit daefe62

Please sign in to comment.