mainstack-payments 2.0.8 → 2.1.9

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.
@@ -1,4 +1,4 @@
1
- import { d as e, e as t, S as n, M as y, f as P, P as m, g as o, h as r, W as u, c as i, b as c, i as l, j as d, k, u as C, a as M, l as h, m as F } from "./index-Di1ugn5_.js";
1
+ import { d as e, e as t, S as n, M as y, f as P, P as m, g as o, h as r, W as u, c as i, b as c, i as l, j as d, k, u as C, a as M, l as h, m as F } from "./index-Cw2Ampzx.js";
2
2
  export {
3
3
  e as CheckoutForm,
4
4
  t as ContactForm,
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ import { TContactFields } from '../types';
2
3
 
3
4
  interface IProps {
4
5
  title: string | ReactNode;
@@ -8,6 +9,7 @@ interface IProps {
8
9
  editEmail: boolean;
9
10
  customForm: ReactNode;
10
11
  proceedButton: ReactNode;
12
+ contactFields?: TContactFields;
11
13
  values: {
12
14
  fullname: string;
13
15
  email: string;
@@ -20,5 +22,5 @@ interface IProps {
20
22
  };
21
23
  setFieldValue: (name: string, value: any) => void;
22
24
  }
23
- declare const ContactForm: ({ showFullname, showEmail, showPhone, customForm, values, errors, setFieldValue, proceedButton, }: IProps) => import("react/jsx-runtime").JSX.Element;
25
+ declare const ContactForm: ({ showFullname, showEmail, showPhone, customForm, values, errors, setFieldValue, proceedButton, contactFields, }: IProps) => import("react/jsx-runtime").JSX.Element;
24
26
  export default ContactForm;
@@ -75,14 +75,23 @@ type TCustomizations = {
75
75
  isSingleColumn?: boolean;
76
76
  summaryWidth?: string;
77
77
  };
78
- type TCryptoPaymentConfig = {
78
+ type TContactFields = {
79
+ phoneNumberRequired: boolean;
80
+ };
81
+ type TWalletPaymentConfig = {
82
+ userAllowsCryptoPayment: boolean;
83
+ userAllowsWalletPayment: boolean;
84
+ walletRedirectUrl: string;
85
+ } | {
79
86
  userAllowsCryptoPayment: true;
80
- cryptoRedirectUrl: string;
87
+ userAllowsWalletPayment: true;
88
+ walletRedirectUrl: string;
81
89
  } | {
82
90
  userAllowsCryptoPayment: false;
83
- cryptoRedirectUrl?: string;
91
+ userAllowsWalletPayment: false;
92
+ walletRedirectUrl?: string;
84
93
  };
85
- type TPaymentConfig = TCryptoPaymentConfig & {
94
+ type TPaymentConfig = TWalletPaymentConfig & {
86
95
  currency: string;
87
96
  amount: number;
88
97
  metadata: TClientMetadata;
@@ -94,7 +103,6 @@ type TPaymentConfig = TCryptoPaymentConfig & {
94
103
  productBaseUrl: string;
95
104
  feeBaseUrl: string;
96
105
  accountId: string;
97
- userAllowsWalletPayment: boolean;
98
106
  userAllowsCardPayment: boolean;
99
107
  merchantBearsTax?: boolean;
100
108
  STRIPE_SECRET_KEY: string;
@@ -113,6 +121,7 @@ type TPaymentConfig = TCryptoPaymentConfig & {
113
121
  isPowerUser?: boolean;
114
122
  payment_plan_id?: string;
115
123
  amountDiscounted?: number;
124
+ contactFields?: TContactFields;
116
125
  };
117
126
  type TDiscount = {
118
127
  amount: number;
@@ -248,4 +257,4 @@ export interface IInitPaymentResponse {
248
257
  orderId: string;
249
258
  purchasedAt: string;
250
259
  }
251
- export type { TPaymentConfig, TMetadata, TClientMetadata, TAPIMetadata, TCustomizations, TPaymentOption, TPaymentModel, TDiscount, TItemList, TPaymentMode, TError, TDefaultFormValues, TPaymentMethods, };
260
+ export type { TPaymentConfig, TMetadata, TClientMetadata, TAPIMetadata, TCustomizations, TPaymentOption, TPaymentModel, TDiscount, TItemList, TPaymentMode, TError, TDefaultFormValues, TPaymentMethods, TContactFields, };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mainstack-payments",
3
3
  "type": "module",
4
- "version": "2.0.8",
4
+ "version": "2.1.9",
5
5
  "main": "build/mainstack-payments.js",
6
6
  "types": "build/src/index.d.ts",
7
7
  "style": "build/index.css",