@swype-org/react-sdk 0.1.8 → 0.1.9
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.
- package/dist/index.cjs +17 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2220,6 +2220,23 @@ function SwypePayment({
|
|
|
2220
2220
|
effectiveSourceId = activeWallet.id;
|
|
2221
2221
|
}
|
|
2222
2222
|
}
|
|
2223
|
+
const isActiveWallet = effectiveSourceType === "walletId" && accounts.some(
|
|
2224
|
+
(a) => a.wallets.some((w) => w.id === effectiveSourceId && w.status === "ACTIVE")
|
|
2225
|
+
);
|
|
2226
|
+
if (!isActiveWallet) {
|
|
2227
|
+
let found = false;
|
|
2228
|
+
for (const acct of accounts) {
|
|
2229
|
+
for (const wallet of acct.wallets) {
|
|
2230
|
+
if (wallet.status === "ACTIVE" && wallet.sources.some((s) => s.balance.available.amount >= parsedAmount)) {
|
|
2231
|
+
effectiveSourceType = "walletId";
|
|
2232
|
+
effectiveSourceId = wallet.id;
|
|
2233
|
+
found = true;
|
|
2234
|
+
break;
|
|
2235
|
+
}
|
|
2236
|
+
}
|
|
2237
|
+
if (found) break;
|
|
2238
|
+
}
|
|
2239
|
+
}
|
|
2223
2240
|
const t = await createTransfer(apiBaseUrl, token, {
|
|
2224
2241
|
sourceType: effectiveSourceType,
|
|
2225
2242
|
sourceId: effectiveSourceId,
|