Braintree + Google Pay got DEVELOPER_ERROR (statusCode=10) - java

We developing app for food ordering. In this case we implemented Braintree payment. All is well. The next step is to implement Google Pay (I pay your attention, NOT Android Pay).
I used this documentation:
Braintree Docs:
https://developers.braintreepayments.com/guides/pay-with-google/configuration/android/v2
Google PwG Docs:
https://developers.google.com/payments/setup
This how do we implemented Google Pay:
private GooglePaymentRequest getGooglePaymentRequest(String total) {
return new GooglePaymentRequest()
.transactionInfo(TransactionInfo.newBuilder()
.setTotalPrice(total)
.setTotalPriceStatus(WalletConstants.TOTAL_PRICE_STATUS_FINAL)
.setCurrencyCode("AUD")
.build())
.emailRequired(false)
.shippingAddressRequired(false)
.phoneNumberRequired(false)
.allowPrepaidCards(true)
.billingAddressRequired(false);
}
And use:
String total = String.format(Locale.getDefault(), "%1$.2f", basket.total);
DropInRequest dropInRequest = new DropInRequest()
.clientToken(clientToken)
.amount(total)
.googlePaymentRequest(getGooglePaymentRequest(total))
.collectDeviceData(true);
getMvpView().showBraintreePaymentScreen(dropInRequest);
In this case we got two situations:
On my colleague's device all is working well (video: https://drive.google.com/open?id=1wEXbv8qzGXzuXWDUy7-bhIdud_4H_s2V)
On my side I got crash (video: https://drive.google.com/open?id=15gvtkNGZ9w6v1ym7cDkwWCnqHh5JUvL7)
After this I started debug and observed next situation:
As you see in Braintree's BaseActivity I got exception with statusCode=10 that means DEVELOPER_ERROR.
So is anyone have thoughs how it can be fixed?

I ran into the same error implementing Google Pay and I found the answer to my problem here:
https://developers.google.com/pay/api/android/support/troubleshooting
Quote:
The most common error message is ERROR_CODE_DEVELOPER_ERROR. This error message also appears in the UI as a dialog with the following text:
Request Failed
An unexpected error has occurred. Please try again later.
To learn more about this error, follow these steps:
Make sure ADB is installed on your computer.
Make sure USB debugging is enabled on your device.
Connect your phone to the computer using a USB cable.
Run the following command in a terminal or command prompt on your computer:
adb -d logcat -s WalletMerchantError
The response indicates the underlying reason for the error. For example, you may see:
02-26 17:41:28.133 14593 14593 W WalletMerchantError: Error in
loadPaymentData: This merchant profile does not have access to this
feature.
Note: The error only becomes visible in logcat after you've pressed OK to close the alert.
The action you need to take to resolve the issue depends on the error message.

Related

How to register a new user in ejabberd

From egoscia's answer on the question Register a new user in ejabberd using Erlang, he says in the accepted answer that you can add a new user using:
ejabberd_auth:try_register(<<"username">>, <<"example.com">>, <<"secret_password">>).
I tried using this in erlang, but I get the error:
** exception error: undefined function ejabberd_auth:try_register/3
This is a snippet of how I go about it:
-import(ejabberd_auth, [try_register/3]).
start() ->
io:fwrite("Hello World!\nThis is Sound\n"),
% Chat
ejabberd_auth:try_register(<<"username">>, <<"example.com">>, <<"secret_password">>).
How should I go about it erlang? Java/ Android/ C++/ Qt suggestions also welcome.
Thank you all in advance.
** exception error: undefined function ejabberd_auth:try_register/3
Oh, that code works for me using ejabberd 18.03. I start ejabberd in live mode, so I have access to the erlang shell, and I can run correctly:
$ ejabberdctl live
...
(ejabberd#localhost)2> ejabberd_auth:try_register(<<"user6">>, <<"localhost">>, <<"somepass">>).
ok
Maybe you are using an old ejabberd version that doesn't still export ejabberd_auth:try_register/3 ?

How to close/kill an app on android device using appium?

To kill/close app I tried driver.close(), driver.closeApp(), driver.quit() but the app keeps running on the background.
Should one of these commands really close the application? If so, the how? If not - could someone offer an alternative solution?
None of the method that you are calling removes the app from background while using appium. This is what they refer to :
((AppiumDriver)driver).closeApp(); // Close the app which was provided in the capabilities at session creation
((AppiumDriver)driver).close(); // from *RemoteWebDriver.java*, used to close the current browser page
((AppiumDriver)driver).quit(); // quits the session created between the client and the server
so what you could possibly try and do is :
((AppiumDriver)driver).resetApp(); // Reset the currently running app for this session
OR try a combination of these two :
((AppiumDriver)driver).removeApp(<package name>); // Remove the specified app from the device (uninstall)
((AppiumDriver)driver).installApp(<path to apk>); // Install an app on the mobile device
I would suggest :
resetApp()
closeApp()
removeApp()
You can refer to this link : Java-client Appium
To close the app sesssion use the following command:
driver.resetApp();
If you have the apk installation as part of the script, you can use inbuilt appium capabiltiy which closes and removes the app. And when you trigger the script again it checks whether it exists in device and if not will install it,
capabilities.setCapability("fullReset", true);
also you can try a manual way like this,
//This code will press your android device's recent button :
$driver.pressKeyCode(AndroidKeyCode.KEYCODE_APP_SWITCH);
//and click to the close button of you application:
$driver.findElement(By.id("id of the element to close app")).click();
I hope it helps
Set your capabilities
cap.setCapability("fullReset", false);
cap.setCapability("noReset", true);
Logic
driver.closeApp();
Boolean b = driver.isAppInstalled("here put your app's bundle ID");
if (b == true) {
driver.launchApp();
} else {
driver.installApp(app.getAbsolutePath());
}
Maybe you need to maneuver the code a bit as per your requirements.
None of the above worked for me in Python, so I just adb shelled on to the device to reset the app cache. This removes the app from recent processes and stops it running in the background.
os.system('adb shell "pm clear ' + desired_caps1["appPackage"] + '"')
desired_caps1 is the desired capabilites within my external JSON file, and obviously "appPackage" is just the package name for the app, for eg: com.example.id
For nativescript-dev-appium
version 6.1.0 release,
driver.closeApp() and driver.launchApp() are combined, use:
driver.restartApp()
To kill/terminate an app, as of Appium 1.6.0 if you use UIAutomator2 driver you can use this in Java:
driver.terminateApp(packagename);
where packagename is your app package, e.g. com.twitter.android
See http://appium.io/docs/en/commands/device/app/terminate-app/ for reference

Paypal Recurring Direct payment issue

For the last two days I am trying to figure out this issue but so far i've been unable to solve it. I am successfully creating/deleting Recurring profiles in Paypal Express checkout(sandbox mode).Now im facing issues with the direct payment. Yesterday I created two profiles using the following piece of code and got the responses as shown below. Unfortunately my account activity isnt showing any of this profile creation. Can you tell me why? At the same time I created it with express checkout and that activity is present in my account.
Any help is highly appreciated.
encoder.add("VERSION", "86.0");
encoder.add("METHOD","CreateRecurringPaymentsProfile");
encoder.add("DESC","Cloudstream10UserPack");
encoder.add("INITAMT","25.29");
encoder.add("FAILEDINITAMTACTION","ContinueOnFailure");
encoder.add("BILLINGPERIOD","Day");
encoder.add("BILLINGFREQUENCY","1");
encoder.add("PROFILESTARTDATE","2015-06-04T00:00:00Z");
encoder.add("CURRENCYCODE","USD");
encoder.add("COUNTRYCODE","US");
encoder.add("MAXFAILEDPAYMENTS","3");
encoder.add("AMT",amount);
encoder.add("CREDITCARDTYPE",cardType);
encoder.add("ACCT",acct);
encoder.add("EXPDATE",expdate);
encoder.add("CVV2",cvv2);
encoder.add("FIRSTNAME",firstName);
encoder.add("LASTNAME",lastName);
response
{VERSION=86.0,
BUILD=16837281,
TRANSACTIONID=03H59687N1667990E,
PROFILEID=I-4K9NPGAHRM34,
PROFILESTATUS=PendingProfile,
ACK=Success, CORRELATIONID=2f485d30ec1f4,
TIMESTAMP=2015-06-03T08:25:38Z}
In the second profile I removed INITAMT and FAILEDINITAMTACTION and got the following response:
{VERSION=86.0,
BUILD=16837281,
PROFILEID=I-W0CRGLBCJTBB,
PROFILESTATUS=ActiveProfile,
ACK=Success,
CORRELATIONID=6002b88159503,
TIMESTAMP=2015-06-03T11:58:02Z}
I made third profile right now and got response and when I check the activity I got nothing updated
{VERSION=86.0,
BUILD=16837281,
PROFILEID=I-YV4LTS1JGUJ1,
PROFILESTATUS=ActiveProfile,
ACK=Success,
CORRELATIONID=c322b816c1403,
TIMESTAMP=2015-06-05T07:25:41Z}

Failed to open rtlsdr device #0

We have the task to use some piece of hardware to analyse the signals send by a glider plane, like ADSB or ELT.
For this we decided to use the following hardwarestick:
link
We want to use the rtl_tcp tool to get the information to the program.
My problem is that I always get this message:
C:\MyProject\rtlsdr\x64>rtl_test
Found 1 device(s):
0: Generic RTL2832U (e.g. hama nano)
Using device 0: Generic RTL2832U (e.g. hama nano)
Failed to open rtlsdr device #0.
does anyone know what the problem could be? i tryed reinstalling the driver over zadig multiple times, without success.
the driver i choose was: WinUSB (v6.1.7600.16385)

TwitterException {statusCode=403, retryAfter=0, rateLimitStatus=null}

I have recently noticed that I keep getting a 403 error while doing twitter search. My application was working until couple of days back when i noticed the error.
I checked with Twitter & they say my IP is not blocked, I am also within the rate limit = about 60 search requests/per hour.
Here's how i was initializing the Twitter object -
private static Twitter TWITTER_CLIENT = new TwitterFactory().getInstance();
After i noticed the error, i tried the following & still no success -
private static Twitter TWITTER_CLIENT = new TwitterFactory().getInstance("user", "password");
Here's how i am searching -
TWITTER_CLIENT.search(new Query("#keyword1 OR #keyword2"));
I tried this URL (curl http://search.twitter.com/search.json?q=ipad) from my server & it works alright.
Following is the exception. I am on java6 + Twitter4j v2.1.2. Would really appreciate any help. Thanks.
TwitterException{statusCode=403, retryAfter=0, rateLimitStatus=null}
at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:301)
at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:68)
at twitter4j.internal.http.HttpClientWrapper.get(HttpClientWrapper.java:82)
at twitter4j.Twitter.search(Twitter.java:193)
Most likely the reason is basic auth shutdown by Twitter (aka OAuthcalypse):
Basic Auth Shutdown
You need to switch to using OAuth.
Recently i got the same error while executing similar code.
To fix it, please go to
https://apps.twitter.com/app/your_app_id
Click on Keys and access token
In Access Level, click modify app permission and choose the 3rd option: Read, Write and Access direct messages
Click on update. ( Note: you might have to add your mobile no and verify with otp to get this access if you dont have your no added in twitter)
Regenerate both Consumer key & secretand Access token & secret using the clickable button
Us e the new keys in your program
And you are done! Your program will start working.

Categories