Giter VIP home page Giter VIP logo

react-native-credit-card-input's People

Contributors

2sow avatar dependabot[bot] avatar gabrielrra avatar janoist1 avatar jdanthinne avatar mvpires avatar patrickgodinho avatar randombrainstormer avatar tafelito avatar wagnerdelima avatar yuritoledo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

react-native-credit-card-input's Issues

componentWillReceiveProps has been renamed, and is not recommended for use

Getting this warning in console:

Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.

Please update the following components: CCInput, LiteCreditCardInput

I'm using
"react-native-credit-card-input": "0.4.8",
"react-native": "0.61.1",

I could create a PR to suppress the warning, but I'm not sure if it's a good approach.
I would do, as it recommends, move code to componentDidUpdate, won't it break the component?

What do you think?

Page freaks out when tapping on Google credit card autocomplete

Hi,

I'm using your library for an app I'm developing and I noticed that if I tap on the autofill option shown below the field (see screenshot below), the page starts freaking out after Google asks me to enter the CVC.

photo_2020-03-17_17-04-42(1)

The app basically starts opening and closing the keyboard and quickly moves the focus between the credit card fields and I'm forced to change screen.

My code that handles the credit card input is pretty simple, and I haven't specified many props:

class ChargeStripe extends React.Component {
	constructor(props) {
		super(props);
		this.state = {
			// ...
		};
		// stuff
	}

	// methods

	render() {
		if (!this.props.show) {
			return null;
		}
		return (
			<React.Fragment>
				<View
					style={{
						backgroundColor: White,
						shadowColor: Black,
						shadowOffset: {
							width: 0,
							height: 1
						},
						shadowOpacity: 0.22,
						shadowRadius: 2.22,
						elevation: 1,
						borderRadius: heightPercentageToDP(1),
						padding: heightPercentageToDP(1)
					}}
				>
					<LiteCreditCardInput onChange={this.fieldChanged} validColor={Teal600} invalidColor={Red800} />
				</View>
				<PayBtn
					styles={this.props.styles}
					processing={this.props.processing}
					submit={() => this.props.submit(this.generateToken)}
					error={this.props.error}
					disabled={!this.state.valid}
				/>
			</React.Fragment>
		);
	}
}

I noticed that if I change LiteCreditCardInput with CreditCardInput nothing changes and the problem is still there.

Can you help me solve this problem?
Thanks a lot in advance!

Request: fallback to default for `labels` and `placeholders` for `CreditCardInput`

Currently, if you use code like this

return (<CreditCardInput
    labels={{
        number: "Numéro de Carte de Crédit"
    }} />
);

the other labels (for cvc, expiry, etc) will be blank/missing instead of filled in with their default values. It might be nice to fallback to their defaults.

Alternatively, if you'd prefer for some sort of form like this

return (<CreditCardInput
    labels={{
        number: "Numéro de Carte de Crédit",
        cvc: CreditCardInput.defaultValues.labels.cvc,
        expiry: CreditCardInput.defaultValues.labels.expiry,
        ...
    }} />
);

then it would be appreciated if the defaultValues object was exposed via the index.d.ts for Typescript users as well.

Incomplete status on input fields- no indication to the user to correct

When user entered wrong input values i.e. incomplete data there was no visual indication to the user to complete the data entry for example
Entering card no : 4245784754857878 user wont taken to next input box nor red color , user will be in confusion state.

Please help me how to solve this

Dmiss Keyboard on complete all fields

Hi,

How to disable keyboard when fill all fields with valid value?

I did a function, but when CVV finishes it retraces to focus name again

` const onChange = formData => {
console.log(formData)
state= {
cartãoValido: false
}

  // Check if card items is valid
  var name = formData.status.name;
  var number = formData.status.number;
  var expiry = formData.status.expiry;
  var cvc = formData.status.cvc;

  // Enable save button and dmiss keyboard
  if (name && number && expiry && cvc == 'valid') {
    Keyboard.dismiss()
    this.setState({cartãoValido: true})
  }

}`

Inconsistent brand naming?

When using CardView and filling thebrand key if you use the string "mastercard" it works correctly, but if you use "master-card" (with a dash) it does NOT work anymore. Obviosly the correct string to use if you want to see the brand image of the card seems to be "mastercard" because this is what is returned from the <CreditCardInput> component.

However, my issue is that the naming feels inconsistent, because some of the brands with two words are separated using a dash (such as "american-express"), but then others are separated with an underscore such as "cvc_amex", and other I would expect either dash or an underscore but is all together ("mastercard"). It does not affect the behaviour or use of this library, but when trying to use CardView and use strings, you need to match exactly the formatting the library needs for each brand.

I would propose to include two versions of the strings for the icons that come with this library, one version as the way it is currently now, and another version with a specific formatting (such as dash separated). This is useful when using CardView to display card information and the brand string comes from your server, you can simply format the string in a single way and expect all brand icon images will match a single formatting.

What do you guys think?

Form Vertifical

Olá Yuri,

Tudo bem?

Vi que comitou algo relacionado a ter o form na Vertical, essa feature já está funcionando?

Se sim, como implementar?

Vertical form

Hey! I am trying to put the inputs form in vertical but I cannot not do it. Is it possible? How should I do it?

mastercard brand is broken

since version 5.0.0 of card-validator there is a breaking change where Mastercard enum changed from master-card to mastercard. Since this package is using version 6.2.0 it should be changed in default icons so it doesn't break the defaults

Postal code question

How can i automatically activate postal code when a card number that requires it is added?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.