Comments (5)
Hello,
personnaly, i use findViewById(com.izettle.payments.android.ui.R.id.payment_failure_dismiss) and callOnClick().
from sdk-android.
Hi jonarderic74, and thanks a lot for you reply!
I was not able to get this to work, I maybe would need a more fleshed out example... When I tried to create a variable that held that view the app crashed... How do you know when that view is visible from the MainActivity?
My crude solution that seems to work, but is not at all fool proof, is to have a postDelayed set at 80 seconds, restarting the payment request with a Intent.FLAG_ACTIVITY_NO_HISTORY, so that it kills off any already existing payment requests. This is a crude solution, and can cause problems if people are slow when typing their pin code for example. For now it is probably ok, everyone has contactless cards in my region, and has gotten well accustomed to using it over the last year or so!
from sdk-android.
Hello,
You can not do a FindView on a MainActivity for the intent of zettle.
The SDK use another activity for the log and another for the payment.
So, you need to get the current activity to do a FindView to activate a button (Imageview for the back or Button for the dissmiss).
Waiting a Listen, Handler, or statepayment from the sdk or better soluce, i do a spy for the current activity in a thread.
There is 2 activity :
- Com.izettle.android.auth.OAuthActivity for the logging
- Com.izettle.payments.android.ui.payment.CardPaymentActivity for all event to the payment.
(After it is a Fragment for all event to the payment, so there is no event for activity change)
When the activity is CardPaymentActivity your can request a FindViewById to know the event :
- payment_connect_card_reader_title (Connexion to the reader)
- payment_present_card_reader_image (waiting card) => you call click to the back imageview to cancel it
- payment_pin_bullets (waiting code) => to get the state of code entrance
- payment_processing_amount (validate payment)
- payment_failure_dismiss (echec time out or cancel) => Timeout screen or Technicall Error
- payment_remove_card_title
from sdk-android.
Wow, thanks for the comprehensive answer! I will try to work this into my code. Now it is a fragile thing, but somehow works. But I would definitively like it to be more robust. I wish there was an easier way to do this though through the SDK. Maybe integrate some variable you could add to the payment intent builder to have it return automatically and report what happened. It seems it would be a lot more friendly to developers wanting to make something that relies less on interaction from a user on screen, instead of spying on the current activity. But again perhaps this is the way it is supposed to be done in mobile development?
Anyway, thanks again for being so helpful!
from sdk-android.
Hi, this seems to be a feature request for a headless SDK, one without UI for the app holder, and it's not something we have planned for at the moment.
If a transaction fails for any reason it's essential for the app holder to know that the transaction failed, and also to acknowledge that by pressing ok, or back out of the view. You should not try to do a retry of a failed transaction without the app holder invoking it. The SDK also tries to handle retries in a safe way, so to automatically retry a request after failure is rather error prone and can easily cause double charges or other side effects.
And I strongly recommend to not βspyβ on the components of SDK since that is internal code that can change with any update and does not offer any migration-information, head op nor guarantees over different Android operating systems. Itβs dangerous to assume a constant behaviour from that.
from sdk-android.
Related Issues (20)
- π GitHub Advanced Security has been enabled
- π GitHub Advanced Security has been enabled
- supportsRtl HOT 2
- How to activate Manual Entry? HOT 1
- Can't complete OAuth login flow after upgrading from 1.25.6 to 1.30.1 HOT 1
- Technical error This payment may have not gone through. Please check your receipts and try again # Steps to Reproduce. Popup appearing HOT 3
- Refund appears to be failing
- Action Request(2049, true) is not supported in state ConnectingToRx HOT 4
- Fatal Exception: java.lang.NoSuchMethodError HOT 9
- Feature: Tap to Pay HOT 1
- Incompatible with the most recent React Native version HOT 1
- Really slow processing time HOT 2
- Zettle transaction id tracing
- Fatal error: DatecsReaderV2.onTransactionCompleted HOT 6
- apps keep crashing HOT 2
- development mode HOT 1
- Feature request: URL scheme triggering of card readers HOT 2
- 403 Forbidden upon successful authentication HOT 7
- release-2.11.1 has references to missing com.airbnb.lottie.* classes HOT 5
- SDK not initialized HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdk-android.