mainstack-payments 1.0.56 → 1.0.58

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 o, e as y, S as P, M as i, c, f as u, g as p, P as k, W as l, l as d, j as M, i as C, a as F, b as f, h, k as g } from "./index-9f474fd2.js";
1
+ import { d as o, e as y, S as P, M as i, c, f as u, g as p, P as k, W as l, l as d, j as M, i as C, a as F, b as f, h, k as g } from "./index-b2bd5651.js";
2
2
  import "react/jsx-runtime";
3
3
  import "mainstack-design-system";
4
4
  import "react";
@@ -4,7 +4,6 @@ declare const CheckoutDetailsForm: ({ currency, amount, metadata, formik, isFree
4
4
  currency: string;
5
5
  amount: number;
6
6
  metadata?: any;
7
- discount_code?: string | undefined;
8
7
  formik: any;
9
8
  isFree: boolean;
10
9
  showPayment: boolean;
@@ -2,9 +2,7 @@ import { TCustomizations } from 'types';
2
2
 
3
3
  interface ContactActionProps {
4
4
  customizations?: TCustomizations;
5
- discount?: {
6
- isFullDiscount: boolean;
7
- };
5
+ discount?: number;
8
6
  onGoBack?: () => void;
9
7
  handlePaymentProceed: (e: React.MouseEvent) => void;
10
8
  feesLoading: boolean;
@@ -20,6 +20,7 @@ export interface IMainstackPaymentProps {
20
20
  onError?: (error: TError) => void;
21
21
  hasApiKey?: boolean;
22
22
  FooterElement?: ReactNode;
23
+ DiscountComponent?: ReactNode;
23
24
  }
24
25
  declare const MainstackPayment: import('react').ForwardRefExoticComponent<IMainstackPaymentProps & import('react').RefAttributes<unknown>>;
25
26
  export default MainstackPayment;
@@ -1,32 +1,12 @@
1
1
  import { ReactNode } from 'react';
2
- import { TDiscount, TItemList } from 'types';
2
+ import { TItemList } from 'types';
3
3
 
4
- type TDiscountProps = {
5
- discount: TDiscount;
6
- setDiscount: React.Dispatch<React.SetStateAction<TDiscount>>;
7
- hasDiscountCode: true;
8
- discountCode: string;
9
- setDiscountCode: React.Dispatch<React.SetStateAction<string>>;
10
- applyDiscount: () => Promise<any>;
11
- onDiscountApplied: (res: any) => void;
12
- onDiscountRemoved?: () => void;
13
- isApplyingDiscount: boolean;
14
- } | {
15
- discount?: TDiscount;
16
- setDiscount?: React.Dispatch<React.SetStateAction<TDiscount>>;
17
- hasDiscountCode?: false;
18
- discountCode?: string;
19
- setDiscountCode?: React.Dispatch<React.SetStateAction<string>>;
20
- applyDiscount?: () => Promise<any>;
21
- onDiscountApplied?: (res: any) => void;
22
- onDiscountRemoved?: () => void;
23
- isApplyingDiscount?: boolean;
24
- };
25
- type IProps = TDiscountProps & {
4
+ type IProps = {
26
5
  summaryTitle: string | ReactNode;
27
6
  currency: string;
28
7
  amount: number;
29
8
  feesLoading: boolean;
9
+ isFullDiscount: boolean;
30
10
  taxFees: {
31
11
  localTaxFees: number;
32
12
  shouldApplyTax?: boolean;
@@ -54,6 +34,7 @@ type IProps = TDiscountProps & {
54
34
  quantity: number;
55
35
  summaryWidth?: string;
56
36
  summaryGridWidth?: number;
37
+ children?: React.ReactNode;
57
38
  };
58
- declare const SummaryCard: ({ summaryTitle, currency, amount, feesLoading, discount, setDiscount, hasDiscountCode, discountCode, setDiscountCode, applyDiscount, isApplyingDiscount, onDiscountApplied, onDiscountRemoved, taxFees, switchingFees, transactionFees, isSingleColumn, itemsList, productImage, productName, quantity, summaryWidth, summaryGridWidth, }: IProps) => import("react/jsx-runtime").JSX.Element;
39
+ declare const SummaryCard: ({ summaryTitle, currency, amount, feesLoading, isFullDiscount, taxFees, switchingFees, transactionFees, isSingleColumn, itemsList, productImage, productName, quantity, summaryWidth, summaryGridWidth, children, }: IProps) => import("react/jsx-runtime").JSX.Element;
59
40
  export default SummaryCard;
@@ -0,0 +1,4 @@
1
+ import { TextProps } from '@chakra-ui/react';
2
+
3
+ declare const TextStyled: ({ children, ...props }: TextProps) => import("react/jsx-runtime").JSX.Element;
4
+ export default TextStyled;
@@ -0,0 +1,23 @@
1
+ /** @format */
2
+ import * as React from "react";
3
+ type TDiscount = {
4
+ amount: number;
5
+ type: string;
6
+ value: number;
7
+ isFullDiscount: boolean;
8
+ };
9
+ interface DiscountCodeProps {
10
+ product_id: string;
11
+ account_id: string;
12
+ currency: string;
13
+ store_id: string;
14
+ ticket_payload?: string;
15
+ cart_id?: string;
16
+ payment_plan_id?: string;
17
+ discount: TDiscount;
18
+ setDiscount: (discount: TDiscount) => void;
19
+ discountCode: string;
20
+ setDiscountCode: (discountCode: string) => void;
21
+ }
22
+ declare const DiscountCode: React.FC<DiscountCodeProps>;
23
+ export default DiscountCode;
@@ -78,6 +78,7 @@ type TPaymentConfig = TCryptoPaymentConfig & {
78
78
  itemsList?: TItemList[];
79
79
  isPowerUser?: boolean;
80
80
  payment_plan_id?: string;
81
+ amountDiscounted?: number;
81
82
  };
82
83
  type TDiscount = {
83
84
  amount: number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mainstack-payments",
3
3
  "type": "module",
4
- "version": "1.0.56",
4
+ "version": "1.0.58",
5
5
  "main": "build/mainstack-payments.js",
6
6
  "types": "build/src/index.d.ts",
7
7
  "files": [