Skip to content
New issue

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

PayPal device shows "Recharge Now", app never notified #291

Closed
pnemere opened this issue Jan 9, 2019 · 3 comments
Closed

PayPal device shows "Recharge Now", app never notified #291

pnemere opened this issue Jan 9, 2019 · 3 comments

Comments

@pnemere
Copy link

pnemere commented Jan 9, 2019

What are we supposed to do in this situation?

I create an invoice, and a transaction, eventually calling beginPayment() as in all examples.

The M010 device shows "Recharge now." on screen. It all seems connected, however my app is not called (via the transaction callback tc.setCompletedHandler { (error, txnRecord) in ... so it all seems stuck.

Since my app has an available "Back" button my app can transition out of this screen and try another purchase. This is freely allowed by PayPalHereSDKv2, and when beginPayment is called the device again shows "Recharge now."

I found a function requestPaymentCancellation on the PPRetailTransactionContext class and tried calling it from the "Back" button press action, and the app crashed with the following error:

2019-01-09 20:34:45.889839+0100 MyAppName[2196:538554] Error NOT IMPLEMENTED
requestPaymentCancellation@manticore://root:22219:20

So, any ideas?

@ppmtscory
Copy link
Contributor

If the card reader is at a certain level (10-15%) of batter life, you won't be able to process a transaction. To safeguard against this, you can implement a check for the battery status and then prompt the user to plug the reader in to charge. There's a battery status update listener that you can add to the payment device if you want to continually check for it. The info that's sent to that listener has a few params that you can check for such as isCharging or isLevelCritical among others that you can look at. The isLevelCritical BOOL would be true if it's within that 10-15% range and so you'll want to make sure that the reader is plugged in prior to transacting.

@pnemere
Copy link
Author

pnemere commented Mar 20, 2019

Should the SDK not tell me when I call tc.beginPayment() if it thinks the battery life is adequate? Why do I have to check it and guess what value between 10-15% is "too low"?

Also with more testing it seems sometimes the SDK does return a "Battery Low" error if the battery is really low, say 6% - is this a recent change? There still seems to be some battery % level where the device will go AWOL and show "Recharge Now" without the SDK calling me back with anything.

@ppmtscory
Copy link
Contributor

The SDK doesn't specifically tell you, no, but we offer listeners to get this information to your app. You can can implement the addBatteryStatusUpdateListener on your PaymentDevice which will get hit every 30 seconds to tell you the battery info. In here you can check for the critical levels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants