How do I use Cordova run over HTTPS?

I’m very new to Ionic development, so forgive me if what I’m asking is obvious as I’m sure I’m missing something major here.

The app I’m working on needs to accept credit card payments. In order to avoid sending credit card information directly to my server, I am using accept.js to get a payment nonce which i can then pass to my controller and use to process the payment.

The problem I’m having is that the accept.js API requires the page making the request to be served over HTTPS. The accept.js error I’m getting is E_WC_02: A HTTPS connection is required. Looking up E_WC_02 in the documentation says: “The page that embeds Accept.js must be served over an HTTPS connection.” I’m a little surprised that running code from my phone doesn’t use HTTPS automatically.

I can use ionic serve with an https proxy to get this error to go away, but whenever i do ionic cordova run android and test it on my phone directly, I get the error above. How can I run the code on my phone using https?

I’ve looked all over and found several related questions, but they all have to do with ionic serve and https. Nothing I have found ties https issues to ionic cordova run android.

My ionic info output:


ionic (Ionic CLI) : 4.1.2
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.1.10


cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 7.0.0, browser 5.0.4, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 1.2.1, (and 11 other plugins)


NodeJS : v6.9.1
npm : 3.10.8
OS : Windows 10