mainstack-payments 0.5.19 → 0.5.21

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.
@@ -22,6 +22,7 @@ interface IInitPayment {
22
22
  reference: string;
23
23
  currency: string;
24
24
  metadata: TMetadata;
25
+ is_crypto_payment?: boolean;
25
26
  }
26
27
  export declare const useInitPayment: (Request: any) => {
27
28
  data: any;
@@ -45,6 +46,21 @@ export declare const useChargePayment: (Request: any) => {
45
46
  onError: (error: any) => void;
46
47
  }) => Promise<any>;
47
48
  };
49
+ interface IIntentPayment {
50
+ amount: number;
51
+ currency: string;
52
+ payment_method_id?: string;
53
+ metadata: TMetadata;
54
+ is_crypto_payment?: boolean;
55
+ }
56
+ export declare const useIntentPayment: (Request: any) => {
57
+ data: any;
58
+ isLoading: boolean;
59
+ mutate: (dataParams: IIntentPayment, { onSuccess, onError, }: {
60
+ onSuccess: (data: any) => void;
61
+ onError: (error: any) => void;
62
+ }) => Promise<any>;
63
+ };
48
64
  export declare const useVerifyPayment: (reference: string, Request: any) => {
49
65
  data: any;
50
66
  isLoading: boolean;
@@ -0,0 +1,11 @@
1
+ /** @format */
2
+ interface CryptoPaymentsProps {
3
+ Request: any;
4
+ metadata: any;
5
+ amount: number;
6
+ currency: string;
7
+ redirectUrl: string;
8
+ checkForErrors: () => Promise<boolean>;
9
+ }
10
+ declare const CryptoPayments: ({ Request, metadata, amount, currency, redirectUrl, checkForErrors, }: CryptoPaymentsProps) => import("react/jsx-runtime").JSX.Element;
11
+ export default CryptoPayments;
@@ -1,5 +1,5 @@
1
1
  /** @format */
2
- type TPaymentOption = "wallet" | "startbutton" | "stripe" | "paystack";
2
+ type TPaymentOption = "wallet" | "startbutton" | "stripe" | "paystack" | "crypto";
3
3
  type TPaymentModel = "ips" | "default";
4
4
  type TMetadata = {
5
5
  reference?: string;
@@ -26,7 +26,14 @@ type TCustomizations = {
26
26
  padding?: string;
27
27
  isSingleColumn?: boolean;
28
28
  };
29
- type TPaymentConfig = {
29
+ type TCryptoPaymentConfig = {
30
+ userAllowsCryptoPayment: true;
31
+ cryptoRedirectUrl: string;
32
+ } | {
33
+ userAllowsCryptoPayment: false;
34
+ cryptoRedirectUrl?: string;
35
+ };
36
+ type TPaymentConfig = TCryptoPaymentConfig & {
30
37
  currency: string;
31
38
  amount: number;
32
39
  discountAmount?: number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mainstack-payments",
3
3
  "type": "module",
4
- "version": "0.5.19",
4
+ "version": "0.5.21",
5
5
  "main": "build/mainstack-payments.js",
6
6
  "types": "build/src/index.d.ts",
7
7
  "files": [