@spot-flow/checkout-inline-js 0.3.3 → 0.3.4-dev.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.
@@ -26,6 +26,7 @@ type Props = {
26
26
  retryingPayment: boolean;
27
27
  keys: string | null;
28
28
  testcardIsVisible: boolean;
29
+ discountEnabled?: boolean;
29
30
  };
30
31
  declare class Card {
31
32
  private contents;
@@ -75,11 +76,13 @@ declare class Card {
75
76
  otpMessage: string;
76
77
  rawAvsData: Record<string, string>;
77
78
  translatedAvsData: Record<string, string>;
78
- constructor({ amount, totalAmount, container, customer, encryption, planId, token, currency, rdtCode, url, reference, onSuccess, callBackUrl, metadata, localCurrency, hidePaymentMethods, showPaymentMethods, onClose, restartTransactionProcess, retryingPayment, keys, testcardIsVisible, }: Props);
79
+ discountEnabled: boolean;
80
+ constructor({ amount, totalAmount, container, customer, encryption, planId, token, currency, rdtCode, url, reference, onSuccess, callBackUrl, metadata, localCurrency, hidePaymentMethods, showPaymentMethods, onClose, restartTransactionProcess, retryingPayment, keys, testcardIsVisible, discountEnabled, }: Props);
79
81
  get currentStep(): number;
80
82
  set currentStep(step: number);
81
83
  fetchCurrentRegionDetails(): import('../types').RegionDetail | undefined;
82
84
  cancellledPlanAction(): void;
85
+ private getChargeAmount;
83
86
  private renderTranslatedText;
84
87
  showLoader(): void;
85
88
  submitCardDetails(e: Event, _values: CardDetailValueType): Promise<void>;
@@ -27,6 +27,7 @@ type Props = {
27
27
  retryingPayment: boolean;
28
28
  countryCode?: string;
29
29
  planId: string;
30
+ discountEnabled?: boolean;
30
31
  };
31
32
  declare class MobileMoney {
32
33
  private contents;
@@ -69,7 +70,8 @@ declare class MobileMoney {
69
70
  countryCode?: string;
70
71
  errorText: string;
71
72
  otpMessage: string;
72
- constructor({ container, merchantKey, localCurrency, metadata, callBackUrl, rdtCode, reference, onSuccess, url, customer, amount, totalAmount, token, currency, disablePaymentMethods, hidePaymentMethods, showPaymentMethods, onClose, restartTransactionProcess, retryingPayment, countryCode, planId, }: Props);
73
+ discountEnabled: boolean;
74
+ constructor({ container, merchantKey, localCurrency, metadata, callBackUrl, rdtCode, reference, onSuccess, url, customer, amount, totalAmount, token, currency, disablePaymentMethods, hidePaymentMethods, showPaymentMethods, onClose, restartTransactionProcess, retryingPayment, countryCode, planId, discountEnabled, }: Props);
73
75
  get currentStep(): number;
74
76
  set currentStep(step: number);
75
77
  attachInputListeners(): void;
@@ -82,6 +84,7 @@ declare class MobileMoney {
82
84
  submitOtp(e: Event, values: string): void;
83
85
  verifyPaymentProcess(): Promise<void>;
84
86
  goBackToMerchant(): void;
87
+ private getChargeAmount;
85
88
  renderMobileMoneyContent(values?: GetMerchantDetailsTax): void;
86
89
  }
87
90
  export default MobileMoney;
@@ -196,6 +196,7 @@ export type GetMerchantPlanDetail = {
196
196
  }>;
197
197
  taxEnabled: boolean;
198
198
  subscription_id?: string;
199
+ discountEnabled?: boolean;
199
200
  };
200
201
  export type GetBanksRequestParams = {
201
202
  ussd: boolean;
package/dist/types.d.ts CHANGED
@@ -15,6 +15,7 @@ export type SpotflowProps = {
15
15
  url?: string;
16
16
  mode?: "test" | "live";
17
17
  countryCode?: string;
18
+ enableDiscount?: string;
18
19
  };
19
20
  export type RegionDetail = {
20
21
  name: string;
@@ -3,7 +3,7 @@ import { PaymentResponseData } from '../../types/types';
3
3
 
4
4
  type Props = {
5
5
  container: HTMLDivElement;
6
- onAction: (_val: number, text?: string) => void;
6
+ onAction: (_val: number) => void;
7
7
  ref: string;
8
8
  token: string;
9
9
  rdtCode?: string;
@@ -14,7 +14,7 @@ type Props = {
14
14
  };
15
15
  export declare class MobileMoneyConfirmationProgress {
16
16
  container: HTMLDivElement;
17
- onAction: (_val: number, text?: string) => void;
17
+ onAction: (_val: number) => void;
18
18
  private onSuccess;
19
19
  private ref;
20
20
  private token;
@@ -29,7 +29,7 @@ export declare class MobileMoneyConfirmationProgress {
29
29
  setPaymentResponses: (data: PaymentResponseData, headers: Headers) => void;
30
30
  constructor(props: Props);
31
31
  attachListeners(): void;
32
- verifyMobileMoney(token: string, initialInterval: number, onSuccess: (data: PaymentAPIResponse) => void): Promise<void>;
32
+ verifyMobileMoney(token: string, initialInterval: number, onSuccess: (data: PaymentAPIResponse) => void, onError: (data: PaymentAPIResponse) => void): Promise<void>;
33
33
  private redirectTo;
34
34
  private startTimer;
35
35
  private stopTimer;
@@ -22,6 +22,7 @@ type Props = {
22
22
  restartTransactionProcess: () => void;
23
23
  merchantDetails: GetMerchantDetailsTax;
24
24
  countryCode?: string;
25
+ discountEnabled?: boolean;
25
26
  };
26
27
  export declare class MobileMoneyForm {
27
28
  container: HTMLElement | Element;
@@ -40,9 +41,11 @@ export declare class MobileMoneyForm {
40
41
  private restartTransactionProcess;
41
42
  private merchantDetails;
42
43
  countryCode?: string;
44
+ discountEnabled?: boolean;
43
45
  constructor(props: Props);
44
46
  private validateForm;
45
47
  attachListener(): void;
48
+ private getChargeAmount;
46
49
  private displayButtonText;
47
50
  renderComponent(values: GetMobileMoneyResponse): void;
48
51
  renderContent(): void;
@@ -16,6 +16,7 @@ type Props = {
16
16
  trialAmount?: string;
17
17
  trial?: Trial;
18
18
  countryCode?: string;
19
+ discountEnabled?: boolean;
19
20
  };
20
21
  export declare class MainHeader {
21
22
  container: HTMLDivElement;
@@ -33,6 +34,7 @@ export declare class MainHeader {
33
34
  onClose: (notClosePayment: boolean) => void;
34
35
  currentPaymentMethod: string;
35
36
  countryCode?: string;
37
+ discountEnabled?: boolean;
36
38
  constructor(props: Props);
37
39
  attachListeners(): void;
38
40
  renderComponent(): void;
@@ -29,6 +29,7 @@ type Props = {
29
29
  closePayment: () => void;
30
30
  customerDetails: CustomerDetails;
31
31
  mode?: "test" | "live";
32
+ enableDiscount?: boolean;
32
33
  };
33
34
  export declare class MainPageScreen {
34
35
  validChannels: Array<string>;
@@ -56,6 +57,7 @@ export declare class MainPageScreen {
56
57
  customerDetails: CustomerDetails;
57
58
  amount: number;
58
59
  rdtCode?: string;
60
+ enableDiscount?: boolean;
59
61
  url?: string;
60
62
  reference: string;
61
63
  isMobile: boolean;
@@ -69,7 +71,7 @@ export declare class MainPageScreen {
69
71
  mainLoader: PageLoader;
70
72
  mode?: "test" | "live";
71
73
  selectedMethods: Array<string>;
72
- constructor({ container, customerDetails, encryption, merchantKey, modalContainer, amount, planId, rdtCode, url, reference, callBackUrl, metadata, localCurrency, closePayment, countryCode, mode, }: Props);
74
+ constructor({ container, customerDetails, encryption, merchantKey, modalContainer, amount, planId, rdtCode, url, reference, callBackUrl, metadata, localCurrency, closePayment, countryCode, mode, enableDiscount, }: Props);
73
75
  mountScreen(values: GetMerchantDetailsTax, currency: string, validChannels: Array<string>, disabledChannels: Array<string>): void;
74
76
  private setupPaymentMethodButtons;
75
77
  attachListeners(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spot-flow/checkout-inline-js",
3
- "version": "0.3.3",
3
+ "version": "0.3.4-dev.1",
4
4
  "description": "",
5
5
  "main": "dist/checkout-inline.js",
6
6
  "module": "dist/checkout-inline.es.js",