ordering-ui-react-native 0.22.54 → 0.22.55
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/package.json
CHANGED
|
@@ -31,7 +31,9 @@ export const StripeCardsListUI = (props: any) => {
|
|
|
31
31
|
handleCardClick,
|
|
32
32
|
onOpen,
|
|
33
33
|
gateway,
|
|
34
|
-
paySelected
|
|
34
|
+
paySelected,
|
|
35
|
+
newCardAdded,
|
|
36
|
+
addNewCardAsDefault
|
|
35
37
|
} = props;
|
|
36
38
|
|
|
37
39
|
const theme = useTheme();
|
|
@@ -55,6 +57,12 @@ export const StripeCardsListUI = (props: any) => {
|
|
|
55
57
|
}
|
|
56
58
|
}, [cardsList?.loading])
|
|
57
59
|
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (newCardAdded && addNewCardAsDefault){
|
|
62
|
+
handleCardSelected(newCardAdded)
|
|
63
|
+
}
|
|
64
|
+
}, [JSON.stringify(newCardAdded)])
|
|
65
|
+
|
|
58
66
|
return (
|
|
59
67
|
<>
|
|
60
68
|
{token && !cardsList.loading && cardsList.cards && cardsList.cards.length === 0 && (
|
|
@@ -151,7 +151,10 @@ const StripeElementsFormUI = (props: any) => {
|
|
|
151
151
|
const _isNewCard = index === 0
|
|
152
152
|
stripeTokenHandler(setupIntent?.paymentMethodId, user, businessId, _isNewCard);
|
|
153
153
|
})
|
|
154
|
-
setNewCardAdded(
|
|
154
|
+
setNewCardAdded?.({
|
|
155
|
+
...card,
|
|
156
|
+
id: setupIntent?.paymentMethodId
|
|
157
|
+
})
|
|
155
158
|
} else {
|
|
156
159
|
stripeTokenHandler(setupIntent?.paymentMethodId, user, businessId);
|
|
157
160
|
}
|