globalpayments / rxp-android Goto Github PK
View Code? Open in Web Editor NEWGlobal Payments Ecommerce Android Library
License: MIT License
Global Payments Ecommerce Android Library
License: MIT License
please provide proper guideline to implement in android help
How can I change the background color for lightbox?
In android i have got this error
my sha-1 hash key is perfect and its working in ios but got this error in android
When I add the dependency
compile 'com.realexpayments.hpp.sdk:rxp-hpp-android:1.2'
I get this crash error:
java.lang.RuntimeException: Retrofit detected an unsupported OkHttp on the classpath.
To use OkHttp with this version of Retrofit, you'll need:
1. com.squareup.okhttp:okhttp:1.6.0 (or newer)
2. com.squareup.okhttp:okhttp-urlconnection:1.6.0 (or newer)
Note that OkHttp 2.0.0+ is supported!
at retrofit.Platform.hasOkHttpOnClasspath(Platform.java:186)
at retrofit.Platform.access$300(Platform.java:37)
at retrofit.Platform$Android.defaultClient(Platform.java:122)
at retrofit.RestAdapter$Builder.ensureSaneDefaults(RestAdapter.java:686)
at retrofit.RestAdapter$Builder.build(RestAdapter.java:676)
at com.realexpayments.hpp.ApiAdapter.getAdapter(ApiAdapter.java:19)
at com.realexpayments.hpp.HPPManagerFragment.onAttach(HPPManagerFragment.java:93)
at android.app.Fragment.onAttach(Fragment.java:1464)
So adding
compile 'com.squareup.okhttp:okhttp:1.6.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:1.6.0'
I get this error response in hppManagerFailedWithError method:
No virtual method open(Ljava/net/URL;)Ljava/net/HttpURLConnection; in class Lcom/squareup/okhttp/OkHttpClient; or its super classes (declaration of 'com.squareup.okhttp.OkHttpClient' appears in /data/app/com.geomobile.tmbmobile-pmA28ANdnNr8GrLjnwqjlQ==/split_lib_dependencies_apk.apk!classes62.dex)
With updated dependencies to:
compile 'com.squareup.okhttp:okhttp:2.7.5'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
the error changes to
No field METHODS of type Ljava/util/Set; in class Lcom/squareup/okhttp/internal/http/HttpMethod; or its superclasses (declaration of 'com.squareup.okhttp.internal.http.HttpMethod' appears in /data/app/com.geomobile.tmbmobile-Z0HuYnHyWLHllogWx4xbUw==/split_lib_dependencies_apk.apk!classes62.dex)
In my app i'm already using retrofit 2 and okhttp 3
compile 'com.squareup.retrofit2:retrofit:2.2.0'
compile 'com.squareup.retrofit2:converter-gson:2.2.0'
compile 'com.squareup.okhttp3:okhttp:3.6.0'
Any advice? Thanks!
Hello,
I have some help for RXP integration in android. I have also check all documentation for RXP integration in android. But i have some issue in call payment api so please give me a simple demo for rxp-hpp-android
Thanks.
The request producer call returned a blank response (which isn't correct) but that causes the whole app to crash:
java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Set java.util.Map.keySet()' on a null object reference
at com.realexpayments.hpp.HPPManagerFragment.getHPPPostData(HPPManagerFragment.java:283)
at com.realexpayments.hpp.HPPManagerFragment.success(HPPManagerFragment.java:269)
at com.realexpayments.hpp.HPPManagerFragment.success(HPPManagerFragment.java:59)
at retrofit.CallbackRunnable$1.run(CallbackRunnable.java:45)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
When a successful result has been received by the SDK it uses Gson to convert the JSON code into a class. To get the class type the following code is executed in HppManagerFragment in the callbackHandler():
method.getParameterTypes()[0]
When mListener is written in Java, this code will complete successfully. When mListnener is written in Kotlin, instead of the ConsumerResponse type, 'Object' is returned, causing Gson to throw a ClassCastException.
Please make your SDK compatible with Kotlin.
When minimised using Proguard listed below, a ClassCastException occurs.
I believe that this is caused by the following lines (309 - 313 of HPPManagerFragment)
try {
mListener.hppManagerCompletedWithResult(ApiAdapter.getGson().fromJson(msg, method.getParameterTypes()[0]));
} catch (Exception error) {
mListener.hppManagerFailedWithError(new HPPError(msg, error, hppManager.getHppResponseConsumerURL()));
}
Proguard configuration
# Realex Payment
-keep class com.realexpayments.hpp.** { *; }
-keep class com.ex.ample.sync.dto.ConsumerResponse { *; }
-keepattributes Signature
-keepattributes *Annotation*
-keep class sun.misc.Unsafe { *; }
# Prevent proguard from stripping interface information from TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer
when i integrate in my android application , my app crach in code line
RealexClient client = new RealexClient("Po8lRRT67a", httpConfiguration);
with error message :
E/UncaughtException: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/client/config/RequestConfig;
and my full integrated code is
Card card = new Card()
.addType(Card.CardType.VISA)
.addNumber("4263970000005262")
.addExpiryDate("0121")
.addCvn("123")
.addCvnPresenceIndicator(Cvn.PresenceIndicator.CVN_PRESENT)
.addCardHolderName("James Mason");
PaymentRequest request = new PaymentRequest()
.addType(PaymentRequest.PaymentType.AUTH)
.addMerchantId("realexsandbox")
.addAccount("internet")
.addAmount(1001)
.addCurrency("GBP")
.addCard(card)
.addAutoSettle(new AutoSettle().addFlag(AutoSettle.AutoSettleFlag.TRUE));
HttpConfiguration httpConfiguration = new HttpConfiguration();
httpConfiguration.setEndpoint("https://test.realexpayments.com/epage-remote.cgi");
RealexClient client = new RealexClient("Po8lRRT67a", httpConfiguration);
try {
PaymentResponse response = client.send(request);
String result = response.getResult(); // '00' == success
// get the details required for Transaction Management requests
String paymentsReference = response.getPaymentsReference();
String orderId = response.getOrderId();
String authCode = response.getAuthCode();
Log.d("response",response.getMessage());
}
catch (RealexServerException e) {
Log.d("error",e.getMessage());
}
catch (RealexException e) {
Log.d("error",e.toString());
}
I've implemented the hppManager as described, translating the Java to Kotlin and have matched the iOS implementation which has worked flawlessly, however I get 401 unauthorized errors.
Any suggestions how to resolve those errors?
Issue reported via Sentry.io using v2.0
Here is the Log from Sentry:
java.lang.NullPointerException: Attempt to invoke interface method 'void com.realexpayments.hpp.HPPManagerListener.hppManagerFailedWithError(com.realexpayments.hpp.HPPError)' on a null object reference
at com.realexpayments.hpp.HPPManagerFragment$3.onReceivedError(HPPManagerFragment.java:251)
at Uy0.c(chromium-TrichromeWebViewGoogle.aab-stable-495106133:160)
at P9.handleMessage(chromium-TrichromeWebViewGoogle.aab-stable-495106133:521)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:8043)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:620)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1011)
The label app-name conflicts with the similar named label in my own app. Since this label is not needed in a library, could you please remove it?
Dear Realexpayments,
We use android.support.v4.Fragment classes in our project and we cannot use them in combination with HPPFragment, which is of type android.app.Fragment. Looking at your code it would be possible to extend the HPPManager interface with something like manager.newCompatInstance() and return a HPPManager fragment with type android.support.v4.Fragment.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.