We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
`import React, {Component} from 'react'; import {Platform, View, Text, TouchableOpacity} from 'react-native'; import {PaymentRequest} from 'react-native-payments'; class App extends Component { constructor(props) { super(props); this.state = { }; } showPaymentSheet = (succeed = true) => { const paymentRequest = new PaymentRequest(METHOD_DATA, DETAILS); paymentRequest .show() .then(paymentResponse => { const card_token = paymentResponse.details.paymentToken; // const paymentdetail = paymentResponse.details; // const paymentresponce = paymentResponse; if (succeed) { paymentResponse.complete('success'); console.log('Payment request completed with card token', card_token); // console.log('Payment detail', paymentdetail); // console.log('Payment request ', paymentresponce); } else { paymentResponse.complete('failure'); console.log('Payment request failed'); } }) .catch(error => { if (error.message === 'AbortError') { console.log('Payment request was dismissed'); } }); }; render() { return ( <View style={{margin: 50}}> <View style={{height: 44}}> Pay Now {/* */} ); } } const APPLE_METHOD_DATA = [ { supportedMethods: ['apple-pay'], data: { merchantIdentifier: 'merchant.com.your-app.namespace', supportedNetworks: ['visa', 'mastercard', 'amex'], countryCode: 'US', currencyCode: 'USD', paymentMethodTokenizationParameters: { parameters: { gateway: 'stripe', 'stripe:publishableKey': 'your key etc', }, }, }, }, ]; const ANDROID_METHOD_DATA = [ { supportedMethods: ['android-pay'], data: { supportedNetworks: ['visa', 'mastercard', 'amex'], currencyCode: 'USD', environment: 'TEST', // defaults to production paymentMethodTokenizationParameters: { tokenizationType: 'NETWORK_TOKEN', parameters: { publicKey: 'you key etc, }, }, }, }, ]; const METHOD_DATA = Platform.OS == 'ios' ? APPLE_METHOD_DATA : ANDROID_METHOD_DATA; const DETAILS = { id: 'basic-example', displayItems: [ { label: 'Movie Ticket', amount: {currency: 'USD', value: '15.00'}, }, ], total: { label: 'Merchant Name', amount: {currency: 'USD', value: '15.00'}, }, }; export default App;`
`import React, {Component} from 'react'; import {Platform, View, Text, TouchableOpacity} from 'react-native'; import {PaymentRequest} from 'react-native-payments';
class App extends Component { constructor(props) { super(props); this.state = { }; }
showPaymentSheet = (succeed = true) => { const paymentRequest = new PaymentRequest(METHOD_DATA, DETAILS); paymentRequest .show() .then(paymentResponse => { const card_token = paymentResponse.details.paymentToken; // const paymentdetail = paymentResponse.details; // const paymentresponce = paymentResponse;
if (succeed) { paymentResponse.complete('success'); console.log('Payment request completed with card token', card_token); // console.log('Payment detail', paymentdetail); // console.log('Payment request ', paymentresponce); } else { paymentResponse.complete('failure'); console.log('Payment request failed'); } }) .catch(error => { if (error.message === 'AbortError') { console.log('Payment request was dismissed'); } });
};
render() { return ( <View style={{margin: 50}}> <View style={{height: 44}}> Pay Now {/* */} ); } }
const APPLE_METHOD_DATA = [ { supportedMethods: ['apple-pay'], data: { merchantIdentifier: 'merchant.com.your-app.namespace', supportedNetworks: ['visa', 'mastercard', 'amex'], countryCode: 'US', currencyCode: 'USD', paymentMethodTokenizationParameters: { parameters: { gateway: 'stripe', 'stripe:publishableKey': 'your key etc', }, }, }, }, ];
const ANDROID_METHOD_DATA = [ { supportedMethods: ['android-pay'], data: { supportedNetworks: ['visa', 'mastercard', 'amex'], currencyCode: 'USD', environment: 'TEST', // defaults to production paymentMethodTokenizationParameters: { tokenizationType: 'NETWORK_TOKEN', parameters: { publicKey: 'you key etc, }, }, }, }, ];
const METHOD_DATA = Platform.OS == 'ios' ? APPLE_METHOD_DATA : ANDROID_METHOD_DATA;
const DETAILS = { id: 'basic-example', displayItems: [ { label: 'Movie Ticket', amount: {currency: 'USD', value: '15.00'}, }, ], total: { label: 'Merchant Name', amount: {currency: 'USD', value: '15.00'}, }, };
export default App;`
i install android dependencies like give in document all good but when i click on pay now button it gives error
The text was updated successfully, but these errors were encountered:
Same issue on android, IOS work correctly.
Sorry, something went wrong.
@Tanzeel-ur-rehman-git I find solution in this issue Just downgrade to implementation com.google.android.gms:play-services-wallet:17.0.0
com.google.android.gms:play-services-wallet:17.0.0
No branches or pull requests
in Ios payment console is working fine but in android i get error this is my code
i install android dependencies like give in document all good but when i click on pay now button it gives error
The text was updated successfully, but these errors were encountered: