Logout/LogOff in Visa Express Button (SDK Android)

Solved! Go to solution
candidosales
Helper

Logout/LogOff in Visa Express Button (SDK Android)

Is there any way to log out the user aims to express button on android?

6 REPLIES 6
ricardo_visa
Community Scholar

Re: Logout/LogOff in Visa Express Button (SDK Android)

Hi there, 

Which API are you referring to? Can you send some screenshots?

 

Thanks,

Ricardo




Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.
candidosales
Helper

Re: Logout/LogOff in Visa Express Button (SDK Android)

The screenshot is in attachment.

I'm using a API Visa SDK 4.0 (Android) and I need a method that make log out or clear cached the user logged in Visa Express Button.

 

How do make this?

 

ricardo_visa
Community Scholar

Re: Logout/LogOff in Visa Express Button (SDK Android)

Hi there, 

Due to the nature of Visa Checkout, "logging out" isn't necessary.  When entering your account name and password, you are transferring payment details from your visa checkout account, to whichever api you are using to process credit card information.  The manner in which you would clear the payment details from the shopping cart would be to change the payment method. 

 

Either switching from visa checkout to another method of payment, or logging into a different visa checkout account.

 

Does this help?

 

Thanks,

Ricardo




Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.
candidosales
Helper

Re: Logout/LogOff in Visa Express Button (SDK Android)

 
 
 
 
Hi,

It does not help, because I am developing an application for Android and when suuário log out of the application I need it log out or delete the cache Visa Express.

I found a solution by accessing the shell android on the way:

adb shell
cd /data/data/com.youapp/shared_prefs
cat RememberedData.xml


<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
    <boolean name="hasUserUnremebered" value="false" />
    <boolean name="camera_permissions" value="false" />
    <boolean name="contact_permissions" value="false" />
    <string name="deviceLocaleCountry">en-US</string>
    <boolean name="user_disable_finger_print" value="false" />
    <string name="rememberedUsername">teste@gmai.com</string>
    <boolean name="hasUserEverAuthenticated" value="true" />
</map>


You need to access the SharedPreferences the RememberedData and delete the fields that you need:

SharedPreferences sharedPrefVisa = context.getSharedPreferences("RememberedData", 0);
SharedPreferences.Editor editorVisa = sharedPrefVisa.edit();

editorVisa.remove("rememberedUsername").commit();
editorVisa.remove("hasUserEverAuthenticated").commit();
editorVisa.remove("hasUserUnremebered").commit();

Now it works! 🙂
candidosales
Helper

Re: Logout/LogOff in Visa Express Button (SDK Android)

I need more detail, the card image is saved, so I had to remove it when the user logs out of my app.

 

public void deleteImageCardVisa() {
        File file = new File("/data/data/com.yourapp/app_checkout" , "visa_card_art.png");
        file.delete();
    }
ricardo_visa
Community Scholar

Re: Logout/LogOff in Visa Express Button (SDK Android)

Glad to see it is working!




Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.