-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added upi collect payment method type
- Loading branch information
1 parent
ed46ca0
commit 1790918
Showing
24 changed files
with
147 additions
and
1 deletion.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
open RecoilAtoms | ||
open Utils | ||
|
||
@react.component | ||
let make = (~paymentType) => { | ||
let {localeString} = Recoil.useRecoilValueFromAtom(configAtom) | ||
let loggerState = Recoil.useRecoilValueFromAtom(loggerAtom) | ||
let (vpaId, setVpaId) = Recoil.useLoggedRecoilState(userVpaId, "vpaId", loggerState) | ||
|
||
let vpaIdRef = React.useRef(Nullable.null) | ||
|
||
let changeVpaId = ev => { | ||
let val: string = ReactEvent.Form.target(ev)["value"] | ||
setVpaId(prev => { | ||
value: val, | ||
isValid: val->isVpaIdValid, | ||
errorString: val->isVpaIdValid->Option.getOr(false) ? "" : prev.errorString, | ||
}) | ||
} | ||
let onBlur = ev => { | ||
let val = ReactEvent.Focus.target(ev)["value"] | ||
let isValid = val->isVpaIdValid | ||
let errorString = switch isValid { | ||
| Some(val) => val ? "" : localeString.vpaIdInvalidText | ||
| None => "" | ||
} | ||
|
||
setVpaId(prev => { | ||
...prev, | ||
isValid, | ||
errorString, | ||
}) | ||
} | ||
|
||
let submitCallback = React.useCallback((ev: Window.event) => { | ||
let json = ev.data->JSON.parseExn | ||
let confirm = json->getDictFromJson->ConfirmType.itemToObjMapper | ||
if confirm.doSubmit { | ||
if vpaId.value == "" { | ||
setVpaId(prev => { | ||
...prev, | ||
errorString: localeString.vpaIdEmptyText, | ||
}) | ||
} | ||
} | ||
}, [vpaId]) | ||
useSubmitPaymentData(submitCallback) | ||
|
||
<PaymentField | ||
fieldName=localeString.vpaIdLabel | ||
setValue={setVpaId} | ||
value=vpaId | ||
onChange=changeVpaId | ||
onBlur | ||
paymentType | ||
type_="text" | ||
name="vpaId" | ||
inputRef=vpaIdRef | ||
placeholder="Eg: johndoe@upi" | ||
/> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters