JoaoRSilverio / FastFoodFinderServer

fastly finds fast food.
GNU General Public License v3.0
0 stars 0 forks source link

Wirecard-react-native question. #3

Open AliaksandrNazarov opened 4 years ago

AliaksandrNazarov commented 4 years ago

Hello. I didn't find another way to ask you about wirecard-react-native package. I want to use it in my RN app. And the main question is: when it will be production ready? At least approximately? Thanks.

JoaoRSilverio commented 4 years ago

Hi no problem , hope its something i can help with.

On Mon, Jun 8, 2020, 3:37 PM AliaksandrNazarov notifications@github.com wrote:

Hello. I didn't find another way to ask you about wirecard-react-native package.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/JoaoRSilverio/FastFoodFinderServer/issues/3, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4K54YPKLY3WKQ46XUHRLTRVTSSDANCNFSM4NYNLYPA .

AliaksandrNazarov commented 4 years ago

And the main question is: when the 'wirecard-react-native' package will be production ready? At least approximately? Thanks.

JoaoRSilverio commented 4 years ago

Probably in a few months(1-2), right now its possible to make credit card payments, but not other types of payments.

On Mon, Jun 8, 2020, 4:06 PM AliaksandrNazarov notifications@github.com wrote:

And the main question is: when the 'wirecard-react-native' package will be production ready? At least approximately? Thanks.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JoaoRSilverio/FastFoodFinderServer/issues/3#issuecomment-640630869, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4K546BGADXEW6Y6YX24OLRVTV55ANCNFSM4NYNLYPA .

AliaksandrNazarov commented 4 years ago

Thanks for fast answer. Ok, I think our project needs just credit card payments, not more. Can I start using current rc2 version for implementation? Do you planning any breaking changes for prod version?

JoaoRSilverio commented 4 years ago

No, for prod version I plan having the other payment methods and the project listed on GitHub. But no breaking changes.

On Mon, Jun 8, 2020, 4:17 PM AliaksandrNazarov notifications@github.com wrote:

Thanks for fast answer. Ok, I think our project needs just credit card payments, not more. Can I start using current rc2 version for implementation? Do you planning any breaking changes for prod version?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JoaoRSilverio/FastFoodFinderServer/issues/3#issuecomment-640645414, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4K543SHHWF6GCPNLXX3PTRVTXHVANCNFSM4NYNLYPA .

AliaksandrNazarov commented 4 years ago

Thanks again, and have a nice day!

JoaoRSilverio commented 4 years ago

No prob, have a great day!

On Mon, Jun 8, 2020, 4:23 PM AliaksandrNazarov notifications@github.com wrote:

Thanks again, and have a nice day!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JoaoRSilverio/FastFoodFinderServer/issues/3#issuecomment-640652785, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4K544VXYQBIRIBNH2NKDLRVTX47ANCNFSM4NYNLYPA .

AliaksandrNazarov commented 4 years ago

Installed your package, did required steps. Builds failed on both platforms. Do i need any additional settings?

AliaksandrNazarov commented 4 years ago

Android:

AliaksandrNazarov commented 4 years ago

Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'. Could not find com.wirecard.ecom:card:3.4.0. Searched in the following locations:

AliaksandrNazarov commented 4 years ago

Ios: Nonnull' is disallowed with ARC if([paymentData objectForKey:@"orderID" != nil]){


/Users/AliaksandrNazarau/Documents/RB-mobileApp/node_modules/wirecard-react-native/ios/RNWirecard.m:174:34: warning: incompatible integer to pointer conversion sending 'int' to parameter of type 'id _Nonnull' [-Wint-conversion]
    if([paymentData objectForKey:@"orderID" != nil]){
                                 ^~~~~~~~~~~~~~~~~
In module 'Foundation' imported from /Users/AliaksandrNazarau/Documents/RB-mobileApp/ios/Pods/Headers/Public/React-Core/React/RCTDefines.h:9:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDictionary.h:17:46: note: passing argument to parameter 'aKey' here
- (nullable ObjectType)objectForKey:(KeyType)aKey;
                                             ^
/Users/AliaksandrNazarau/Documents/RB-mobileApp/node_modules/wirecard-react-native/ios/RNWirecard.m:177:48: error: implicit conversion of 'int' to 'id _Nonnull' is disallowed with ARC
    if([paymentData objectForKey:@"descriptor" != nil]) {
                                 ~~~~~~~~~~~~~~^~~~~~
/Users/AliaksandrNazarau/Documents/RB-mobileApp/node_modules/wirecard-react-native/ios/RNWirecard.m:177:34: warning: incompatible integer to pointer conversion sending 'int' to parameter of type 'id _Nonnull' [-Wint-conversion]
    if([paymentData objectForKey:@"descriptor" != nil]) {
                                 ^~~~~~~~~~~~~~~~~~~~
In module 'Foundation' imported from /Users/AliaksandrNazarau/Documents/RB-mobileApp/ios/Pods/Headers/Public/React-Core/React/RCTDefines.h:9:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDictionary.h:17:46: note: passing argument to parameter 'aKey' here
- (nullable ObjectType)objectForKey:(KeyType)aKey;
                                             ^
/Users/AliaksandrNazarau/Documents/RB-mobileApp/node_modules/wirecard-react-native/ios/RNWirecard.m:178:80: error: expected ';' after expression
        [order setDescriptor:(NSString * _Nullable) paymentData[@"descriptor"]]
                                                                               ^
                                                                               ;
/Users/AliaksandrNazarau/Documents/RB-mobileApp/node_modules/wirecard-react-native/ios/RNWirecard.m:180:21: error: no visible @interface for 'NSDictionary' declares the selector 'objectForKey:objectForKey:'
    if([paymentData objectForKey:@"orderID"!= nil || paymentData objectForKey:@"orderID"!= nil ]){
        ~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
JoaoRSilverio commented 4 years ago

I'll look into this, can you you try using rc1 ? It seems to be related to recent changes. The only dif between rc1 and rc2 is the orderId and descriptor.

On Mon, Jun 8, 2020, 6:37 PM AliaksandrNazarov notifications@github.com wrote:

Ios: Nonnull' is disallowed with ARC if([paymentData objectForKey:@"orderID" != nil]){


/Users/AliaksandrNazarau/Documents/RB-mobileApp/node_modules/wirecard-react-native/ios/RNWirecard.m:174:34:
warning: incompatible integer to pointer conversion sending 'int' to
parameter of type 'id _Nonnull' [-Wint-conversion]
if([paymentData objectForKey:@"orderID" != nil]){
^~~~~~~~~~~~~~~~~
In module 'Foundation' imported from
/Users/AliaksandrNazarau/Documents/RB-mobileApp/ios/Pods/Headers/Public/React-Core/React/RCTDefines.h:9:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDictionary.h:17:46:
note: passing argument to parameter 'aKey' here

   - (nullable ObjectType)objectForKey:(KeyType)aKey;
   ^
   /Users/AliaksandrNazarau/Documents/RB-mobileApp/node_modules/wirecard-react-native/ios/RNWirecard.m:177:48:
   error: implicit conversion of 'int' to 'id _Nonnull' is disallowed with ARC
   if([paymentData objectForKey:@"descriptor" != nil]) {
   ~~~~~~~~~~~~~~^~~~~~
   /Users/AliaksandrNazarau/Documents/RB-mobileApp/node_modules/wirecard-react-native/ios/RNWirecard.m:177:34:
   warning: incompatible integer to pointer conversion sending 'int' to
   parameter of type 'id _Nonnull' [-Wint-conversion]
   if([paymentData objectForKey:@"descriptor" != nil]) {
   ^~~~~~~~~~~~~~~~~~~~
   In module 'Foundation' imported from
   /Users/AliaksandrNazarau/Documents/RB-mobileApp/ios/Pods/Headers/Public/React-Core/React/RCTDefines.h:9:
   /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDictionary.h:17:46:
   note: passing argument to parameter 'aKey' here
   - (nullable ObjectType)objectForKey:(KeyType)aKey;
   ^
   /Users/AliaksandrNazarau/Documents/RB-mobileApp/node_modules/wirecard-react-native/ios/RNWirecard.m:178:80:
   error: expected ';' after expression
   [order setDescriptor:(NSString * _Nullable) paymentData[@"descriptor"]]
   ^
   ;
   /Users/AliaksandrNazarau/Documents/RB-mobileApp/node_modules/wirecard-react-native/ios/RNWirecard.m:180:21:
   error: no visible @interface <https://github.com/interface> for
   'NSDictionary' declares the selector 'objectForKey:objectForKey:'
   if([paymentData objectForKey:@"orderID"!= nil || paymentData
   objectForKey:@"orderID"!= nil ]){
   ~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://github.com/JoaoRSilverio/FastFoodFinderServer/issues/3#issuecomment-640740220>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE4K54ZAYFBKISZRGREZHC3RVUHV5ANCNFSM4NYNLYPA>
.
AliaksandrNazarov commented 4 years ago

Ok. I'll try rc1 version.

AliaksandrNazarov commented 4 years ago

Add new RNWirecardPackage() to the list returned by the getPackages() method

In MainActivity or MainApplication file?

JoaoRSilverio commented 4 years ago

In mainApplication.java in the android/app/src/main/java/com/yourapp folder

On Mon, Jun 8, 2020, 6:44 PM AliaksandrNazarov notifications@github.com wrote:

Add new RNWirecardPackage() to the list returned by the getPackages() method

In MainActivity or MainApplication file?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JoaoRSilverio/FastFoodFinderServer/issues/3#issuecomment-640743850, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4K54Y2RLGNC2S64XOIU73RVUIQDANCNFSM4NYNLYPA .

AliaksandrNazarov commented 4 years ago

Ok, I did as you wrote. Ios build is success with rc1 Android failed with same error

JoaoRSilverio commented 4 years ago

Try clearing android cache with "cd android && ./gradlew clean" from react-native app folder

On Mon, Jun 8, 2020, 6:52 PM AliaksandrNazarov notifications@github.com wrote:

Ok, I did as you wrote. Ios build is success with rc1 Android failed with same error

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JoaoRSilverio/FastFoodFinderServer/issues/3#issuecomment-640747666, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4K542ESQA57IXXK5MSUM3RVUJLTANCNFSM4NYNLYPA .

AliaksandrNazarov commented 4 years ago

I did it, and reset cache of bundler. Also reinstall node modules.

AliaksandrNazarov commented 4 years ago

Hello. Are you here?

AliaksandrNazarov commented 4 years ago

Trying to install package again. Is manual installation required?

AliaksandrNazarov commented 4 years ago

Error without manual installation is same. http://wirecard.github.io/paymentSDK-Android/integration/latest/Migration/ Read this docs, added: maven { url "https://dl.bintray.com/wirecard/ecom-android" } to build.gradle, and got new error: Could not determine the dependencies of task ':wirecard-react-native:compileDebugAidl'.

Could not resolve all task dependencies for configuration ':wirecard-react-native:debugCompileClasspath'. Could not find com.facebook.react:react-native:0.59.10. Required by: project :wirecard-react-native

AliaksandrNazarov commented 4 years ago

As result for now:

  1. added mavenCentral() maven { url "https://dl.bintray.com/wirecard/ecom-android" } to: my project foldes/android/build.gradle
  2. Changed implementation 'com.facebook.react:react-native:0.59.10' to implementation 'com.facebook.react:react-native:+' in node_modules/wirecard-react-native/android/build.gradle After that build process goes deeper and failed in: node_modules/wirecardreactnative/android/src/main/java/com/rnwirecard/RNWirecardModule.java Error: Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 /Users/AliaksandrNazarau/Documents/RB-mobileApp/node_modules/wirecard-react-native/android/src/main/java/com/rnwirecard/RNWirecardModule.java:130: error: cannot find symbol .setCurrency(paymentInfo.getString("currency")).setDescriptor(paymentInfo.getString("descriptor")) ^ symbol: method setDescriptor(String) location: class Builder 1 error
AliaksandrNazarov commented 4 years ago

Sometimes I hate RN)) I started the package on android, totally:

  1. Added to android/build.gradle maven { url "https://dl.bintray.com/wirecard/ecom-android" }
  2. In node_modules/wirecard-react-native/android/build.gradle: implementation 'com.facebook.react:react-native:+'
  3. In android/build.gradle: minSdkVersion = 21 it was 16 by default, your package using 19. So, I need to set it to 19, but in the same time we need to set 'multiDexEnabled true', 21's version has it by default
  4. When i wrote about: cannot find symbol .setCurrency(paymentInfo.getString("currency")).setDescriptor(paymentInfo.getString("descriptor")) ^ symbol: method setDescriptor(String)

I using rc2 version, but rc1 hasn't this two methods: setDescriptor, setOrderId If this methods are commented in rc2 version, the build is successful (but failed on ios)

Explain the points please. Thank you.

JoaoRSilverio commented 4 years ago

Hi , I added the correct steps to have a functional android version to the readme also added some more working fields , will try to review the ios instalation steps soon,and then upload a working example app on github.

On Tue, Jun 9, 2020 at 4:56 PM AliaksandrNazarov notifications@github.com wrote:

Sometimes I hate RN)) I started the package on android, totally:

  1. Added to android/build.gradle maven { url "https://dl.bintray.com/wirecard/ecom-android" }
  2. In node_modules/wirecard-react-native/android/build.gradle: implementation 'com.facebook.react:react-native:+'
  3. In android/build.gradle: minSdkVersion = 21 it was 16 by default, your package using 19. So, I need to set it to 19, but in the same time we need to set 'multiDexEnabled true', 21's version has it by default
  4. When i wrote about: cannot find symbol

    .setCurrency(paymentInfo.getString("currency")).setDescriptor(paymentInfo.getString("descriptor")) ^ symbol: method setDescriptor(String)

I using rc2 version, but rc1 hasn't this two methods: setDescriptor, setOrderId If this methods are commented in rc2 version, the build is successful (but failed on ios)

Explain the points please. Thank you.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JoaoRSilverio/FastFoodFinderServer/issues/3#issuecomment-641351553, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4K543FTBFDFENABDWQJZ3RVZER3ANCNFSM4NYNLYPA .

AliaksandrNazarov commented 4 years ago

Hello. Good news! Thanks! I'll test rc3 now.

AliaksandrNazarov commented 4 years ago

Tested rc3, android is working after installation notes. Waiting updating for ios) The ios build is failed now, with same error as in rc2 version.

AliaksandrNazarov commented 4 years ago

What part of wirecard docs I can use for testing? I'm about mockPayment data. Now I'm trying to use info from here https://doc.wirecard.com/CC_Main.html#CreditCard_PaymentModeCountriesandCurrencies Right?

JoaoRSilverio commented 4 years ago

Yes, and then you can use these cards to test

https://doc.wirecard.com/CC_Main.html#API_CC_TestCards

On Wed, Jun 10, 2020, 2:19 PM AliaksandrNazarov notifications@github.com wrote:

What part of wirecard I can use for testing? I'm about mockPayment data. Now I'm trying to use info from here

https://doc.wirecard.com/CC_Main.html#CreditCard_PaymentModeCountriesandCurrencies Right?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JoaoRSilverio/FastFoodFinderServer/issues/3#issuecomment-641965828, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4K542U6SCUK2M5R4EYLJLRV524RANCNFSM4NYNLYPA .

AliaksandrNazarov commented 4 years ago

What did you use for cardholder name?

AliaksandrNazarov commented 4 years ago

And merchantId?

AliaksandrNazarov commented 4 years ago

For now I got only: transaction failed :( General error occurred

And wirecard client never ask password.

JoaoRSilverio commented 4 years ago

It accepts any cardholder name MerchantId: 33f6d473-3036-4ca5-8c64dac862d1

Also you have to generate the signature. Theres a commented out method in the java file for this if you want to test.

On Wed, Jun 10, 2020, 2:50 PM AliaksandrNazarov notifications@github.com wrote:

And merchantId?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JoaoRSilverio/FastFoodFinderServer/issues/3#issuecomment-641984717, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4K544FGYGVJXRCQPQ3ZK3RV56QBANCNFSM4NYNLYPA .

AliaksandrNazarov commented 4 years ago
const mockPayment = {
  amount: '0.99',
  currency: CURRENCYS.EURO,
  // transactionType: TRANSACTION_TYPES.PURCHASE, // only purchase supported for now
  paymentMethod: PAYMENT_METHODS.CARD.paymentMethod,
  signature: 'baCkEndGeneRat3D5iGN4TuR3.==',
  requestID: 'testId',
  merchantID: '33f6d473-3036-4ca5-8c64dac862d1',
  notificationUrl: 'https://my-backend.com/api/my-notifications-endpoint',
  setAttempt3d: false,
  setRecurring: false,
  setRequireManualCardBrandSelection: false,
  setAnimatedCardPayment: true,
}

Снимок экрана 2020-06-10 в 16 11 19

transaction failed :( General error occurred

AliaksandrNazarov commented 4 years ago

What I do wrong? Signature should be a new every time?

JoaoRSilverio commented 4 years ago

You have to generate a signature the signature in the example wont work its just a placeholder, in wirecard documentation it shows how to generate it. Basically your backend should generate it in the production app, but for testing theres a function in the wirecardModule.java that you can use. And it will generate the signature in the java side.

On Wed, Jun 10, 2020, 3:12 PM AliaksandrNazarov notifications@github.com wrote:

What I do wrong?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JoaoRSilverio/FastFoodFinderServer/issues/3#issuecomment-641998631, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4K544KNQIALXKEADRIQXLRV6BEVANCNFSM4NYNLYPA .

AliaksandrNazarov commented 4 years ago

Thanks. My knowledge in java isn't deep or wide, can you explain to me the name of this function and how i can use it, please? (generate signature).

AliaksandrNazarov commented 4 years ago

RNWirecardModule - I search in this module, and can't understand what the function or method is.

AliaksandrNazarov commented 4 years ago

Can you share implementation of fn for generating signature, please?

AliaksandrNazarov commented 4 years ago

Hello. Did you test payment flow on android? Today my collaegue with me implemented signature method, tested it on data from example - got same result. But every time I got error: transaction failed :( General error occurred

AliaksandrNazarov commented 4 years ago

We successfully finished generating signature. The problem was in date format, we used format with milliseconds, but format should be without it.

AliaksandrNazarov commented 4 years ago

When you planning to fix ios builds? And same question about customization UI.

AliaksandrNazarov commented 4 years ago

Thanks.

JoaoRSilverio commented 4 years ago

Yes I'm planning to look into it this weekend, and provide an react-native example app with working payments. In regards to the customization I'm going to focus on testing and working examples first and then I'll add it.