Getting Started with PaymentMethods in the Android SDK

    Make use of PaymentMethods with the Android SDK.

    Creating a payment using PaymentMethods with the Android SDK is a multi-step process:

    1. Create a PaymentMethod object that represents your customer's payment method
    2. Check if further action is required from your customer

    Create a PaymentMethod object

    To create a PaymentMethod object, use the appropriate PaymentMethodCreateParams.create method for your PaymentMethod type.

    • create(PaymentMethodCreateParams.Card card, PaymentMethod.BillingDetails billingDetails)
    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, PUBLISHABLE_KEY);
    

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

    More information

    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.