globalpayments / rxp-android

Global Payments Ecommerce Android Library
MIT License
8 stars 17 forks source link

when i integrate in my android application , my app crach #18

Open Osamasaqr84 opened 5 years ago

Osamasaqr84 commented 5 years ago

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());
    }