Skip to content

Commit

Permalink
Added currency comment to APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
alitnk committed Oct 15, 2021
1 parent 9b9e47c commit 4951c31
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/drivers.ts
Expand Up @@ -23,27 +23,29 @@ export { Zibal } from './drivers/zibal';
interface ConfigMap {
idpay: IdPayAPI.Config;
nextpay: NextPayAPI.Config;
payir: PayirAPI.Config;
sadad: SadadAPI.Config;
saman: SamanAPI.Config;
zarinpal: ZarinpalAPI.Config;
zibal: ZibalAPI.Config;
payir: PayirAPI.Config;
}

export type ConfigObject = Partial<ConfigMap>;

export type DriverName = keyof ConfigMap;

const drivers = {
idpay: IdPay,
nextpay: NextPay,
payir: Payir,
sadad: Sadad,
saman: Saman,
zarinpal: Zarinpal,
zibal: Zibal,
payir: Payir,
};

export const getPaymentDriver = <Driver extends BaseDriver>(
driverName: keyof ConfigMap,
driverName: DriverName,
config: Parameters<Driver['setConfig']>[0]
): Driver => {
if (!drivers[driverName]) {
Expand Down
1 change: 1 addition & 0 deletions src/drivers/idpay/api.ts
Expand Up @@ -3,6 +3,7 @@ import { BaseReceipt, ErrorList, LinksObject, tBaseRequestOptions, tBaseVerifyOp

/*
* IDPay's API
* Currency: IRR
*/

export const links: LinksObject = {
Expand Down
1 change: 1 addition & 0 deletions src/drivers/nextpay/api.ts
Expand Up @@ -3,6 +3,7 @@ import { BaseReceipt, ErrorList, LinksObject, tBaseRequestOptions, tBaseVerifyOp

/*
* Zarinpal's API
* Currency: IRT
*/

export const links: LinksObject = {
Expand Down
1 change: 1 addition & 0 deletions src/drivers/payir/api.ts
Expand Up @@ -3,6 +3,7 @@ import { BaseReceipt, ErrorList, LinksObject, tBaseRequestOptions, tBaseVerifyOp

/*
* Payir's API
* Currency: IRR
*/

export const links: LinksObject = {
Expand Down
1 change: 1 addition & 0 deletions src/drivers/sadad/api.ts
Expand Up @@ -3,6 +3,7 @@ import { BaseReceipt, ErrorList, LinksObject, tBaseRequestOptions, tBaseVerifyOp

/*
* Sadad's API
* Currency: IRR
* link: https://sadadpsp.ir/file/attach/202002/654.pdf
*/

Expand Down
1 change: 1 addition & 0 deletions src/drivers/saman/api.ts
Expand Up @@ -3,6 +3,7 @@ import { BaseReceipt, ErrorList, LinksObject, tBaseRequestOptions, tBaseVerifyOp

/*
* Saman's API
* Currency: IRR
*/

export const links: LinksObject = {
Expand Down
1 change: 1 addition & 0 deletions src/drivers/zarinpal/api.ts
Expand Up @@ -3,6 +3,7 @@ import { BaseReceipt, ErrorList, LinksObject, tBaseRequestOptions, tBaseVerifyOp

/*
* Zarinpal's API
* Currency: IRR
*/

export const links: LinksObject = {
Expand Down
1 change: 1 addition & 0 deletions src/drivers/zibal/api.ts
Expand Up @@ -3,6 +3,7 @@ import { BaseReceipt, ErrorList, LinksObject, tBaseRequestOptions, tBaseVerifyOp

/*
* Zibal's API
* Currency: IRR
*/

export const links: LinksObject = {
Expand Down

0 comments on commit 4951c31

Please sign in to comment.