@opexa/portal-components 0.1.6 → 0.1.7

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.
@@ -17,6 +17,14 @@ import { onMobileDevice } from '../../../utils/onMobileDevice.js';
17
17
  import { parseDecimal } from '../../../utils/parseDecimal.js';
18
18
  import { useDepositWithdrawalPropsContext } from '../DepositWithdrawalContext.js';
19
19
  import { PaymentMethods } from '../PaymentMethods.js';
20
+ /** True when identity is verified on the member account, including Sumsub flows where nested `verification` is null. */
21
+ function isMemberWithdrawalVerifiedByAccount(account) {
22
+ const nested = account.verification?.status;
23
+ return (account.verificationStatus === 'VERIFIED' ||
24
+ account.verified === true ||
25
+ nested === 'VERIFIED' ||
26
+ nested === 'APPROVED');
27
+ }
20
28
  const GCashStandardCashInWithdrawal = lazy(() => import('./GCashStandardCashInWithdrawal/GCashStandardCashInWithdrawal.js').then((m) => ({
21
29
  default: m.GCashStandardCashInWithdrawal,
22
30
  })));
@@ -145,17 +153,21 @@ export function Withdrawal() {
145
153
  if (!isMayaSessionValid) {
146
154
  return _jsx(MayaSessionSessionExpired, {});
147
155
  }
148
- if (account?.status === 'VERIFICATION_LOCKED') {
156
+ const withdrawalVerified = account != null ? isMemberWithdrawalVerifiedByAccount(account) : false;
157
+ if (account?.status === 'VERIFICATION_LOCKED' &&
158
+ !withdrawalVerified) {
149
159
  return _jsx(AccountVerificationLockRequired, {});
150
160
  }
151
161
  if (parseDecimal(wallet?.balance, 0) < 1) {
152
162
  return _jsx(InsufficientBalance, {});
153
163
  }
154
164
  if (restrictWithdrawalsToVerifiedMembers &&
165
+ !withdrawalVerified &&
155
166
  memberVerification?.status === 'PENDING') {
156
167
  return _jsx(_AccountVerificationPending, {});
157
168
  }
158
169
  if (restrictWithdrawalsToVerifiedMembers &&
170
+ !withdrawalVerified &&
159
171
  (!memberVerification ||
160
172
  (memberVerification.status !== 'APPROVED' &&
161
173
  memberVerification.status !== 'VERIFIED' &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",