@spot-flow/checkout-inline-js 0.0.1

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 ADDED
@@ -0,0 +1,51 @@
1
+
2
+ # Spotflow Checkout Inline
3
+
4
+ This project is an inline library that enables users to make payments seamlessly. It integrates smoothly into your application, providing a streamlined checkout experience.
5
+
6
+ ## Demo
7
+ <img width="808" alt="Screenshot 2024-07-26 at 16 05 52" src="https://github.com/user-attachments/assets/4dbb0b2e-2142-4f04-994a-5c352de7d30e">
8
+
9
+
10
+ ## Installation
11
+ ```sh
12
+ npm install @spotflow/inline-js-checkout
13
+ ```
14
+
15
+ ## Usage
16
+ ```sh
17
+ import SpotflowCheckout from @spotflow/inline-js-checkout;
18
+
19
+ const checkout = new SpotflowCheckout(
20
+ merchantKey = "<sk_test_f998479c0eedhXXXXXXXXXXXXXXXX>"// This is your Merchant Key generated for your Merchant on Spotflow
21
+ email = "email",
22
+ amount = 1000,
23
+ );
24
+ checkout.setup();
25
+ ```
26
+
27
+ Alternatively, you can include it directly in your HTML via a CDN:
28
+ ```sh
29
+ <script src="spotflow/cdn"></script>
30
+ ```
31
+
32
+ ```sh
33
+ <button onclick="openCheckout()">
34
+ Make Payment
35
+ </button>
36
+ ```
37
+ ```sh
38
+ <script>
39
+ const openCheckout = () => {
40
+ const checkout = new SpotflowCheckout(
41
+ merchantKey = "<sk_test_f998479c0eedhXXXXXXXXXXXXXXXX>"// This is your Merchant Key generated for your Merchant on Spotflow
42
+ email = "temi@mailinator.com",
43
+ amount = 1000,
44
+ );
45
+ checkout.setup();
46
+ };
47
+ </script>
48
+ ```
49
+
50
+
51
+
package/dist/api.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ import { CardPaymentRequestPayload, PaymentResponseData, AuthorizeCardPaymentRequestPayload, ValidateCardPaymentRequestPayload, PaymentRequestPayload } from './types/types';
2
+
3
+ export declare const createCardPayment: (token: string, payload: CardPaymentRequestPayload) => Promise<PaymentResponseData>;
4
+ export declare const authorizeCardPayment: (token: string, payload: AuthorizeCardPaymentRequestPayload) => Promise<PaymentResponseData>;
5
+ export declare const validateCardPayment: (token: string, payload: ValidateCardPaymentRequestPayload) => Promise<PaymentResponseData>;
6
+ export declare const createTransferPayment: (token: string, payload: PaymentRequestPayload) => Promise<PaymentResponseData>;
7
+ export declare const verifyPayment: (token: string, reference: string, signal?: AbortSignal) => Promise<PaymentResponseData>;