Git Product home page Git Product logo

eway-rapid-android's Introduction

eWAY Rapid Android Library

Quickly integrate eWAY payments into your Android app with this SDK! This SDK provides the following functions:

  • Encrypt card details for passing through the merchant's servers to eWAY
  • Complete a payment on a user's Android device
  • Translate response messages to user friendly text

Check out the eWAY Android SDK Getting Started Guide and the example projects for details on how to integrate eWAY with your app.

Sign up with eWAY at:

For testing, get a free eWAY Partner account: https://www.eway.com.au/developers

Requirements

The eWAY Android SDK requires a minimum Android SDK version 17

This SDK also supports ReactiveX, which requires rxandroid or rxjava

Installation

Installing eWAY Android SDK is quick and easy:

Gradle

Add the maven repository to your project's build gradle file under all projects:

repositories {
    mavenCentral()
}

Then add the dependency to the dependencies section of app’s build.gradle:

implementation 'com.ewaypayments:android-sdk:2.0.0'

Note : Starting with version 2.0.0, we changed groupId from com.eway.payment to com.ewaypayments, if you are using 2.0.0 and later version in your project, please modify the package reference in your project by yourself.

Usage

For the a complete guide to using the eWAY Android SDK, check out the Getting Started guide along with the example projects.

Example Projects

Example projects are included in the eWAY Android SDK GitHub repository to demonstrate the available functions. There are three projects to demonstrate different implementations of the SDK; synchronous, asynchronous and rxjava. To view and use an example;

  1. Clone the repository to your development machine

    git clone https://github.com/eWAYPayment/eway-rapid-android.git
    
  2. Open the project in Android Studio and let Gradle sync.

  3. Select a sample in Android Studio - optional: update the PublicAPIKey in the SampleMainActivity file to the one in your Sandbox.

  4. Hit the run button to view the sample in action.

License

The MIT License (MIT). Please see License File for more information.

eway-rapid-android's People

Contributors

alexanderparraeway avatar incarnate avatar jayzhang0507 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

qiubeijun

eway-rapid-android's Issues

404 not found RapidAPI.submitPayment

  • We have an issue while making a payment
    this result return from the action RapidAPI.submitPayment(transaction);
    made by android device

<-- 404 Not Found https://api.ewaypayments.com/payment (1008ms)
Cache-Control: no-store
Content-Type: application/json; charset=utf-8
X-EWAY-SERVER: M3
X-Frame-Options: SAMEORIGIN
X-Powered-By:
Server:
X-EWAY-RAPID: 3.0
p3p: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
X-ASPNET-VERSION:
Content-Length: 42
Date: Sun, 22 Nov 2020 09:33:15 GMT
Connection: close
Set-Cookie: BIGipServerVirtServerPool-019-SSL=!H0d+VCa+FOkcPb88pY5RVVkqfhddARihnAYIQTxzQ10+wNHeSZOozLEQduuVb4svH3FyQqQItDLv9AE=;secure; path=/
Strict-Transport-Security: max-age=15768000
{"Message":"Unknown Result","Errors":null}
<-- END HTTP (42-byte body)

CardDetails cardDetails = new CardDetails();
cardDetails.setName(cardName);
cardDetails.setExpiryMonth(expMonth);
cardDetails.setExpiryYear(expYear);

            EncryptItemsResponse nCryptedData = encryptCard(cardNumber, CVN);
            if (nCryptedData.getErrors() != null) {
                return errorHandler(RapidAPI.userMessage(Locale.getDefault().getLanguage(), nCryptedData.getErrors())
                        .getErrorMessages());
            }

            cardDetails.setNumber(nCryptedData.getItems().get(0).getValue());
            cardDetails.setCVN(nCryptedData.getItems().get(1).getValue());

            com.eway.payment.sdk.data.beans.Customer customerEWAY = new com.eway.payment.sdk.data.beans.Customer();
            customerEWAY.setFirstName(customer.getFirst_name1() + "");
            customerEWAY.setLastName(customer.getLast_name1() + "");
            customerEWAY.setEmail(customer.getEmail1());
            customerEWAY.setMobile(customer.getMobile1());
            customerEWAY.setPhone(customer.getPhone1());
            customerEWAY.setCardDetails(cardDetails);

            Address address = new Address();
            address.setCity(customer.getCity());
            address.setPostalCode(customer.getPostcode());
            address.setState(customer.getState());
            address.setStreet1(customer.getStreet_address());
            customerEWAY.setAddress(address);

            Payment payment = new Payment();
            payment.setCurrencyCode("AUD");

            int totalAmount = (int) (Float.parseFloat(paymentAmount) * 100);

            payment.setTotalAmount(totalAmount);
            payment.setInvoiceReference(UUID.randomUUID().toString());
            payment.setInvoiceDescription(comment);
            payment.setInvoiceNumber(invoice.getInvoice_number());

            Transaction transaction = new Transaction();
            transaction.setCustomer(customerEWAY);
            transaction.setTransactionType(TransactionType.Purchase);
            transaction.setPayment(payment);

Confilcted with mockito

Hi guys, I found an issue.
Your lib conflicted with mockito newer than 2.9.0 because of you using old version of net.bytebuddy:byte-buddy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.