paystack-inline-ts
Advanced tools
Comparing version
import { PaymentRequestOptions, PopupTransaction, ResumeTransactionOptions, TransactionOptions } from "./types"; | ||
interface PaystackPopClass { | ||
interface PaystackPopInterface { | ||
isLoaded: () => boolean; | ||
@@ -11,4 +11,7 @@ newTransaction: (options: TransactionOptions) => PopupTransaction; | ||
} | ||
export interface PaystackPopConstructor { | ||
new (): PaystackPopInterface; | ||
} | ||
export { PaymentRequestOptions, PopupTransaction, ResumeTransactionOptions, TransactionOptions, }; | ||
declare const _default: PaystackPopClass; | ||
declare const _default: PaystackPopConstructor; | ||
export default _default; |
@@ -1,2 +0,29 @@ | ||
import { PaystackPop } from "./paystack"; | ||
import { PaystackPop as OriginalPaystackPop } from "./paystack"; | ||
var PaystackPop = /** @class */ (function () { | ||
function PaystackPop() { | ||
this.pop = OriginalPaystackPop; | ||
} | ||
PaystackPop.prototype.isLoaded = function () { | ||
return this.pop.isLoaded(); | ||
}; | ||
PaystackPop.prototype.newTransaction = function (options) { | ||
return this.pop.newTransaction(options); | ||
}; | ||
PaystackPop.prototype.resumeTransaction = function (options) { | ||
return this.pop.resumeTransaction(options); | ||
}; | ||
PaystackPop.prototype.cancelTransaction = function (idOrTransaction) { | ||
return this.pop.cancelTransaction(idOrTransaction); | ||
}; | ||
PaystackPop.prototype.preloadTransaction = function (options) { | ||
return this.pop.preloadTransaction(options); | ||
}; | ||
PaystackPop.prototype.checkout = function (options) { | ||
return this.pop.checkout(options); | ||
}; | ||
PaystackPop.prototype.paymentRequest = function (options) { | ||
return this.pop.paymentRequest(options); | ||
}; | ||
return PaystackPop; | ||
}()); | ||
export default PaystackPop; |
{ | ||
"name": "paystack-inline-ts", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A simple typescript of the existing @paystack/inline-js", | ||
@@ -14,3 +14,4 @@ "main": "dist/index.js", | ||
"npm", | ||
"package" | ||
"package", | ||
"paystack" | ||
], | ||
@@ -17,0 +18,0 @@ "author": "Adefemi Oseni", |
@@ -1,2 +0,2 @@ | ||
import { PaystackPop } from "./paystack"; | ||
import { PaystackPop as OriginalPaystackPop } from "./paystack"; | ||
import { | ||
@@ -9,3 +9,3 @@ PaymentRequestOptions, | ||
interface PaystackPopClass { | ||
interface PaystackPopInterface { | ||
isLoaded: () => boolean; | ||
@@ -20,2 +20,42 @@ newTransaction: (options: TransactionOptions) => PopupTransaction; | ||
export interface PaystackPopConstructor { | ||
new (): PaystackPopInterface; | ||
} | ||
class PaystackPop implements PaystackPopInterface { | ||
private pop: any; | ||
constructor() { | ||
this.pop = OriginalPaystackPop; | ||
} | ||
isLoaded(): boolean { | ||
return this.pop.isLoaded(); | ||
} | ||
newTransaction(options: TransactionOptions): PopupTransaction { | ||
return this.pop.newTransaction(options); | ||
} | ||
resumeTransaction(options: ResumeTransactionOptions): PopupTransaction { | ||
return this.pop.resumeTransaction(options); | ||
} | ||
cancelTransaction(idOrTransaction: string | PopupTransaction): void { | ||
return this.pop.cancelTransaction(idOrTransaction); | ||
} | ||
preloadTransaction(options: TransactionOptions): () => void { | ||
return this.pop.preloadTransaction(options); | ||
} | ||
checkout(options: TransactionOptions): Promise<PopupTransaction> { | ||
return this.pop.checkout(options); | ||
} | ||
paymentRequest(options: PaymentRequestOptions): Promise<PopupTransaction> { | ||
return this.pop.paymentRequest(options); | ||
} | ||
} | ||
export { | ||
@@ -28,2 +68,2 @@ PaymentRequestOptions, | ||
export default PaystackPop as PaystackPopClass; | ||
export default PaystackPop as PaystackPopConstructor; |
10221
26.76%270
28.57%