Getting Started with the Payment Methods API on Android

    Make use of the Payment Methods API with the Android SDK.

    Create a PaymentMethod object

    To create a PaymentMethod object using the Payment Methods API with the Android SDK, use the appropriate PaymentMethodCreateParams creation method for your PaymentMethod.Type.

    PaymentMethodCreateParams.Card paymentMethodCreateParamsCard =
        mCardInputWidget.getCard().toPaymentMethodParamsCard();
    PaymentMethodCreateParams paymentMethodCreateParams =
        PaymentMethodCreateParams.create(paymentMethodCreateParamsCard);
    
    // create a PaymentMethod synchronously (don't call this on the UI thread)
    PaymentMethod paymentMethod =
        mStripe.createPaymentMethodSynchronous(paymentMethodCreateParams);
    

    Once you have a PaymentMethodCreateParams object, create a PaymentMethod with Stripe#createPaymentMethodSynchronous().

    Next steps

    Questions?

    We're always happy to help with code or other questions you might have. Search our documentation, contact support, or connect with our sales team. You can also chat live with other developers in #stripe on freenode.

    Was this page helpful? Yes No

    Send

    Thank you for helping improve Stripe's documentation. If you need help or have any questions, please consider contacting support.

    On this page