UNPKG

react-native-moyasar-sdk

Version:

Official React Native Moyasar SDK - Integrate Credit Cards, Apple Pay, Samsung Pay, and STC Pay with simple interfaces for a seamless payment experience in your React Native app

19 lines (18 loc) 587 B
"use strict"; import i18n from 'i18next'; import { FieldValidator } from "./field_validator.js"; export class OtpValidator extends FieldValidator { constructor() { super(); this.addRule(i18n.t('moyasarTranslation:otpRequired'), value => { return value.length === 0; }); this.addRule(i18n.t('moyasarTranslation:otpOnlyDigits'), value => { return !/^\d+$/.test(value); }); this.addRule(i18n.t('moyasarTranslation:otpInvalidCount'), value => { return value.length < 4 || value.length > 10; }); } } //# sourceMappingURL=otp_validator.js.map