Incremental authorization
United States
Use the IncrementalAuthRequestIntentBuilder
class to build an Intent for incremental authorization (auth). The incremental auth increases the authorized amount of a transaction to verify the cardholder has sufficient funds for the purchase.
NOTE
Incremental authorizations are only available for:
- Discover®, Mastercard®, and Visa® cards.
- Merchant types—aircraft rentals, amusement parks, bicycle rentals, boat rentals, car rentals, cruise lines, drinking places, eating places, equipment rentals, lodgings, motor home rentals, motorcycle rentals, trailer parks/campgrounds, and truck rentals.
Prerequisites
- Read overview of the Clover platform.
- Create a global developer account with a default test merchant account.
- Order a Clover Developer Kit (Dev Kit) and set it up.
- Use the required Android SDK versions.
Request fields
Additional fields for theIncrementalAuthRequestIntentBuilder
class:
Field | Description |
---|---|
amount: Long | Increment amount. |
paymentId: String | Payment identifier of the pre-auth to increment. |
Step
Build an incremental auth request.
Request example
val paymentId = payment.id // id of a preauth payment
val amount = 1200L // increment amount
val context = this
val builder = IncrementalAuthRequestIntentBuilder(paymentId, amount)
val intent = builder.build(context)
String paymentId = payment.getId(); // id of a preauth payment
Long amount = 1200L; // increment amount
Context context = this;
IncrementalAuthRequestIntentBuilder builder = new IncrementalAuthRequestIntentBuilder(paymentId, amount);
Intent intent = builder.build(context);
Response
When the incremental auth flow completes, the response is available through onActivityResult()
.
- For a successful request, retrieve the payment object using the Intent:
IncrementalAuthRequestIntentBuilder.Response.PAYMENT
and the incremented amount. The newPayment
object must display the incremented amount - For an unsuccessful request, retrieve the failure message using the Intent:
IncrementalAuthRequestIntentBuilder.Response.FAILURE_MESSAGE
Response example
fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == INCREMENTAL_AUTH_REQUEST_CODE) {
if (resultCode == RESULT_OK) {
val payment: Payment = data.getParcelableExtra(IncrementalAuthRequestIntentBuilder.Response.PAYMENT)
} else {
// incremental auth failed, check for error
val failureMessage = data.getStringExtra(IncrementalAuthRequestIntentBuilder.Response.FAILURE_MESSAGE)
}
}
}
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == INCREMENTAL_AUTH_REQUEST_CODE) {
if (resultCode == RESULT_OK) {
Payment payment = data.getParcelableExtra(IncrementalAuthRequestIntentBuilder.Response.PAYMENT);
} else {
// incremental auth failed, check for error
String failureMessage = data.getStringExtra(IncrementalAuthRequestIntentBuilder.Response.FAILURE_MESSAGE);
}
}
}
Updated about 1 month ago