-
-
Notifications
You must be signed in to change notification settings - Fork 27
add typescript declarations #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
export default class Paymongo { | ||
constructor(secret: any); | ||
secret: any; | ||
paymentMethods: { | ||
create: (data: any) => Promise<any>; | ||
retrieve: (id: any) => Promise<any>; | ||
}; | ||
paymentIntents: { | ||
create: (data: any) => Promise<any>; | ||
retrieve: (id: any) => Promise<any>; | ||
attach: (id: any, data: any) => Promise<any>; | ||
}; | ||
sources: { | ||
create: (data: any) => Promise<any>; | ||
retrieve: (id: any) => Promise<any>; | ||
}; | ||
payments: { | ||
create: (data: any) => Promise<any>; | ||
retrieve: (id: any) => Promise<any>; | ||
list: () => Promise<any>; | ||
}; | ||
tokens: { | ||
create: (data: any) => Promise<any>; | ||
retrieve: (id: any) => Promise<any>; | ||
}; | ||
webhooks: { | ||
create: (data: any) => Promise<any>; | ||
retrieve: (id: any) => Promise<any>; | ||
list: () => Promise<any>; | ||
toggle: (id: any, action: any) => Promise<any>; | ||
}; | ||
} |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./payment-intents"; | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export function createPaymentIntent(secret: string, data: { | ||
attributes: { | ||
amount: number; | ||
payment_method_allowed: string[]; | ||
currency: string; | ||
}; | ||
}): Promise<any>; | ||
export function retrievePaymentIntent(secret: string, id: string): Promise<any>; | ||
export function attachToPaymentIntent(secret: string, id: string, data: { | ||
attributes: { | ||
payment_method: string; | ||
}; | ||
}): Promise<any>; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./payment-methods"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use single quote |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export function createPaymentMethod(secret: string, data: { | ||
attributes: { | ||
type: string; | ||
}; | ||
}): Promise<any>; | ||
export function retrievePaymentMethod(secret: string, id: string): Promise<any>; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./payments"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use single quote |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export function createPayment(secret: string, data: { | ||
attributes: { | ||
amount: number; | ||
currency: number; | ||
source: { | ||
id: string; | ||
type: string; | ||
}; | ||
}; | ||
}): Promise<any>; | ||
export function retrievePayment(secret: string, id: string): Promise<any>; | ||
export function listPayments(secret: string): Promise<any>; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./sources"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use single quote |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export function createSource(secret: string, data: { | ||
attributes: { | ||
type: string; | ||
amount: number; | ||
currency: string; | ||
redirect: { | ||
success: string; | ||
failed: string; | ||
}; | ||
}; | ||
}): Promise<any>; | ||
export function retrieveSource(secret: string, id: string): Promise<any>; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./tokens"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use single quote |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export function createToken(secret: string, data: { | ||
attributes: { | ||
number: string; | ||
exp_month: number; | ||
exp_year: number; | ||
cvc: string; | ||
}; | ||
}): Promise<any>; | ||
export function retrieveToken(secret: string, id: string): Promise<any>; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export function makeRequest(opts: any): Promise<any>; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./webhooks"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use single quote |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export function createWebhook(secret: string, data: { | ||
attributes: { | ||
url: string; | ||
events: string[]; | ||
}; | ||
}): Promise<any>; | ||
export function retrieveWebhook(secret: string, id: string): Promise<any>; | ||
export function listWebhooks(secret: string): Promise<any>; | ||
export function toggleWebhook(secret: string, id: string, action: string): Promise<any>; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"include": ["src/**/*"], | ||
"compilerOptions": { | ||
// Tells TypeScript to read JS files, as | ||
// normally they are ignored as source files | ||
"allowJs": true, | ||
// Generate d.ts files | ||
"declaration": true, | ||
// This compiler run should | ||
// only output d.ts files | ||
"emitDeclarationOnly": true, | ||
// Types should go into this directory. | ||
// Removing this would place the .d.ts files | ||
// next to the .js files | ||
"outDir": "dist" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use single quote
'
instead of double quotes"
. Thanks.