azmenak / react-stripe-checkout

Load stripe's checkout.js as a react component. Easiest way to use checkout with React.
MIT License
983 stars 160 forks source link

How to get card token with currency attribute? #136

Open lakshmisanthi opened 5 years ago

lakshmisanthi commented 5 years ago

Hi, I am using react-stripe-checkout js in payment methods adding module. while I am adding a card to my stripe account it's showing error like the card token object must have currency attribute. But I didn't get that object with react-stripe-checkout js. I am getting the card token object as like below

{ id: 'tok_1EVFYcLJLJpndotloCC5NNAI', object: 'token', card: { id: 'card_1EVFYcLJLJpndotlyWa1RjtE', object: 'card', address_city: 'ca', address_country: 'United States', address_line1: 'fremont', address_line1_check: 'pass', address_line2: '', address_state: 'CA', address_zip: '94536', address_zip_check: 'pass', brand: 'Visa', country: 'US', cvc_check: 'pass', dynamic_last4: '', exp_month: '2', exp_year: '2025', funding: 'debit', last4: '5556', name: '38308 redwood ter', tokenization_method: '' }, client_ip: 'xx.xx.xx.xx', created: '1556706058', email: 'sample.ashdj@hdaj.com', livemode: 'false', type: 'card', used: 'false' }

But I need card token object like

{ id: 'tok_1EVFYcLJLJpndotloCC5NNAI', object: 'token', card: { id: 'card_1EVFYcLJLJpndotlyWa1RjtE', object: 'card', address_city: 'ca', address_country: 'United States', address_line1: 'fremont', address_line1_check: 'pass', address_line2: '', address_state: 'CA', address_zip: '94536', address_zip_check: 'pass', brand: 'Visa', country: 'US', cvc_check: 'pass', currency:'USD', dynamic_last4: '', exp_month: '2', exp_year: '2025', funding: 'debit', last4: '5556', name: '38308 redwood ter', tokenization_method: '' }, client_ip: '115.112.108.32', created: '1556706058', email: 'santhi.ankam@dwellingg.com', livemode: 'false', type: 'card', used: 'false' }

Please help me to fix it. Thanks in advance