@spot-flow/checkout-inline-js 0.1.40 → 0.1.41-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.
@@ -1,11 +1,12 @@
1
1
  import { PaymentAPIResponse } from '../api';
2
2
  import { CardDetailValueType, GetMerchantDetailsTax } from '../types/types';
3
+ import { CustomerDetails } from '../types';
3
4
 
4
5
  type Props = {
5
6
  container: HTMLElement;
6
7
  token: string;
7
8
  encryption: string;
8
- email: string;
9
+ customer: CustomerDetails;
9
10
  amount: number;
10
11
  totalAmount: number;
11
12
  switchTab: (val: number) => void;
@@ -38,7 +39,7 @@ declare class Card {
38
39
  private container;
39
40
  private onSuccess;
40
41
  private planId;
41
- private email;
42
+ private customer;
42
43
  private token;
43
44
  private amount;
44
45
  private totalAmount;
@@ -63,7 +64,7 @@ declare class Card {
63
64
  private retryingPayment;
64
65
  isMaxRetriesReached: boolean;
65
66
  isMobile: boolean;
66
- constructor({ amount, totalAmount, container, email, encryption, planId, token, currency, rdtCode, url, reference, onSuccess, callBackUrl, metadata, localCurrency, hidePaymentMethods, showPaymentMethods, onClose, restartTransactionProcess, retryingPayment, }: Props);
67
+ constructor({ amount, totalAmount, container, customer, encryption, planId, token, currency, rdtCode, url, reference, onSuccess, callBackUrl, metadata, localCurrency, hidePaymentMethods, showPaymentMethods, onClose, restartTransactionProcess, retryingPayment, }: Props);
67
68
  get currentStep(): number;
68
69
  set currentStep(step: number);
69
70
  submitCardDetails(e: Event, _values: CardDetailValueType): Promise<void>;
@@ -1,9 +1,10 @@
1
1
  import { GetMerchantDetailsTax } from '../types/types';
2
+ import { CustomerDetails } from '../types';
2
3
 
3
4
  type Props = {
4
5
  container: HTMLElement;
5
6
  token: string;
6
- email: string;
7
+ customer: CustomerDetails;
7
8
  amount: number;
8
9
  totalAmount: number;
9
10
  switchTab: (val: number) => void;
@@ -29,7 +30,7 @@ declare class Eft {
29
30
  private warningScreen;
30
31
  private transactionIssuesScreen;
31
32
  private container;
32
- private email;
33
+ private customer;
33
34
  private token;
34
35
  private amount;
35
36
  private totalAmount;
@@ -50,7 +51,7 @@ declare class Eft {
50
51
  isMobile: boolean;
51
52
  private paymentResponse;
52
53
  private paymentResponseHeaders;
53
- constructor({ amount, totalAmount, container, email, token, currency, rdtCode, url, reference, callBackUrl, metadata, localCurrency, hidePaymentMethods, showPaymentMethods, restartTransactionProcess, retryingPayment, }: Props);
54
+ constructor({ amount, totalAmount, container, customer, token, currency, rdtCode, url, reference, callBackUrl, metadata, localCurrency, hidePaymentMethods, showPaymentMethods, restartTransactionProcess, retryingPayment, }: Props);
54
55
  get currentStep(): number;
55
56
  set currentStep(step: number);
56
57
  showLoader(): void;
@@ -1,10 +1,11 @@
1
1
  import { GetMerchantDetailsTax } from '../types/types';
2
2
  import { PageLoader } from '../views/shared/page-loader';
3
+ import { CustomerDetails } from '../types';
3
4
 
4
5
  type Props = {
5
6
  container: HTMLElement;
6
7
  closeModal: () => void;
7
- email: string;
8
+ customer: CustomerDetails;
8
9
  onSuccess?: (_val?: any) => void;
9
10
  amount: number;
10
11
  totalAmount: number;
@@ -15,7 +16,7 @@ type Props = {
15
16
  callBackUrl: string;
16
17
  merchantKey: string;
17
18
  localCurrency: string;
18
- phoneNumber: string;
19
+ name?: string;
19
20
  code: string;
20
21
  currency: string;
21
22
  token: string;
@@ -40,7 +41,7 @@ declare class MobileMoney {
40
41
  mainLoader: PageLoader;
41
42
  private _currentStep;
42
43
  private successScreen;
43
- private email?;
44
+ private customer;
44
45
  private activeRef;
45
46
  private warningScreen;
46
47
  private amount;
@@ -65,7 +66,7 @@ declare class MobileMoney {
65
66
  isMaxRetriesReached: boolean;
66
67
  isMobile: boolean;
67
68
  countryCode?: string;
68
- constructor({ container, merchantKey, localCurrency, metadata, callBackUrl, rdtCode, reference, onSuccess, url, email, amount, totalAmount, token, currency, disablePaymentMethods, hidePaymentMethods, showPaymentMethods, onClose, restartTransactionProcess, retryingPayment, countryCode, }: Props);
69
+ constructor({ container, merchantKey, localCurrency, metadata, callBackUrl, rdtCode, reference, onSuccess, url, customer, amount, totalAmount, token, currency, disablePaymentMethods, hidePaymentMethods, showPaymentMethods, onClose, restartTransactionProcess, retryingPayment, countryCode, }: Props);
69
70
  get currentStep(): number;
70
71
  set currentStep(step: number);
71
72
  attachInputListeners(): void;
@@ -1,11 +1,12 @@
1
1
  import { GetMerchantDetailsTax } from '../types/types';
2
2
  import { PageLoader } from '../views/shared/page-loader';
3
+ import { CustomerDetails } from '../types';
3
4
 
4
5
  type Props = {
5
6
  container: HTMLElement;
6
7
  closeModal: () => void;
7
8
  token: string;
8
- email: string;
9
+ customer: CustomerDetails;
9
10
  amount: number;
10
11
  totalAmount: number;
11
12
  currency: string;
@@ -24,7 +25,7 @@ declare class Transfer {
24
25
  private container;
25
26
  private contents;
26
27
  private closeModal;
27
- private email;
28
+ private customer;
28
29
  private transferDetails;
29
30
  private transferConfirmationProgress;
30
31
  private transferConfirmationEnd;
@@ -56,7 +57,7 @@ declare class Transfer {
56
57
  private retryingPayment;
57
58
  isMaxRetriesReached: boolean;
58
59
  isMobile: boolean;
59
- constructor({ amount, totalAmount, closeModal, container, email, token, currency, rdtCode, url, reference, callBackUrl, metadata, localCurrency, disablePaymentMethods, restartTransactionProcess, hidePaymentMethods, retryingPayment, }: Props);
60
+ constructor({ amount, totalAmount, closeModal, container, customer, token, currency, rdtCode, url, reference, callBackUrl, metadata, localCurrency, disablePaymentMethods, restartTransactionProcess, hidePaymentMethods, retryingPayment, }: Props);
60
61
  get currentStep(): number;
61
62
  set currentStep(step: number);
62
63
  attachInputListeners(): void;
@@ -1,4 +1,5 @@
1
1
  import { GetMerchantDetailsTax } from '../types/types';
2
+ import { CustomerDetails } from '../types';
2
3
 
3
4
  type Props = {
4
5
  container: HTMLElement;
@@ -8,7 +9,7 @@ type Props = {
8
9
  totalAmount: number;
9
10
  currency: string;
10
11
  reference: string;
11
- email?: string;
12
+ customer: CustomerDetails;
12
13
  rdtCode?: string;
13
14
  url?: string;
14
15
  closeModal: () => void;
@@ -27,7 +28,7 @@ declare class Ussd {
27
28
  private amount;
28
29
  private totalAmount;
29
30
  private currency;
30
- private email?;
31
+ private customer;
31
32
  private pageLoader;
32
33
  private reference;
33
34
  private onSuccess;
@@ -51,7 +52,7 @@ declare class Ussd {
51
52
  private hidePaymentMethods;
52
53
  private showPaymentMethods;
53
54
  disablePaymentMethods: (name: string) => void;
54
- constructor({ container, onSuccess, secret, amount, totalAmount, currency, email, reference, rdtCode, url, callBackUrl, metadata, localCurrency, hidePaymentMethods, showPaymentMethods, disablePaymentMethods, }: Props);
55
+ constructor({ container, onSuccess, secret, amount, totalAmount, currency, customer, reference, rdtCode, url, callBackUrl, metadata, localCurrency, hidePaymentMethods, showPaymentMethods, disablePaymentMethods, }: Props);
55
56
  get currentStep(): number;
56
57
  set currentStep(step: number);
57
58
  private onCodeSelect;
@@ -1,3 +1,5 @@
1
+ import { CustomerDetails } from '../types';
2
+
1
3
  export type Prettify<T> = {
2
4
  [K in keyof T]: T[K];
3
5
  } & {};
@@ -13,11 +15,7 @@ export type PaymentRequestPayload = {
13
15
  channel?: string;
14
16
  currency: string;
15
17
  localCurrency?: string;
16
- customer: {
17
- email?: string;
18
- name?: string;
19
- phoneNumber?: string;
20
- };
18
+ customer: CustomerDetails;
21
19
  reference: string;
22
20
  planId?: string;
23
21
  callBackUrl?: string;
package/dist/types.d.ts CHANGED
@@ -5,16 +5,14 @@ export type SpotflowProps = {
5
5
  planId: string;
6
6
  regionId?: string;
7
7
  email: string;
8
- phone?: string;
9
- phoneNumber: string;
8
+ name?: string;
9
+ phoneNumber?: string;
10
10
  code: string;
11
11
  amount?: number;
12
12
  currency?: string;
13
13
  onSuccess?: (_val?: any) => void;
14
14
  onClose?: () => void;
15
15
  reference?: string;
16
- firstname?: string;
17
- lastname?: string;
18
16
  onTransferConfirmationPending?: (_val?: any) => void;
19
17
  callBackUrl?: string;
20
18
  metadata?: Record<string, unknown>;
@@ -30,3 +28,8 @@ export type RegionDetail = {
30
28
  allowsZeros: boolean;
31
29
  icon: string;
32
30
  };
31
+ export type CustomerDetails = {
32
+ email: string;
33
+ name?: string;
34
+ phoneNumber?: string;
35
+ };
@@ -7,18 +7,17 @@ import { MainFooter } from './main-footer';
7
7
  import { default as MobileMoney } from '../../modules/MobileMoney';
8
8
  import { default as Eft } from '../../modules/EFT';
9
9
  import { TestCard } from './test-card';
10
+ import { CustomerDetails } from '../../types';
10
11
 
11
12
  type Props = {
12
13
  container: HTMLDivElement;
13
14
  modalContainer: HTMLDivElement;
14
15
  merchantKey: string;
15
16
  encryption: string;
16
- email: string;
17
17
  amount?: number;
18
18
  planId?: string;
19
19
  rdtCode?: string;
20
20
  url?: string;
21
- phoneNumber: string;
22
21
  code: string;
23
22
  reference: string;
24
23
  callBackUrl: string;
@@ -26,6 +25,7 @@ type Props = {
26
25
  localCurrency: string;
27
26
  countryCode?: string;
28
27
  closePayment: () => void;
28
+ customerDetails: CustomerDetails;
29
29
  };
30
30
  export declare class MainPageScreen {
31
31
  validChannels: Array<string>;
@@ -48,8 +48,7 @@ export declare class MainPageScreen {
48
48
  encryption: string;
49
49
  merchantKey: string;
50
50
  planId: string;
51
- email: string;
52
- phoneNumber: string;
51
+ customerDetails: CustomerDetails;
53
52
  code: string;
54
53
  amount: number;
55
54
  rdtCode?: string;
@@ -63,7 +62,7 @@ export declare class MainPageScreen {
63
62
  retryingPayment: boolean;
64
63
  totalAmount: number;
65
64
  countryCode?: string;
66
- constructor({ container, email, phoneNumber, code, encryption, merchantKey, modalContainer, amount, planId, rdtCode, url, reference, callBackUrl, metadata, localCurrency, closePayment, countryCode, }: Props);
65
+ constructor({ container, customerDetails, code, encryption, merchantKey, modalContainer, amount, planId, rdtCode, url, reference, callBackUrl, metadata, localCurrency, closePayment, countryCode, }: Props);
67
66
  mountScreen(values: GetMerchantDetailsTax, currency: string, validChannels: Array<string>, disabledChannels: Array<string>): void;
68
67
  private setupPaymentMethodButtons;
69
68
  attachListeners(): void;
@@ -1,3 +1,4 @@
1
+ import { CustomerDetails } from '../../types';
1
2
  import { BankOption } from '../../types/types';
2
3
 
3
4
  type Props = {
@@ -8,7 +9,7 @@ type Props = {
8
9
  currency: string;
9
10
  amount: number;
10
11
  totalAmount: number;
11
- email: string;
12
+ customer: CustomerDetails;
12
13
  reference: string;
13
14
  rdtCode?: string;
14
15
  url?: string;
@@ -27,7 +28,7 @@ export declare class UssdViewCode {
27
28
  private amount;
28
29
  private ussd_detail?;
29
30
  private reference;
30
- private email?;
31
+ private customer;
31
32
  private activeRef;
32
33
  private pageLoader;
33
34
  private callBackUrl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spot-flow/checkout-inline-js",
3
- "version": "0.1.40",
3
+ "version": "0.1.41-dev.1",
4
4
  "description": "",
5
5
  "main": "dist/checkout-inline.js",
6
6
  "module": "dist/checkout-inline.es.js",