Testing vue js single file components with ava
April 20, 2017
Show all

State of payment processing for hybrid mobile apps

For hop28 we decided on a subscription model. Since hop28 is hybrid mobile app the options are less than obvious.

The most maintained cordova plugin is the “cordova purchase plugin”.

Cordova plugins seem to often pollute the window global namespace which is annoying. It’ll be nice to get to the stage where I can just import like regular es6 modules.

Under the hood it uses the native libraries for payment processing, thus needing the deviceready cordova listener. Which means we’re not able to automated those tests in the console. Not in any way that I’ve found yet. If anyone has suggestions on automating payment processing flow from the cli leave a comment.

While searching around for other cordova plugin libraries there are quite a few unmaintained defunct ones. So it’s a little bit scary taking the time to implement one when it’s future is not certain. I recommend isolating by building an interface to all payment processing functionality in case of needing to switch.

Our second option is a little more extreme and that’s switching from cordova to capacitor.

Adding the native payment functionality separately. The downside is having to do ios/android coding and maintaining separate code for each. Negating the benefits of being hybrid. There isn’t a capacitor plugin for google/apple pay yet. Switching to capacitor in the future is a possibility.

Third option is utilizing the ‘payment request api’.

Since the payment request api has matured we might be able to take advantage of it in a hybrid mobile app. Since it’s a web api we don’t have to bridge through to the native payment libraries thus enabling easier testing. The sad part is android webview isn’t supported according to this list.

Leave a Reply

Your email address will not be published. Required fields are marked *