Giter VIP home page Giter VIP logo

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

Contributors

andreyco avatar coolses avatar kraffslol avatar sbycrosz avatar sscaff1 avatar wchaering 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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

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

Porting to React for web?

This repo looks amazing.

Not too familiar with React Native, how much work would it take to port this to React for the web?

Any info would be much appreciated.

Export icons for use elsewhere

It'd be great if the icons were exported in the package so that they can be used elsewhere.

For example, in our app, we want to show what (usually stored) payment method will be charged and we want to show a consistent icon. We can obviously use credit-card-type to discover the type of card, but we can't show the right icon without this being exported.

Error browserify: export * from "./src/"; in index.js:1

Hi,
Sorry I'm relatively new in the NodeJs world.
When I use browserify in my project I have this error since I use the 'react-native'credit-cart-input' module:

[00:35:17] Starting 'browserify'...
Error :
D:\dev\myproject\node_modules\react-native-credit-card-input\index.js:1
export * from "./src/";
^
ParseError: 'import' and 'export' may appear only with 'sourceType: module'

Here my gulp task for Browserify:

gulp.task('browserify', function(){
    return browserify({
        extensions: ['.js', '.jsx', '.es6', '.json'],
        entries: 'src/js/main.jsx',
    })
    .transform(babelify.configure({
        presets: ["es2015","react"],
    }))
    .bundle()
    .on("error", function (err) { console.log("Error : " + err.message); })
    .pipe(source('main.js'))
    .pipe(gulp.dest(path.DIST_JS));
});

I see the project use eslint, may be something is missing about this in my dev environnement.

Can you help me ?

Order of postal code and cardholder's name

Hello!

Is there an option to show the postal code field before the cardholder's name field? Since there's no auto next focus for the name and the name field extends to the edge of the screen, the postal code box is effectively hidden.

placeholder colour not reflecting

Hi All,

I need to change the placeholder colour but it was not reflecting. It remains the default colour.
When i try to change other text colours they got changed.
Here is sample code.

<CreditCardInput
requiresName={true}
cardFontFamily={"Kabel Bk BT"}
placeholderColor={"white"}
inputContainerStyle={{
borderBottomWidth: 1, borderBottomColor:Constants.Colors.White
}}
onChange={this._onChange}
labelStyle={[styles.label,Constants.Fonts.content]}
inputStyle={[styles.input,Constants.Fonts.content]}
autoFocus={false}/>

setValues() on full card number or full expiry raises an error

Attempt to measure layout but offset or dimensions were NaN

EDIT: On further investigation, only causes error if card or expiry is valid. Invalid values do not cause the error. This is probably caused by the fact that a valid value on either of these fields attempts to focus on the next value.

Broken on RN37

There's a breaking change on RN36 on flex properties. Both of the forms seem broken.

Export CC Icons

This may be the laziest request ever, but the font awesome CC icons are not named as nicely as the ones in this library. Stripe card brand strings can be

Visa, American Express, MasterCard, Discover, JCB, Diners Club, or Unknown.

I want to display a list of cards with only icons - not the full cardview (it wont fit nicely in a typical listview), and I dont want to write a switch statement for converting stripe brand to font awesome names.

Im going to submit a PR to export the icons. A lot of text for a very small, pointless change. Maybe there is another soul who can find use in this.

get error immediately when i import

i got an error after i import the component
did anyone got same error??

https://imgur.com/05jKbXR

Unhandled JS Exception: Cannot read property 'string' of undefined
Unhandled JS Exception: Module AppRegistry is not a registered callable module (calling runApplication)

Plugin allows entering 18 digits as card number

Hi!
Thank you for the component.
The issue is not major, obviously.

Entering last digit of card, then switching to expiration and back using backspace allows entering 18 digits. Not sure, if this is a bug or feature.

screenshot 2017-04-18 05 11 33

Latest version

Input labels

Is is possible to rename (translate) input fields through additionalInputProps?

Thank you :)

No onBlur prop?

Hi, first off, nice work on this project!

I was hoping to use an onBlur event on the input like with a regular React Native TextInput component... could this be added?

Thanks!

Very slow when used on a mobile device but runs fine in xcode

Hello!
Thank you so much for creating this component, it has been very useful.

When I was integrating this component into my application it would run super fast and smooth during development in xcode. But when I deployed to production it is super slow and laggy.
Do you happen to know what I am doing wrong or is this a reoccurring issue.

Tested on multiple iPhones.

Input is Invisible

I am having trouble getting this component to show up. The input is not visible. I am on RN 0.36.0 and this is for iOS. Any help appreciated! Here is what it looks like:

img_8414

RN 0.39 broken container

Hi,
Missed flex: 1 in CreditCardInput.js row 18 .

container: { alignItems: "center", flex: 1 },

Regards

Inputs styles

Hello, is it possible to set width to input fields passing it trough props?

Improve set focus to previous field logic

I'm writing this as documentations & pleas for help

Currently CCInput set focus to the previous field when a field become empty. e.g. when user changes expiry from "1" to "" with backspace button, CCInput will focus to number field. This will not allow user to removes expiry without triggering the set focus to the previous field logic.

The better logic is to move to previous field when user press backspace on an empty field (following stripe implementation).

The catch is onKeypress prop is not available for RN Android atm, so some workaround might be needed.

PRs are welcome! ๐ŸŽ‰

Card number input loses focus to expiry after 12 numbers entered

Hi all,

While trying to enter account numbers like 5017670000005900 the card number using the phone keypad text input loses focus after entering only 12 numbers instead of 16 and focus moves to expiry. Couldn't find any props or options in documentation.

"react-native": "0.47.0",
"react-native-credit-card-input": "0.3.3"

Please Help.

Attempting to use `this.refs.CCInput.setValues({ number: "4242" });` but receiving, "undefined is not an object."

I'm currently attempting to use this.refs.CCInput.setValues({ number: "4242" }); in my component to update the number value generated in the CreditCardInput component, but keep receiving, "undefined is not an object." Anyone have any thoughts on how to get this to work? I've pasted a snippet of code below:


<CreditCardInput 
        ... 
/>

<TextInput
	onChangeText={(value) => this.refs.CCInput.setValues({ number: value })}
        ...
/>

Accessibility not passing up to each CCInput

I am trying to automate some tests on Appium and I am able to create accessibilityLabel, accessibilityTraits, and accessible up to other Components, but when I try to do it using your open source library, it doesn't work. Have you guys experienced this issue before and how would you go about resolving it?

Thanks.

Option to manually set CC values?

Hello!
I'm trying to set the card values manually but I can't seem to figure out how to do it (If even possible).

I tried adding

values={{expiry: "11/11"}}

prop to the CreditCardInput component but it seems like the values prop doesn't get set.

Is there a way to set the initial values yet?

allowsScroll prop not working

Enabling horizontal scrolling would alleviate the issue of it being difficult to navigate left/right through input fields, however setting the prop does not work.

Creditcard input miss positioned

i think this is due to position absolute in the cardview but take a look of my view
screenshot_1511754079

i tried to change the style but it stays and stuck there, anyone know how to solve this?
i fix it by putting padding to the input, but i guess it will not be effective in all phone

[Question]: Reseting Card FormData

Hello @sbycrosz, thanks for sharing this package. Got a question, please is there a way to reset the form data/values such as in a lifecycle event like componentWillUnmount or even after data is retrieved and form is submitted etc?

Thanks.

LiteCreditCardInput input focusing breaks with RN version > 0.37 (Release Build Configuration)

I recently noticed that focusing of CCInput components in LiteCreditCardInput is not working as expected only when my project's build configuration is set to Release.

  • I was using react-native-credit-card-input v0.2.6, but am experiencing this same issue with v0.3.3.
  • I've confirmed this issue with React Native versions 0.38, 0.39, and 0.40.
  • Temporarily reverting to React Native 0.37 has allowed me to work around this for now.

I'd appreciate any insight or ideas about why this might be happening.

Thanks!

keyboardShouldPersistTaps deprecation warning

When mounting a simple card input:
<CreditCardInput onChange={this.handleCardChange} />;

a deprecation warning is thrown:
Warning: 'keyboardShouldPersistTaps={true}' is deprecated. Use 'keyboardShouldPersistTaps="always"' instead

CardView prop for Text Color

Looking for a prop to change the color of the baseText, placeholder & focused text on the CardView Component.

I've changed the hardcoded values but everytime I "yarn upgrade" it overwrites the values.

Could you please add this.

Thanks,
Lewis

Initial state of card is backwards

I am a using CreditCardInput with autoFocus and when the screen initially renders, the back of the card image is shown. As soon as I enter something, the front of the card image is shown. It doesn't flip to the front image, it just appears. As I type, when I get to CVV, it does flip to the back, as it should. It is just that when the screen is initially rendered, the back card image is shown, but it should be the front card image.

Here is the relevant code:

<CreditCardInput
  autoFocus
  inputStyle={styles.creditCardInput}
  onChange={this.onChange}
/>

const styles = StyleSheet.create({
  container: {
    flex: 1
  },
  creditCardInput: {
    color: textColor
  }
})

I am using react-native-credit-card-input 0.3.3 and react-native-flip-card 3.3.3

Postal code field doesnt accept US ZIP codes

Postal Code field doesn't return true for valid US ZIP codes. It expects 6 digits to return true.

connectToState.js line 38

validatePostalCode: (postalCode = "") => {
return postalCode.match(/^\d{6}$/) ? "valid" : <--- this has to check for both 5 and 6 digits
postalCode.length > 6 ? "invalid" :
"incomplete";
},

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.