-
-
Save alizahid/ff3beec5e74c187ab06592778508295f to your computer and use it in GitHub Desktop.
Safepay Node SDK TypeScript types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module 'safepay' { | |
type Options = { | |
apiKey: string | |
apiSecret: string | |
baseUrl: string | |
} | |
type Config = { | |
environment: string | |
production: Options | |
sandbox: Options | |
} | |
type Payments = { | |
create: (options: { amount: number; currency: string }) => Promise<{ | |
data: { | |
data: { | |
amount: number | |
billing: string | |
client: string | |
conversion_rate: number | |
created_at: string | |
currency: string | |
default_currency: string | |
environment: string | |
state_reason: string | |
state: string | |
token: string | |
updated_at: string | |
user: string | |
} | |
status: { | |
message: string | |
} | |
} | |
}> | |
} | |
type Checkout = { | |
create: (options: { | |
cancelUrl: string | |
orderId: string | |
redirectUrl: string | |
source: string | |
tracker: string | |
}) => string | |
} | |
export default class Safepay { | |
constructor(config: Config) | |
static validateWebhookSignature( | |
tracker: string, | |
signature: string, | |
secret: string | |
): boolean | |
checkout: Checkout | |
payments: Payments | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment