@motopays/pay-form 2.2.0-rc.1 → 2.2.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -1
- package/index.d.ts +7 -0
- package/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,12 +26,22 @@ yarn add @motopays/pay-form
|
|
|
26
26
|
</body>
|
|
27
27
|
<script src="motopays/pay-form/index.js" type="text/javascript"></script>
|
|
28
28
|
<script type="text/javascript">
|
|
29
|
+
async function createInvoice(request) {
|
|
30
|
+
//create invoice
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async function makePayment(request) {
|
|
34
|
+
//make payment
|
|
35
|
+
}
|
|
36
|
+
|
|
29
37
|
const targetElement = document.getElementById("moto-payment-form");
|
|
30
38
|
const paymentFormElement = document.createElement("moto-payment-form");
|
|
31
39
|
paymentFormElement.id = "moto-payment-form";
|
|
32
40
|
|
|
33
41
|
paymentFormElement.payment = {...};
|
|
34
42
|
paymentFormElement.settings = {...};
|
|
43
|
+
paymentFormElement.createInvoice = createInvoice;
|
|
44
|
+
paymentFormElement.makePayment = makePayment;
|
|
35
45
|
|
|
36
46
|
paymentFormElement.addEventListener("close", (event) => {
|
|
37
47
|
console.log(event);
|
|
@@ -150,7 +160,7 @@ export class AppComponent {
|
|
|
150
160
|
this.makePayment = this.makePayment.bind(this);
|
|
151
161
|
}
|
|
152
162
|
|
|
153
|
-
protected createInvoice(request: IPaymentRequest): Promise<IPaymentRequest> {
|
|
163
|
+
protected createInvoice(request: IPaymentRequest): Promise<IPaymentRequest | IInvoiceRequest> {
|
|
154
164
|
//create invoice
|
|
155
165
|
}
|
|
156
166
|
|
package/index.d.ts
CHANGED
|
@@ -303,6 +303,13 @@ export interface IPaymentRequest {
|
|
|
303
303
|
signature?: string;
|
|
304
304
|
rejectionPreferences: IRejectionPreferences;
|
|
305
305
|
}
|
|
306
|
+
export interface IInvoiceRequest {
|
|
307
|
+
invoice: string;
|
|
308
|
+
ei?: 1 | 2;
|
|
309
|
+
es?: {
|
|
310
|
+
uo?: boolean;
|
|
311
|
+
};
|
|
312
|
+
}
|
|
306
313
|
declare class ServiceAction<Type extends string, Payload = unknown | undefined> {
|
|
307
314
|
type: Type;
|
|
308
315
|
payload?: Payload | undefined;
|