-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to choose accepting card types #20
Comments
You can |
This doesn't seem to work. The Payment card array has the cards removed that I remove in the constructor, but the Card component doesn't use this Payment and so these cards still show. Here is a snippet of my code: import React from 'react';
import Card from 'react-credit-card';
import Payment from 'payment';
class CreditCard extends React.Component {
constructor(props) {
super(props);
this.state = {
currentFocus: null
};
Payment.removeFromCardArray('dinersclub');
Payment.removeFromCardArray('laser');
Payment.removeFromCardArray('jcb');
Payment.removeFromCardArray('unionpay');
Payment.removeFromCardArray('discover');
}
render() {
return (
<Card
cvc={securityCode}
name={name}
number={number}
focused={this.state.currentFocus}
expiry={expiry}
/>
);
}
}
export default CreditCard; |
I'll test it out later, though if that doesn't work I'm not sure what can be done, since I assume Payment is a shared singleton. |
For anyone having a similar problem you can simply override the CSS for the classes of card types you do not accept. |
The functionality to allow setting of which cards can be used already exists in Payment.js, see this commit jessepollak/payment@d9ddf82. Can we please get this exposed?
The text was updated successfully, but these errors were encountered: