Android™ Stripe: Verify a Bank Account

Back to Index

Verifies a customer's bank account.

Documentation: https://stripe.com/docs/api/curl#customer_verify_bank_account

CURL Command

curl https://api.stripe.com/v1/customers/cus_CBbg3iRMzWBjoe/sources/ba_1BnETKGswQrCoh0XzgjB3t99/verify \
   -u STRIPE_SECRET_KEY: \
   -d amounts[]=32 \
   -d amounts[]=45 \
   -X POST

Android™ Example

// Important: Don't forget to include the call to System.loadLibrary
// as shown at the bottom of this code sample.
package com.test;

import android.app.Activity;
import com.chilkatsoft.*;

import android.widget.TextView;
import android.os.Bundle;

public class SimpleActivity extends Activity {

  private static final String TAG = "Chilkat";

  // Called when the activity is first created.
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    CkRest rest = new CkRest();
    boolean success;

    //  URL: https://api.stripe.com/v1/customers/cus_CBbg3iRMzWBjoe/sources/ba_1BnETKGswQrCoh0XzgjB3t99/verify
    boolean bTls = true;
    int port = 443;
    boolean bAutoReconnect = true;
    success = rest.Connect("api.stripe.com",port,bTls,bAutoReconnect);
    if (success != true) {
        Log.i(TAG, "ConnectFailReason: " + String.valueOf(rest.get_ConnectFailReason()));
        Log.i(TAG, rest.lastErrorText());
        return;
        }

    rest.SetAuthBasic("STRIPE_SECRET_KEY","");

    rest.AddQueryParam("amounts[]","32");
    rest.AddQueryParam("amounts[]","45");

    String strResponseBody = rest.fullRequestFormUrlEncoded("POST","/v1/customers/cus_CBbg3iRMzWBjoe/sources/ba_1BnETKGswQrCoh0XzgjB3t99/verify");
    if (rest.get_LastMethodSuccess() != true) {
        Log.i(TAG, rest.lastErrorText());
        return;
        }

    CkJsonObject jsonResponse = new CkJsonObject();
    jsonResponse.Load(strResponseBody);

    String id;
    String object;
    String account;
    String account_holder_name;
    String account_holder_type;
    String bank_name;
    String country;
    String currency;
    boolean default_for_currency;
    String fingerprint;
    String last4;
    String routing_number;
    String status;
    String customer;
    String name;

    id = jsonResponse.stringOf("id");
    object = jsonResponse.stringOf("object");
    account = jsonResponse.stringOf("account");
    account_holder_name = jsonResponse.stringOf("account_holder_name");
    account_holder_type = jsonResponse.stringOf("account_holder_type");
    bank_name = jsonResponse.stringOf("bank_name");
    country = jsonResponse.stringOf("country");
    currency = jsonResponse.stringOf("currency");
    default_for_currency = jsonResponse.BoolOf("default_for_currency");
    fingerprint = jsonResponse.stringOf("fingerprint");
    last4 = jsonResponse.stringOf("last4");
    routing_number = jsonResponse.stringOf("routing_number");
    status = jsonResponse.stringOf("status");
    customer = jsonResponse.stringOf("customer");
    name = jsonResponse.stringOf("name");

  }

  static {
      System.loadLibrary("chilkat");

      // Note: If the incorrect library name is passed to System.loadLibrary,
      // then you will see the following error message at application startup:
      //"The application <your-application-name> has stopped unexpectedly. Please try again."
  }
}

Sample JSON Response Body

{
  "id": "ba_1BnETKGswQrCoh0XzgjB3t99",
  "object": "bank_account",
  "account": "acct_18qpKxGswQrCoh0X",
  "account_holder_name": "Jane Austen",
  "account_holder_type": "individual",
  "bank_name": "STRIPE TEST BANK",
  "country": "US",
  "currency": "usd",
  "default_for_currency": false,
  "fingerprint": "L2j4aSuWk1MZMDZ5",
  "last4": "6789",
  "metadata": {},
  "routing_number": "110000000",
  "status": "new",
  "customer": "cus_CBbg3iRMzWBjoe",
  "name": "Liam Thomas"
}