Create a test-mode authorization Test helper

Create a test-mode authorization.

Parameters

  • cardstringRequired

    Card associated with this authorization.

  • amountinteger

    The total amount to attempt to authorize. This amount is in the provided currency, or defaults to the card’s currency, and in the smallest currency unit.

  • currencyenum

    The currency of the authorization. If not provided, defaults to the currency of the card. Three-letter ISO currency code, in lowercase. Must be a supported currency.

More parameters

  • amount_detailsassociative array

  • authorization_methodenum

  • fleetassociative array

  • fuelassociative array

  • is_amount_controllableboolean

  • merchant_amountintegerPreview feature

  • merchant_currencyenumPreview feature

  • merchant_dataassociative array

  • network_dataassociative array

  • verification_dataassociative array

  • walletenum

Returns

An Authorization object

POST /v1/test_helpers/issuing/authorizations
$stripe = new \Stripe\StripeClient('sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2');
$authorization = $stripe->testHelpers->issuing->authorizations->create([
'amount' => 1000,
'card' => 'ic_1Nsse72eZvKYlo2CWBGm2WQ5',
]);
Response
{
"id": "iauth_1DPc772eZvKYlo2C6avLyZ25",
"object": "issuing.authorization",
"amount": 1000,
"amount_details": {
"atm_fee": null,
"cashback_amount": null
},
"approved": true,
"authorization_method": "keyed_in",
"balance_transactions": [],
"card": "ic_1Nsse72eZvKYlo2CWBGm2WQ5",
"cardholder": "ich_1Ccy6F2eZvKYlo2ClnIm9bs4",
"created": 1540586461,
"currency": "usd",
"livemode": false,
"merchant_amount": 0,
"merchant_currency": "usd",
"merchant_data": {
"category": "taxicabs_limousines",
"category_code": "4121",
"city": "San Francisco",
"country": "US",
"name": "Rocket Rides",
"network_id": "1234567890",
"postal_code": "94107",
"state": "CA",
"terminal_id": null
},
"metadata": {},
"network_data": null,
"pending_request": null,
"redaction": null,
"request_history": [],
"status": "reversed",
"transactions": [],
"verification_data": {
"address_line1_check": "not_provided",
"address_postal_code_check": "match",
"cvc_check": "match",
"expiry_check": "match"
},
"wallet": null
}

Capture a test-mode authorization Test helper

Capture a test-mode authorization.

Parameters

  • capture_amountinteger

    The amount to capture from the authorization. If not provided, the full amount of the authorization will be captured. This amount is in the authorization currency and in the smallest currency unit.

  • close_authorizationboolean

    Whether to close the authorization after capture. Defaults to true. Set to false to enable multi-capture flows.

  • purchase_detailsassociative array

    Additional purchase information that is optionally provided by the merchant.

Returns

An Authorization object.

POST /v1/test_helpers/issuing/authorizations/:id/capture
$stripe = new \Stripe\StripeClient('sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2');
$authorization = $stripe->testHelpers->issuing->authorizations->capture(
'iauth_1DPc772eZvKYlo2C6avLyZ25',
[]
);
Response
{
"id": "iauth_1DPc772eZvKYlo2C6avLyZ25",
"object": "issuing.authorization",
"amount": 0,
"amount_details": {
"atm_fee": null,
"cashback_amount": null
},
"approved": true,
"authorization_method": "keyed_in",
"balance_transactions": [],
"card": {
"id": "ic_1FEiQC2eZvKYlo2CtahKepKy",
"object": "issuing.card",
"brand": "Visa",
"cancellation_reason": null,
"cardholder": {
"id": "ich_1Ccy6F2eZvKYlo2ClnIm9bs4",
"object": "issuing.cardholder",
"billing": {
"address": {
"city": "Beverly Hills",
"country": "US",
"line1": "123 Fake St",
"line2": "Apt 3",
"postal_code": "90210",
"state": "CA"
}
},
"company": null,
"created": 1528992903,
"email": "jenny@example.com",
"individual": null,
"livemode": false,
"metadata": {},
"name": "Jenny Rosen",
"phone_number": "+18008675309",
"preferred_locales": [],
"redaction": null,
"requirements": {
"disabled_reason": null,
"past_due": []
},
"spending_controls": {
"allowed_categories": [],
"blocked_categories": [],
"spending_limits": [],
"spending_limits_currency": null
},
"status": "active",
"type": "individual"
},
"created": 1567541772,
"currency": "usd",
"exp_month": 12,
"exp_year": 2020,
"last4": "4242",
"livemode": false,
"metadata": {
"status": "canceled"
},
"redaction": null,
"replaced_by": null,
"replacement_for": null,
"replacement_reason": null,
"shipping": null,
"spending_controls": {
"allowed_categories": null,
"blocked_categories": null,
"spending_limits": [],
"spending_limits_currency": null
},
"status": "canceled",
"type": "physical",
"wallets": {
"apple_pay": {
"eligible": true,
"ineligible_reason": null
},
"google_pay": {
"eligible": false,
"ineligible_reason": "missing_agreement"
},
"primary_account_identifier": null
}
},
"cardholder": "ich_1Ccy6F2eZvKYlo2ClnIm9bs4",
"created": 1540586461,
"currency": "usd",
"livemode": false,
"merchant_amount": 0,
"merchant_currency": "usd",
"merchant_data": {
"category": "taxicabs_limousines",
"category_code": "4121",
"city": "San Francisco",
"country": "US",
"name": "Rocket Rides",
"network_id": "1234567890",
"postal_code": "94107",
"state": "CA",
"terminal_id": null
},
"metadata": {},
"network_data": null,
"pending_request": null,
"redaction": null,
"request_history": [],
"status": "reversed",
"transactions": [],
"verification_data": {
"address_line1_check": "not_provided",
"address_postal_code_check": "match",
"cvc_check": "match",
"expiry_check": "match"
},
"wallet": null
}

Expire a test-mode authorization Test helper

Expire a test-mode Authorization.

Parameters

No parameters.

Returns

An Authorization object

POST /v1/test_helpers/issuing/authorizations/:id/expire
$stripe = new \Stripe\StripeClient('sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2');
$authorization = $stripe->testHelpers->issuing->authorizations->expire(
'iauth_1DPc772eZvKYlo2C6avLyZ25',
[]
);
Response
{
"id": "iauth_1DPc772eZvKYlo2C6avLyZ25",
"object": "issuing.authorization",
"amount": 0,
"amount_details": {
"atm_fee": null,
"cashback_amount": null
},
"approved": true,
"authorization_method": "keyed_in",
"balance_transactions": [],
"card": {
"id": "ic_1FEiQC2eZvKYlo2CtahKepKy",
"object": "issuing.card",
"brand": "Visa",
"cancellation_reason": null,
"cardholder": {
"id": "ich_1Ccy6F2eZvKYlo2ClnIm9bs4",
"object": "issuing.cardholder",
"billing": {
"address": {
"city": "Beverly Hills",
"country": "US",
"line1": "123 Fake St",
"line2": "Apt 3",
"postal_code": "90210",
"state": "CA"
}
},
"company": null,
"created": 1528992903,
"email": "jenny@example.com",
"individual": null,
"livemode": false,
"metadata": {},
"name": "Jenny Rosen",
"phone_number": "+18008675309",
"preferred_locales": [],
"redaction": null,
"requirements": {
"disabled_reason": null,
"past_due": []
},
"spending_controls": {
"allowed_categories": [],
"blocked_categories": [],
"spending_limits": [],
"spending_limits_currency": null
},
"status": "active",
"type": "individual"
},
"created": 1567541772,
"currency": "usd",
"exp_month": 12,
"exp_year": 2020,
"last4": "4242",
"livemode": false,
"metadata": {
"status": "canceled"
},
"redaction": null,
"replaced_by": null,
"replacement_for": null,
"replacement_reason": null,
"shipping": null,
"spending_controls": {
"allowed_categories": null,
"blocked_categories": null,
"spending_limits": [],
"spending_limits_currency": null
},
"status": "canceled",
"type": "physical",
"wallets": {
"apple_pay": {
"eligible": true,
"ineligible_reason": null
},
"google_pay": {
"eligible": false,
"ineligible_reason": "missing_agreement"
},
"primary_account_identifier": null
}
},
"cardholder": "ich_1Ccy6F2eZvKYlo2ClnIm9bs4",
"created": 1540586461,
"currency": "usd",
"livemode": false,
"merchant_amount": 0,
"merchant_currency": "usd",
"merchant_data": {
"category": "taxicabs_limousines",
"category_code": "4121",
"city": "San Francisco",
"country": "US",
"name": "Rocket Rides",
"network_id": "1234567890",
"postal_code": "94107",
"state": "CA",
"terminal_id": null
},
"metadata": {},
"network_data": null,
"pending_request": null,
"redaction": null,
"request_history": [],
"status": "reversed",
"transactions": [],
"verification_data": {
"address_line1_check": "not_provided",
"address_postal_code_check": "match",
"cvc_check": "match",
"expiry_check": "match"
},
"wallet": null
}

Finalize a test-mode authorization's amount Test helper

Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount.

Parameters

  • final_amountintegerRequired

    The final authorization amount that will be captured by the merchant. This amount is in the authorization currency and in the smallest currency unit.

More parameters

  • fleetassociative array

  • fuelassociative array

Returns

An Authorization object

POST /v1/test_helpers/issuing/authorizations/:id/finalize_amount
$stripe = new \Stripe\StripeClient('sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2');
$authorization = $stripe->testHelpers->issuing->authorizations->finalizeAmount(
'iauth_1DPc772eZvKYlo2C6avLyZ25',
['final_amount' => 1000]
);
Response
{
"id": "iauth_1DPc772eZvKYlo2C6avLyZ25",
"object": "issuing.authorization",
"amount": 1000,
"amount_details": {
"atm_fee": null,
"cashback_amount": null
},
"approved": true,
"authorization_method": "chip",
"balance_transactions": [],
"card": "ic_1Nsse72eZvKYlo2CWBGm2WQ5",
"cardholder": "ich_1Ccy6F2eZvKYlo2ClnIm9bs4",
"created": 1540586461,
"currency": "usd",
"livemode": false,
"merchant_amount": 1000,
"merchant_currency": "usd",
"merchant_data": {
"category": "automated_fuel_dispensers",
"category_code": "5542",
"city": "San Francisco",
"country": "US",
"name": "Rocket Rides",
"network_id": "1234567890",
"postal_code": "94107",
"state": "CA",
"terminal_id": null
},
"metadata": {},
"network_data": null,
"pending_request": null,
"redaction": null,
"request_history": [],
"status": "reversed",
"transactions": [],
"verification_data": {
"address_line1_check": "not_provided",
"address_postal_code_check": "match",
"cvc_check": "match",
"expiry_check": "match"
},
"wallet": null
}

Increment a test-mode authorization Test helper

Increment a test-mode Authorization.

Parameters

  • increment_amountintegerRequired

    The amount to increment the authorization by. This amount is in the authorization currency and in the smallest currency unit.

  • is_amount_controllableboolean

    If set true, you may provide amount to control how much to hold for the authorization.

Returns

An Authorization object

POST /v1/test_helpers/issuing/authorizations/:id/increment
$stripe = new \Stripe\StripeClient('sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2');
$authorization = $stripe->testHelpers->issuing->authorizations->increment(
'iauth_1DPc772eZvKYlo2C6avLyZ25',
['increment_amount' => 1000]
);
Response
{
"id": "iauth_1DPc772eZvKYlo2C6avLyZ25",
"object": "issuing.authorization",
"amount": 1000,
"amount_details": {
"atm_fee": null,
"cashback_amount": null
},
"approved": true,
"authorization_method": "keyed_in",
"balance_transactions": [],
"card": "ic_1Nsse72eZvKYlo2CWBGm2WQ5",
"cardholder": "ich_1Ccy6F2eZvKYlo2ClnIm9bs4",
"created": 1540586461,
"currency": "usd",
"livemode": false,
"merchant_amount": 0,
"merchant_currency": "usd",
"merchant_data": {
"category": "taxicabs_limousines",
"category_code": "4121",
"city": "San Francisco",
"country": "US",
"name": "Rocket Rides",
"network_id": "1234567890",
"postal_code": "94107",
"state": "CA",
"terminal_id": null
},
"metadata": {},
"network_data": null,
"pending_request": null,
"redaction": null,
"request_history": [],
"status": "reversed",
"transactions": [],
"verification_data": {
"address_line1_check": "not_provided",
"address_postal_code_check": "match",
"cvc_check": "match",
"expiry_check": "match"
},
"wallet": null
}