react-native-payments
react-native-payments copied to clipboard
Update Android implementation, remove Android gateway validation, refactor canMakePayments
This MR changes a few things in the current Android implementation.
- Update to non-deprecated gradle directives
- Updates to use AndroidX
- Updates Android implementation to use current, non-deprecated Google APIs
- Remove validation of gateways for Android. Google adds/changes supported gateways and new gateways work transparently without having to do any change. No reason to reject unknown gateways arbitrarily from the library
This also refactors canMakePayments. This is a breaking change, and changes how canMakePayments is exposed. Is no longer part of PaymentRequest, but it's directly exposed as a function. While having canMakePayments as part of PaymentRequest makes the API more compliant with the specification, there's no point in having to create a PaymentRequest just to verify that the device can make payments. For both Apple and Google Pay in fact, we only need to supply a small subset of the payment data (nothing at all in case of Apple Pay) to verify that the device supports the payment methods.
I'm pretty sure the GooglePay API update is a requirement as of the end of this month. How do we get someone to merge it in?!
Nice job! This PR should be merged, otherwise this lib doesn't make any sense @naoufal @Andreyco
Hey there, thanks for doing this work. I'm helping out with this library. The PR has been open for a while and I'm not quite the expert on the Android side of things and Google Pay. What's the situation as of late 2020 with this?
+1 for merge this pr