Testing Stripe Issuing Invite Only

    Test your integration before going live by issuing cards and simulating purchases in test mode.

    You can issuing cards and simulate purchases using your own Stripe integration in test mode. This allows you to test your integration before you go live and issue cards that can be used to make real purchases.

    No account balance is needed when issuing cards in test mode, and these cards can only be used for testing within your Stripe account.

    Simulating purchases

    You can simulate a card purchase using your test API keys with the following process:

    1. Create a cardholder
    2. Create a card
    3. Create a Source object using the card
    4. Create an uncaptured charge using the source

    Step 1: Create a cardholder

    First, create a cardholder with a name, billing address, and entity type. You can also provide additional information, if necessary.

    curl https://api.stripe.com/v1/issuing/cardholders \
     -u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \
     -d name="Jenny Rosen" \
     -d email="jenny.rosen@example.com" \
     -d phone_number="+18008675309" \
     -d status=active \
     -d type=individual \
     -d billing[name]="Jenny Rosen" \
     -d billing[address][line1]="1234 Main Street" \
     -d billing[address][city]="San Francisco" \
     -d billing[address][state]=CA \
     -d billing[address][postal_code]=94111 \
     -d billing[address][country]=US
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    cardholder = Stripe::Issuing::Cardholder.create({
        name: 'Jenny Rosen',
        email: 'jenny.rosen@example.com',
        phone_number: '+18008675309',
        status: 'active',
        type: 'individual',
        billing: {
            name: 'Jenny Rosen',
            address: {
                line1: '1234 Main Street',
                city: 'San Francisco',
                state: 'CA',
                postal_code: '94111',
                country: 'US',
            },
        },
    })
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    cardholder = stripe.issuing.Cardholder.create(
      name='Jenny Rosen',
      email='jenny.rosen@example.com',
      phone_number='+18008675309',
      status='active',
      type='individual',
      billing={
        'name': 'Jenny Rosen',
        'address': {
          'line1': '1234 Main Street',
          'city': 'San Francisco',
          'state': 'CA',
          'postal_code': '94111',
          'country': 'US'
        }
      }
    )
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    \Stripe\Stripe::setApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    $cardholder = \Stripe\Issuing\Cardholder::create([
        'name' => 'Jenny Rosen',
        'email' => 'jenny.rosen@example.com',
        'phone_number' => '+18008675309',
        'status' => 'active',
        'type' => 'individual',
        'billing' => [
            'name' => 'Jenny Rosen',
            'address' => [
                'line1' => '1234 Main Street',
                'city' => 'San Francisco',
                'state' => 'CA',
                'postal_code' => '94111',
                'country' => 'US',
            ],
        ],
    ]);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2";
    
    Map<String, Object> addressParams = new HashMap<String, Object>();
    addressParams.put("line1", "1234 Main Street");
    addressParams.put("city", "San Francisco");
    addressParams.put("state", "CA");
    addressParams.put("postal_code", "94111");
    addressParams.put("country", "US");
    
    Map<String, Object> billingParams = new HashMap<String, Object>();
    billingParams.put("name", "Jenny Rosen");
    billingParams.put("address", addressParams);
    
    Map<String, Object> cardholderParams = new HashMap<>();
    cardholderParams.put("name", "Jenny Rosen");
    cardholderParams.put("email", "jenny.rosen@example.com");
    cardholderParams.put("phone_number", "+18008675309");
    cardholderParams.put("status", "active");
    cardholderParams.put("type", "individual");
    cardholderParams.put("billing", billingParams);
    
    Cardholder cardholder = Cardholder.create(cardholderParams);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    var stripe = require("stripe")("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    const cardholder = stripe.issuing.cardholders.create({
      name: 'Jenny Rosen',
      email: 'jenny.rosen@example.com',
      phone_number: '+18008675309',
      status: 'active',
      type: 'individual',
      billing: {
        name: 'Jenny Rosen',
        address: {
          line1: '1234 Main Street',
          city: 'San Francisco',
          state: 'CA',
          postal_code: '94111',
          country: 'US',
        },
      },
    });
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.Key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    cardholder, err := New(&stripe.IssuingCardholderParams{
      Billing: &stripe.IssuingBillingParams{
        Address: &stripe.AddressParams{
          Country:    stripe.String("US"),
          Line1:      stripe.String("1234 Main Street"),
          City:       stripe.String("San Francisco"),
          PostalCode: stripe.String("94111"),
          State:      stripe.String("CA"),
        },
        Name: stripe.String("Jenny Rosen"),
      },
      Email: stripe.String("jenny.rosen@example.com"),
      Name: stripe.String("Jenny Rosen"),
      PhoneNumber: stripe.String("+18008675309"),
      Status: stripe.String(string(stripe.IssuingCardholderStatusActive)),
      Type: stripe.String(string(stripe.IssuingCardholderTypeIndividual)),
    })
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    StripeConfiguration.SetApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    var options = new CardholderCreateOptions
    {
        Billing = new BillingOptions
        {
            Name = "Jenny Rosen",
            Line1 = "1234 Main Street",
            City = "San Francisco",
            State = "CA",
            PostalCode = "94111",
            Country = "US",
        },
        Email = "jenny.rosen@example.com",
        PhoneNumber = "+18008675309",
        Name = "Jenny Rosen",
        Status = "active",
        Type = "individual",
    };
    
    var service = new CardholderService();
    Cardholder card = service.Create(options);
    

    Step 2: Create a card

    After creating a cardholder, you can create a card for them. Provide the id of the Cardholder object and currency. For immediate testing, create a virtual card and set its status to active.

    curl https://api.stripe.com/v1/issuing/cards \
       -u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \
       -d cardholder=ich_1Cm3pZIyNTgGDVfzI83rasFP \
       -d type=virtual \
       -d currency=usd \
       -d status=active
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    card = Stripe::Issuing::Card.create({
        cardholder: 'ich_1Cm3pZIyNTgGDVfzI83rasFP',
        type: 'virtual',
        currency: 'usd',
        status: 'active',
    })
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    card = stripe.issuing.Card.create(
      cardholder='ich_1Cm3pZIyNTgGDVfzI83rasFP',
      type='virtual',
      currency='usd',
      status='active'
    )
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    \Stripe\Stripe::setApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    $card = \Stripe\Issuing\Card::create([
        'cardholder' => 'ich_1Cm3pZIyNTgGDVfzI83rasFP',
        'type' => 'virtual',
        'currency' => 'usd',
        'status' => 'active',
    ]);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2";
    
    Map<String, Object> params = new HashMap<>();
    params.put("cardholder", "ich_1Cm3pZIyNTgGDVfzI83rasFP");
    params.put("type", "virtual");
    params.put("currency", "usd");
    params.put("status", "active");
    Card card = Card.create(params);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    var stripe = require("stripe")("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    const card = stripe.issuing.cards.create({
      cardholder: 'ich_1Cm3pZIyNTgGDVfzI83rasFP',
      type: 'virtual',
      currency: 'usd',
      status: 'active',
    });
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.Key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    card, err := New(&stripe.IssuingCardParams{
      Cardholder: stripe.String("ich_1Cm3pZIyNTgGDVfzI83rasFP"),
      Currency: stripe.String(string(stripe.CurrencyUSD)),
      Type: stripe.String(string(stripe.IssuingCardTypeVirtual)),
      Status: stripe.String(string(stripe.IssuingCardStatusInactive)),
    })
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    StripeConfiguration.SetApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    var options = new CardCreateOptions {
        Cardholder = "ich_1Cm3pZIyNTgGDVfzI83rasFP",
        Type = "virtual",
        Currency = "usd",
        Status = "active",
    };
    
    var service = new CardService();
    Card card = service.Create(options);
    

    Step 3: Create a source

    Using the newly issued card, create a source. A source is necessary to create a test charge as it simulates the swipe or entry of an issue card at the time of purchase.

    curl https://api.stripe.com/v1/sources \
       -u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \
       -d type=card \
       -d card[issuing_card]=ic_1Cm3paIyNTgGDVfzBqq1uqxR
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    source = Stripe::Source.create({
        type: 'card',
        card: {
            issuing_card: 'ic_1Cm3paIyNTgGDVfzBqq1uqxR',
        }
    })
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    source = stripe.Source.create(
      type='card',
      card={
        'issuing_card': 'ic_1Cm3paIyNTgGDVfzBqq1uqxR'
      }
    )
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    \Stripe\Stripe::setApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    $source = \Stripe\Source::create([
        'type' => 'card',
        'card' => array(
            'issuing_card' => 'ic_1Cm3paIyNTgGDVfzBqq1uqxR',
        ),
    ]);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2";
    
    Map<String, Object> sourceParams = new HashMap<String, Object>();
    cardParams.put("issuing_card", "ic_1Cm3paIyNTgGDVfzBqq1uqxR");
    
    Map<String, Object> params = new HashMap<>();
    params.put("type", "card");
    params.put("card", sourceParams);
    
    Source source = Source.create(params);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    var stripe = require("stripe")("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    const source = stripe.sources.create({
      type: 'card',
      card: {
        issuing_card: 'ic_1Cm3paIyNTgGDVfzBqq1uqxR',
      },
    );
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.Key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    params := &stripe.SourceObjectParams{
      Type: stripe.String("card"),
      Currency: stripe.String(string(stripe.CurrencyUSD)),
      Card: &stripe.SourceOwnerParams{
        Issuingcard: stripe.String("ic_1Cm3paIyNTgGDVfzBqq1uqxR"),
      },
    }
    s, err := source.New(params)
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    StripeConfiguration.SetApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    var sourceOptions = new StripeSourceCreateOptions {
      Type = StripeSourceType.AchCreditTransfer,
      Currency = "usd",
      Card = new cardOptions {
        Issuing_card = "ic_1Cm3paIyNTgGDVfzBqq1uqxR"
      }
    };
    
    var sourceService = new StripeSourceService();
    StripeSource source = sourceService.Create(sourceOptions);
    

    Step 4: Create an uncaptured charge

    Using auth and capture, create a charge that is not immediately captured.

    curl https://api.stripe.com/v1/charges \
       -u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \
       -d source=src_1Cn6EvIyNTgGDVfzosvqD8ld \
       -d amount=2000 \
       -d currency=usd \
       -d capture=false
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    charge = Stripe::Charge.create({
        source: 'src_1Cn6EvIyNTgGDVfzosvqD8ld',
        amount: 2000,
        currency: 'usd',
        capture: false,
    })
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    charge = stripe.Charge.create(
      source='src_1Cn6EvIyNTgGDVfzosvqD8ld',
      amount=2000,
      currency='usd',
      capture=False
    )
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    \Stripe\Stripe::setApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    $charge = \Stripe\Charge::create([
        'source' => 'src_1Cn6EvIyNTgGDVfzosvqD8ld',
        'amount' => 2000,
        'currency' => 'usd',
        'capture' => false,
    ]);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2";
    
    Map<String, Object> params = new HashMap<>();
    params.put("source", "src_1Cn6EvIyNTgGDVfzosvqD8ld");
    params.put("amount", 2000);
    params.put("currency", "usd");
    params.put("capture", false);
    Charge charge = Charge.create(params);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    var stripe = require("stripe")("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    const charge = stripe.charges.create({
      source: 'src_1Cn6EvIyNTgGDVfzosvqD8ld',
      amount: 2000,
      currency: 'usd',
      capture: false,
    );
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.Key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    params := &stripe.ChargeParams{
      Amount: 2000,
      Currency: "usd",
      Capture: false,
    }
    params.SetSource("src_1Cn6EvIyNTgGDVfzosvqD8ld")ch, _ := charge.New(params)
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    StripeConfiguration.SetApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    var options = new StripeChargeCreateOptions {
        SourceTokenOrExistingSourceId = "src_1Cn6EvIyNTgGDVfzosvqD8ld",
        Amount = 2000,
        Currency = "usd",
        Capture = false,
    };
    var service = new StripeChargeService();
    StripeCharge charge = service.Create(options);
    

    This step results in an authorization request. If there are authorization controls on the card, they are applied. If your integration is configured to receive and handle authorization requests, Stripe also sends the issuing_authorization.request event to your test authorization endpoint.

    You can test international purchases by creating a charge in a currency that’s different to the card’s own currency (e.g., create a gbp charge for a usd card).

    Handling authorizations

    You can test how your integration handles changes to authorizations by replicating the possible actions that can occur.

    Capturing an authorization (uncaptured charge)

    To settle an uncaptured charge, which results in the creation of a Transaction object, capture the charge.

    curl https://api.stripe.com/v1/charges/ch_1CmMk3IyNTgGDVfzqgWGCQr5/capture \
       -u sk_test_BQokikJOvBiI2HlWgH4olfQ2:
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    charge = Stripe::Charge.retrieve('ch_1CmMk3IyNTgGDVfzqgWGCQr5')
    charge.capture
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    charge = stripe.Charge.retrieve('ch_1CmMk3IyNTgGDVfzqgWGCQr5')
    charge.capture()
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    \Stripe\Stripe::setApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    $charge = \Stripe\Charge::retrieve('ch_1CmMk3IyNTgGDVfzqgWGCQr5');
    $charge.capture();
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2";
    
    Charge charge = Charge.retrieve("ch_1CmMk3IyNTgGDVfzqgWGCQr5");
    charge.capture();
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    var stripe = require("stripe")("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    const charge = stripe.Charges.capture('ch_1CmMk3IyNTgGDVfzqgWGCQr5')
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.Key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    ch, _ := charge.Capture("ch_1CmMk3IyNTgGDVfzqgWGCQr5")
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    StripeConfiguration.SetApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    var service = new StripeChargeService();
    StripeCharge charge = chargeService.Capture("ch_1CmMk3IyNTgGDVfzqgWGCQr5")
    

    Partial capture

    An authorization can be captured for any amount below what has been authorized. You can partially capture a test charge by providing a value for amount when capturing a charge.

    Partially capturing a charge creates a Transaction object for the amount captured, and a reversal of the remaining amount. This reversal is represented as an update to the Authorization object.

    Reversing an authorization

    You can reverse (void) an authorization that has not been captured by creating a refund for the uncaptured charge.

    curl https://api.stripe.com/v1/refunds \
       -u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \
       -d charge=ch_1CmMk3IyNTgGDVfzqgWGCQr5
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    refund = Stripe::Refund.create({
        charge: 'ch_1CmMk3IyNTgGDVfzqgWGCQr5',
    })
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    refund = stripe.Refund.create(
      charge='ch_1CmMk3IyNTgGDVfzqgWGCQr5'
    )
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    \Stripe\Stripe::setApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    $refund = \Stripe\Refund::create([
        'charge' => 'ch_1CmMk3IyNTgGDVfzqgWGCQr5',
    ]);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2";
    
    Map<String, Object> params = new HashMap<>();
    params.put("charge", "ch_1CmMk3IyNTgGDVfzqgWGCQr5");
    Refund refund = Refund.create(params);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    var stripe = require("stripe")("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    const refund = stripe.refunds.create({
      charge: 'ch_1CmMk3IyNTgGDVfzqgWGCQr5',
    });
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.Key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    params := &stripe.RefundParams{
      Charge: "ch_1CmMk3IyNTgGDVfzqgWGCQr5",
    }
    ref, _ := refund.New(params)
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    StripeConfiguration.SetApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    var options = new StripeRefundCreateOptions {
        Charge = "ch_1CmMk3IyNTgGDVfzqgWGCQr5",
    };
    var service = new StripeRefundService();
    StripeRefund refund = service.Create(options);
    

    Refunding a captured charge

    Refunding a captured charge uses the same method as refunding an uncaptured one. A Transaction object of type refund is created that references the original authorization.

    curl https://api.stripe.com/v1/refunds \
       -u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \
       -d charge=ch_1CmMk3IyNTgGDVfzqgWGCQr5 \
       -d amount=2000
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    refund = Stripe::Refund.create({
        charge: 'ch_1CmMk3IyNTgGDVfzqgWGCQr5',
        amount: 2000,
    })
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    refund = stripe.Refund.create(
      charge='ch_1CmMk3IyNTgGDVfzqgWGCQr5',
      amount=2000
    )
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    \Stripe\Stripe::setApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    $refund = \Stripe\Refund::create([
        'charge' => 'ch_1CmMk3IyNTgGDVfzqgWGCQr5',
        'amount' => 2000,
    ]);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2";
    
    Map<String, Object> params = new HashMap<>();
    params.put("charge", "ch_1CmMk3IyNTgGDVfzqgWGCQr5");
    params.put("amount", 2000);
    Refund refund = Refund.create(params);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    var stripe = require("stripe")("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    const refund = stripe.refunds.create({
      charge: 'ch_1CmMk3IyNTgGDVfzqgWGCQr5',
      amount: 2000,
    });
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.Key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    params := &stripe.RefundParams{
      Charge: "ch_1CmMk3IyNTgGDVfzqgWGCQr5",
      Amount: 2000,
    }
    ref, _ := refund.New(params)
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    StripeConfiguration.SetApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    var options = new StripeRefundCreateOptions {
        Charge = "ch_1CmMk3IyNTgGDVfzqgWGCQr5",
        Amount = 2000,
    };
    var service = new StripeRefundService();
    StripeRefund refund = service.Create(options);
    

    Testing verification outcomes

    Issued cards support AVS and CVC checks. You can simulate authorizations that either provide the wrong information so these checks fail, or no information so the checks cannot be run. The results of these checks are represented on Authorization objects as values for verification_data.

    AVS check

    By default, creating a Source object for an issued card includes no address information, so the resulting ZIP code and street address checks return not_provided. To test AVS, provide an address during source creation.

    curl https://api.stripe.com/v1/sources \
       -u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \
       -d type=card \
       -d card[issuing_card]=ic_1Cm3paIyNTgGDVfzBqq1uqxR \
       -d owner[address][line1]="1234 Main Street" \
       -d owner[address][city]="San Francisco" \
       -d owner[address][state]=CA \
       -d owner[address][postal_code]=94111 \
       -d owner[address][country]=US
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    source = Stripe::Source.create({
        card: 'ic_1CoYuRKEl2ztzE5GIEDjQiUI',
        type: 'card',
        owner: {
            address: {
                line1: '1234 Main Street',
                city: 'San Francisco',
                state: 'CA',
                postal_code: '94111',
                country: 'US',
            },
        },
    })
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    source = stripe.Source.create(
      card='ic_1CoYuRKEl2ztzE5GIEDjQiUI',
      type='card',
      owner={
        'address': {
          'line1': '1234 Main Street',
          'city': 'San Francisco',
          'state': 'CA',
          'postal_code': '94111',
          'country': 'US',
        }
      }
    )
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    \Stripe\Stripe::setApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    $source = \Stripe\Source::create([
        'card' => 'ic_1CoYuRKEl2ztzE5GIEDjQiUI',
        'type' => 'card',
        'owner' => array(
            'address' => array(
                'line1' => '1234 Main Street',
                'city' => 'San Francisco',
                'state' => 'CA',
                'postal_code' => '94111',
                'country' => 'US',
            ),
        ),
    ]);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2";
    
    
    Map<String, Object> cvcParams = new HashMap<String, Object>();
    cvcParams.put("cvc_match", "true");
    
    Map<String, Object> addressParams = new HashMap<String, Object>();
    addressParams.put("line1", "1234 Main Street");
    addressParams.put("city", "San Francisco");
    addressParams.put("state", "CA");
    addressParams.put("postal_code", "94111");
    addressParams.put("country", "US");
    
    Map<String, Object> ownerParams = new HashMap<String, Object>();
    ownerParams.put("address", addressParams);
    
    Map<String, Object> params = new HashMap<>();
    params.put("card", "ic_1CoYuRKEl2ztzE5GIEDjQiUI");
    params.put("type", "card");
    params.put("owner", ownerParams);
    params.put("external_data", cvcParams)
    Source source = Source.create(params);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    var stripe = require("stripe")("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    const source = stripe.sources.create({
      card: 'ic_1CoYuRKEl2ztzE5GIEDjQiUI',
      type: 'card',
      owner: {
        address: {
          line1: '1234 Main Street',
          city: 'San Francisco',
          state: 'CA',
          postal_code: '94111',
          country: 'US',
        },
      },
    );
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.Key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    params := &stripe.SourceParams{
      Card: "ic_1CoYuRKEl2ztzE5GIEDjQiUI",
      Type: "card",
      Owner: &stripe.IssuingOwnerParams{
        Address: &stripe.AddressParams{
          Country:    stripe.String("US"),
          Line1:      stripe.String("1234 Main Street"),
          City:       stripe.String("San Francisco"),
          PostalCode: stripe.String("94111"),
          State:      stripe.String("CA"),
        },
      },
    }
    sou, _ := source.New(params)
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    StripeConfiguration.SetApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    var options = new StripeSourceTokenOrExistingSourceIdCreateOptions {
        Card = "ic_1CoYuRKEl2ztzE5GIEDjQiUI",
        Type = "card",
        Owner = new OwnerOptions
          {
              Address = new AddressOptions
              {
                  City = "San Francisco",
                  Country = "US",
                  Line1 = "1234 Main Street",
                  PostalCode = "94111",
                  State = "CA",
              },
          },
    
    };
    var service = new StripeSourceTokenOrExistingSourceIdService();
    StripeSourceTokenOrExistingSourceId source = service.Create(options);
    

    Providing the same address as the billing address on the card results in a successful AVS check (the respective verification_data fields return match). To test for a failed check, create a source that has a different ZIP code and street address—this results in verification_data returning mismatch.

    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.