@spot-flow/checkout-inline-js 0.0.6 → 0.1.14

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 CHANGED
@@ -3,13 +3,20 @@
3
3
 
4
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
5
 
6
+ For React components and usage, [link](https://github.com/Spotflow-One/react-spotflow-checkout)
7
+
8
+ For Vue.js components and usage, [link](https://github.com/Spotflow-One/vue-spotflow-checkout)
9
+
10
+ For Angular components and usage, [link](https://github.com/Spotflow-One/angular-spotflow-checkout)
11
+
12
+
6
13
  ## Demo
7
14
  <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
15
 
9
16
 
10
17
  ## Installation
11
18
  ```sh
12
- npm install @spotflow/inline-js-checkout
19
+ npm install @spot-flow/checkout-inline-js
13
20
  ```
14
21
 
15
22
  ## Usage
@@ -80,4 +87,4 @@ To build the project, run:
80
87
  npm run build
81
88
  ```
82
89
 
83
- This will compile the source files and generate the output in the `dist` directory.
90
+ This will compile the source files and generate the output in the `dist` directory.
package/dist/api.d.ts CHANGED
@@ -1,7 +1,9 @@
1
- import { CardPaymentRequestPayload, PaymentResponseData, AuthorizeCardPaymentRequestPayload, ValidateCardPaymentRequestPayload, PaymentRequestPayload } from './types/types';
1
+ import { CardPaymentRequestPayload, PaymentResponseData, AuthorizeCardPaymentRequestPayload, ValidateCardPaymentRequestPayload, PaymentRequestPayload, GetPaymentRateParams, Rate, GetMerchantPlanDetail } from './types/types';
2
2
 
3
3
  export declare const createCardPayment: (token: string, payload: CardPaymentRequestPayload) => Promise<PaymentResponseData>;
4
4
  export declare const authorizeCardPayment: (token: string, payload: AuthorizeCardPaymentRequestPayload) => Promise<PaymentResponseData>;
5
5
  export declare const validateCardPayment: (token: string, payload: ValidateCardPaymentRequestPayload) => Promise<PaymentResponseData>;
6
6
  export declare const createTransferPayment: (token: string, payload: PaymentRequestPayload) => Promise<PaymentResponseData>;
7
7
  export declare const verifyPayment: (token: string, reference: string, signal?: AbortSignal) => Promise<PaymentResponseData>;
8
+ export declare function getRate(token: string, payload: GetPaymentRateParams): Promise<Rate>;
9
+ export declare function getCheckoutConfiguration(secret: string, planId: string): Promise<GetMerchantPlanDetail>;
@@ -1,30 +1,27 @@
1
- import { default as Card } from './modules/Card';
2
- import { default as Transfer } from './modules/Transfer';
3
- import { default as Ussd } from './modules/Ussd';
1
+ import { MainPageScreen } from './views/shared/main-page';
2
+ import { SharedErrorScreen } from './views/shared/shared-error-page';
3
+ import { PageLoader } from './views/shared/page-loader';
4
4
 
5
5
  declare class CheckoutForm {
6
6
  modalContainer: HTMLDivElement;
7
7
  currentPaymentMethod: number;
8
8
  currentStep: number;
9
+ mainLayout: HTMLDivElement;
10
+ encryption: string;
9
11
  container: HTMLDivElement;
10
- card: Card;
11
- transfer: Transfer;
12
- ussd: Ussd;
12
+ mainScreen: MainPageScreen;
13
+ mainError: SharedErrorScreen;
14
+ mainLoader: PageLoader;
15
+ private merchantPlanDetail;
13
16
  merchantKey: string;
17
+ planId: string;
14
18
  email: string;
15
19
  amount: number;
16
20
  isMobile: boolean;
17
- constructor(merchantKey: string, email: string, amount: number);
18
- attachInputListeners(): void;
19
- displayTabLayout(): void;
20
- private updatePaymentMethodView;
21
- renderPaymentMethodContent(): void | "";
22
- setCurrentPaymentMethod(index: number): void;
23
- private cleanup;
24
- closeModal(): void;
21
+ constructor(merchantKey: string, encryption: string, email: string, amount: number, planId: string);
22
+ closeBTN(): void;
25
23
  setup(): void;
26
- private mobileContainerContent;
27
- private viewMobileOptions;
28
- private displayPaymentWarningText;
24
+ private getPlanDetails;
25
+ closeModal(): void;
29
26
  }
30
27
  export { CheckoutForm };