Trying to do react-native bridge module I keep getting dependency couldn't be found
This is my first time trying to do react-native bridge. Problem is it always says it couldnt find the dependency, irrespective of my integration, I should be able to download the dependency right? I am trying to bridge: https://developer.imepay.com.np/#/andriod-sdk
I am not being able to implement the dependecy:
implementation 'com.swifttechnology.imepaysdk:payment-service:4.0.1
In my main/java/imepayintegration: ImepayModule.java:
package com.reactnativeimepay; import androidx.annotation.NonNull; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import com.facebook.react.bridge.Promise; import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import java.util.Map; import java.util.HashMap; import com.swifttechnology.imepaysdk.IMEPayment; import com.swifttechnology.imepaysdk.IMEPaymentCallback; import com.swifttechnology.imepaysdk.ENVIRONMENT; public class ImepayModule extends ReactContextBaseJavaModule { private final ReactApplicationContext reactContext; public ImepayModule(ReactApplicationContext reactContext) { super(reactContext); this.reactContext = reactContext; } @Override public String getName() { return "ImepayModule"; } @ReactMethod public void performPayment(String merchantCode, String merchantName, String module, String username, String password, String referenceValue, String amount, String merchantTransactionRecordingUrl, Promise promise) { IMEPayment imePayment = new IMEPayment(reactContext, ENVIRONMENT.TEST); imePayment.performPayment(merchantCode, merchantName, merchantTransactionRecordingUrl, amount, referenceValue, module, username, password, new IMEPaymentCallback() { @Override public void onSuccess(int responseCode, String responseDescription, String transactionId, String msisdn, String amount, String refId) { promise.resolve("Payment successful"); } @Override public void onError(int responseCode, String responseDescription) { promise.reject("ERROR", responseDescription); } }); } }
ImepayPackage.java:
package com.reactnativeimepay; import java.util.Arrays; import java.util.Collections; import java.util.List; import com.facebook.react.ReactPackage; import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.uimanager.ViewManager; public class ImepayPackage implements ReactPackage { @Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { return Arrays.<NativeModule>asList(new ImepayModule(reactContext)); } @Override public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) { return Collections.emptyList(); } }