@lydianpay/sdk-web 3.19.4 → 3.19.5

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.
@@ -8,6 +8,7 @@ export declare abstract class Base {
8
8
  private publishableKey;
9
9
  constructor(baseUri: string, publishableKey?: string);
10
10
  private headers;
11
+ private send;
11
12
  protected request<T>(endpoint: string, options?: GatewayRequestInit): Promise<T>;
12
13
  protected requestText(endpoint: string, options?: GatewayRequestInit): Promise<string>;
13
14
  protected requestWithFormData<T>(endpoint: string, options?: GatewayRequestInit): Promise<T>;
@@ -1,8 +1,8 @@
1
1
  import { Base } from '../base';
2
- import { AuthenticateCustomerOTPRequest, CustomerKYCValidationStatusResponse, RedactedCustomerPIIResponse, SendCustomerOTPRequest, UpdateCustomerPIIRequest } from '../../types';
2
+ import { AuthenticateCustomerOTPRequest, CustomerKYCValidationStatusResponse, CustomerPIIRequest, RedactedCustomerPIIResponse, SendCustomerOTPRequest, UpdateCustomerPIIRequest } from '../../types';
3
3
  export declare class Customer extends Base {
4
4
  sendCustomerOTP(sendOTPRequest: SendCustomerOTPRequest): Promise<string>;
5
5
  authenticateCustomerOTP(authenticateOTPRequest: AuthenticateCustomerOTPRequest): Promise<CustomerKYCValidationStatusResponse>;
6
- getCustomerPII(authenticateOTPRequest: AuthenticateCustomerOTPRequest): Promise<RedactedCustomerPIIResponse>;
6
+ getCustomerPII(customerPIIRequest: CustomerPIIRequest): Promise<RedactedCustomerPIIResponse>;
7
7
  updateCustomerPII(updatePIIRequest: UpdateCustomerPIIRequest): Promise<RedactedCustomerPIIResponse>;
8
8
  }
@@ -132,6 +132,11 @@ export type AuthenticateCustomerOTPRequest = {
132
132
  email: string;
133
133
  country: string;
134
134
  };
135
+ export type CheckoutIdentifiers = {
136
+ sessionID?: string;
137
+ transactionID?: string;
138
+ };
139
+ export type CustomerPIIRequest = AuthenticateCustomerOTPRequest & CheckoutIdentifiers;
135
140
  export type CustomerKYCValidationStatusResponse = {
136
141
  customerUUID: string;
137
142
  kycValidated: boolean;
@@ -1,5 +1,5 @@
1
1
  import type { CreateTransactionResponse } from '../types';
2
- export declare const KYC_PART_ORDER: readonly ["email", "country", "firstName", "lastName", "walletAddress", "cityOfBirth", "dateOfBirth", "nationalIDNumber", "customerIDNumber", "addressCountry", "street", "street2", "region", "city", "postalCode"];
2
+ export declare const KYC_PART_ORDER: readonly ["email", "country", "firstName", "lastName", "walletAddress", "cityOfBirth", "dateOfBirth", "nationalIDDocumentType", "nationalIDNumber", "customerIDNumber", "addressCountry", "street", "street2", "region", "city", "postalCode"];
3
3
  export type KycFieldPart = (typeof KYC_PART_ORDER)[number];
4
4
  export declare const KYC_FIELD_ORDER: readonly ["email", "firstName", "lastName", "walletAddress", "country", "dateAndPlaceOfBirth", "cityOfBirth", "dateOfBirth", "physicalAddress", "nationalIDNumber", "customerIDNumber"];
5
5
  export type KycField = (typeof KYC_FIELD_ORDER)[number];
@@ -12,12 +12,14 @@ export declare const KYC_FIELD_PARTS: {
12
12
  readonly dateAndPlaceOfBirth: readonly ["cityOfBirth", "dateOfBirth"];
13
13
  readonly cityOfBirth: readonly ["cityOfBirth"];
14
14
  readonly dateOfBirth: readonly ["dateOfBirth"];
15
- readonly nationalIDNumber: readonly ["nationalIDNumber"];
15
+ readonly nationalIDNumber: readonly ["nationalIDDocumentType", "nationalIDNumber"];
16
16
  readonly customerIDNumber: readonly ["customerIDNumber"];
17
17
  readonly physicalAddress: readonly ["addressCountry", "street", "street2", "region", "city", "postalCode"];
18
18
  };
19
19
  declare const KYC_DOCUMENT_TYPES: readonly ["ID_CARD", "PASSPORT", "RESIDENCE_PERMIT", "DRIVERS"];
20
20
  export type KycDocumentType = (typeof KYC_DOCUMENT_TYPES)[number];
21
+ export declare const NATIONAL_ID_DOCUMENT_TYPES: readonly ["PASSPORT", "SSS", "DRIVER_LICENSE", "TIN", "OTHER"];
22
+ export type NationalIdDocumentType = (typeof NATIONAL_ID_DOCUMENT_TYPES)[number];
21
23
  export type KycFormValues = Record<KycFieldPart, string> & {
22
24
  documentType: string;
23
25
  hasDocumentFront: boolean;
@@ -47,6 +49,11 @@ export type KycRequirements = {
47
49
  documentTypes: KycDocumentType[];
48
50
  unsupportedFields: string[];
49
51
  };
52
+ export declare function isNationalIdDocumentType(name: string): name is NationalIdDocumentType;
53
+ export declare function getRevealedKycParts({ parts, values, }: {
54
+ parts: KycFieldPart[];
55
+ values: KycFormValues;
56
+ }): KycFieldPart[];
50
57
  export declare function getKycRequirements({ transaction, hasConnectedWallet, }: {
51
58
  transaction: Partial<CreateTransactionResponse>;
52
59
  hasConnectedWallet: boolean;
@@ -56,9 +63,10 @@ export declare function getKycChoiceInputs({ group, chosenFields, }: {
56
63
  group: KycFieldGroup;
57
64
  chosenFields: KycField[];
58
65
  }): KycGroupChoice[];
59
- export declare function getInitialKycChoiceFields({ group, values, blankText, }: {
66
+ export declare function getInitialKycChoiceFields({ group, values, partsStillOnFile, blankText, }: {
60
67
  group: KycFieldGroup;
61
68
  values: KycFormValues;
69
+ partsStillOnFile: KycFieldPart[];
62
70
  blankText?: Record<KycFieldPart, string>;
63
71
  }): KycField[];
64
72
  export declare function getHiddenFilledParts({ group, chosenFields, values, }: {
@@ -69,19 +77,29 @@ export declare function getHiddenFilledParts({ group, chosenFields, values, }: {
69
77
  export declare function canFulfillKycRequirements({ requiredFields, fieldGroups, documentTypes, unsupportedFields, }: KycRequirements): boolean;
70
78
  export declare function getRequestedKycFields({ requiredFields, fieldGroups, }: KycRequirements): KycField[];
71
79
  export declare function isKycEmailCollected({ requiredParts, fieldGroups }: KycRequirements): boolean;
72
- export declare function getKycPartError(part: KycFieldPart, values: KycFormValues): string | null;
73
- export declare function isKycFieldComplete(field: KycField, values: KycFormValues): boolean;
80
+ export declare function getKycPartError({ part, values, partsStillOnFile, }: {
81
+ part: KycFieldPart;
82
+ values: KycFormValues;
83
+ partsStillOnFile: KycFieldPart[];
84
+ }): string | null;
85
+ export declare function isKycFieldComplete({ field, values, partsStillOnFile, }: {
86
+ field: KycField;
87
+ values: KycFormValues;
88
+ partsStillOnFile: KycFieldPart[];
89
+ }): boolean;
74
90
  export declare function documentHasTwoSides(documentType: string): boolean;
75
- export declare function getKycGroupGuidance({ group, values, }: {
91
+ export declare function getKycGroupGuidance({ group, values, partsStillOnFile, }: {
76
92
  group: KycFieldGroup;
77
93
  values: KycFormValues;
94
+ partsStillOnFile: KycFieldPart[];
78
95
  }): {
79
96
  requiredCount: number;
80
97
  totalCount: number;
81
98
  completedCount: number;
82
99
  };
83
- export declare function isKycFormComplete({ requirements, values, }: {
100
+ export declare function isKycFormComplete({ requirements, values, partsStillOnFile, }: {
84
101
  requirements: KycRequirements;
85
102
  values: KycFormValues;
103
+ partsStillOnFile: KycFieldPart[];
86
104
  }): boolean;
87
105
  export {};
@@ -1,13 +1,12 @@
1
1
  import * as React from 'react';
2
2
  import { type KycFieldPart, type KycFormValues } from '../kycValidation';
3
- import { type KycPartsOnFile } from '../restoredCustomer';
4
3
  import type { SelectOption } from '../optionFilter';
5
4
  export type KycInputProps = {
6
5
  values: KycFormValues;
7
6
  countries: SelectOption[];
8
7
  merchantCountry: string | null;
9
8
  onChange: (part: KycFieldPart, value: string) => void;
10
- onFile: KycPartsOnFile;
9
+ partsStillOnFile: KycFieldPart[];
11
10
  isEmailReadOnly: boolean;
12
11
  maskedAddressLines: KycFieldPart[];
13
12
  };
@@ -21,6 +21,12 @@ export declare function getKycPartsStillOnFile({ values, onFile, }: {
21
21
  values: KycFormValues;
22
22
  onFile: KycPartsOnFile;
23
23
  }): KycFieldPart[];
24
+ export declare function getEditedKycPartValue({ part, currentValue, nextValue, onFile, }: {
25
+ part: KycFieldPart;
26
+ currentValue: string;
27
+ nextValue: string;
28
+ onFile: KycPartsOnFile;
29
+ }): string;
24
30
  type AddressUpdateInputs = {
25
31
  requirements: KycRequirements;
26
32
  values: KycTextFields;
@@ -1,4 +1,4 @@
1
- import type { CreateTransactionResponse, GetTransactionResponse } from '../types';
1
+ import type { CheckoutIdentifiers, CreateTransactionResponse, GetTransactionResponse } from '../types';
2
2
  import type { KycPartsOnFile } from './restoredCustomer';
3
3
  export declare function parseInstant(iso: string | undefined): number | null;
4
4
  export declare function isFutureInstant(iso: string | undefined, now?: number): boolean;
@@ -10,6 +10,14 @@ export declare function getTransactionIdToRequote(session: {
10
10
  } | null, cryptoTransaction: {
11
11
  transactionId?: string;
12
12
  } | null, promoted: boolean): string | null;
13
+ export declare function getCheckoutIdentifiers({ session, cryptoTransaction, }: {
14
+ session: {
15
+ sessionID?: string;
16
+ } | null;
17
+ cryptoTransaction: {
18
+ transactionId?: string;
19
+ } | null;
20
+ }): CheckoutIdentifiers;
13
21
  export { transactionOutcome, type TransactionOutcome } from './transactionOutcome';
14
22
  export declare const POLL_FAILURES_BEFORE_NOTICE = 5;
15
23
  export declare function shouldReportPollFailure(consecutiveFailures: number): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lydianpay/sdk-web",
3
- "version": "3.19.4",
3
+ "version": "3.19.5",
4
4
  "description": "Drop-in crypto payment checkout for the web — a <lydian-checkout> web component and window.Lydian API across 20+ chains and major stablecoins.",
5
5
  "license": "MIT",
6
6
  "repository": {