Code Monkey home page Code Monkey logo

androidcreditcard's Introduction

AndroidCreditCard

Using Stripe API Here I used PayPal and Stripe API In PayPalWallet I used Stripe API(I forgot to change the name). How I used it? At first add to gradle this

compile 'com.stripe:stripe-android:6.1.2'
compile 'com.stripe:stripe-java:5.35.0'

The second thing is to add credit card input. So we must to add CardMultilineWidget This is xml file with CardMultilineWidget

    <com.stripe.android.view.CardMultilineWidget
        android:id="@+id/cc"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        />

After this we can work with activity. Here I will show simple things like: get information.

card.validateNumber();
card.validateCVC();

With valiation we understand is this card real or not. For example we can check it like here

if(!card.validateCard()) {
    ...
}

The next thing is getting information form credit card. How we cand do this? It's very easy.

String cardNumber = card.getNumber();
Integer cardExpMonth = card.getExpMonth();
Integer cardExpYear = card.getExpYear();
String cardCVC = card.getCVC();
card.setNumber(cardNumber);
card.setExpMonth(cardExpMonth);
card.setExpYear(cardExpYear);
card.setCVC(cardCVC);

I think I will not explain what this code do cause everythig here is understandable. Also using a Stripe we can send all information to server and from server see all our clients in workspace(if you registered there). You can make server using NodeJS or PHP. But how it works? Well everything I mean all main informaion is generated to token and then this token is sending to server. It's easy. I think that's all. Maybe sometimes I will updated my code and this short article.

androidcreditcard's People

Contributors

ladroid avatar

Watchers

 avatar  avatar

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.