Performing a Pre-Authorization and Capture
PayButton makes it easy for you to support the payment workflows that your merchants require by implementing Pre-Authorizations and Captures.
SDK version requirement:
The minimum SDK versions required are iOS 2.47 and Android 2.57.Regardless of the types of additional transactions you will process, the transactions will always be based on a set of
MPTransactionParameters
and will be provided to the [MposUi createTransactionViewControllerWithTransactionParameters:]
.Card Scheme Rules for Pre-Authorizations
Pre-Authorizations make it possible to reserve a guaranteed amount on the shopper's card and either capture or refund the amount later. This feature makes it easy for businesses, such as hotels and rental companies, to take deposits or up-front payments from their shoppers.
To comply with the Card Scheme regulations, you must make sure that your merchants follow these rules:
- Pre-Authorizations are onlypermitted for Visa and Mastercard. Maestro doesnot allowPre-Authorizations.
- The captured amountmust be equal to or lessthan the pre-authorized amount.
- Pre-Authorizations must be capturedwithin 30 daysto guarantee payment to the merchant.
- For hotels, car rental companies, or cruise line transaction businesses: If no capture is intended, the refund of the Pre-Authorization must take placewithin 24 hoursof the check-out, rental return, or disembarkation date.
Performing a Pre-Authorization
To perform a Pre-Authorization on the card, modify the
MPTransactionParameters
to include the autoCapture = NO
property for the initial transaction.MPTransactionParameters *tp = [MPTransactionParameters chargeWithAmount:[NSDecimalNumber decimalNumberWithString:@"5.00"] currency:MPCurrencyEUR optionals: ^(id<MPTransactionParametersOptionals> _Nonnull optionals) { optionals.subject = @"Bouquet of Flowers"; optionals.customIdentifier = @"yourReferenceForTheTransaction"; optionals.autoCapture = NO; }]; // Show view controller...
Make sure to provide a receipt to the shopper.
Capturing a Pre-Authorization
To capture a Pre-Authorization later, you create
MPTransactionParameters
that contains the transactionIdentifier
of the previous transaction. Optionally, you can also change the amount that should ultimately be captured using the optionals.MPTransactionParameters *parameters = [MPTransactionParameters captureTransactionWithIdentifier:@"<transactionIdentifier>" optionals: ^(id<MPTransactionParametersCaptureOptionals> _Nonnull optionals) { // For partial captures, specify the amount to be captured // and the currency from the Pre-Authorization // [optionals setAmount:[NSDecimalNumber decimalNumberWithString:@"1.00"] currency:MPCurrencyEUR]; }]; // Show view controller...
As a result, you will receive one of the following:
- The original transaction that is now captured, indicated bytransaction.captured = YES.
- An error indicating why capturing the charge failed.
Performing a Pre-Authorization and Capture
PayButton makes it easy for you to support the payment workflows that your merchants require by implementing Pre-Authorizations and Captures.
SDK version requirement:
The minimum SDK versions required are iOS 2.47 and Android 2.57.Regardless of the types of additional transactions you will process, the transactions will always be based on a set of
TransactionParameters
and used in conjunction with MposUi.createTransactionIntent()
.Card Scheme Rules for Pre-Authorizations
Pre-Authorizations make it possible to reserve a guaranteed amount on the shopper's card and either capture or refund it later. This feature makes it easy for businesses, such as hotels and rental companies, to take deposits or up-front payments from their shoppers.
To comply with the Card Scheme regulations, you must make sure that your merchants follow those rules:
- Pre-Authorizations are onlypermitted for Visa and Mastercard. Maestro doesnot allowPre-Authorizations.
- The captured amountmust be equal to or lessthan the pre-authorized amount.
- Pre-Authorizations must be capturedwithin 30 daysto guarantee payment to the merchant.
- For hotels, car rental companies, or cruise line transaction businesses: If no capture is intended, the refund of the Pre-Authorization must take placewithin 24 hoursof the check-out, rental return, or disembarkation date.
Performing a Pre-Authorization
To perform a Pre-Authorization on the card, modify the
TransactionParameters
to include the autoCapture = false
property for the initial transaction.TransactionParameters parameters = new TransactionParameters.Builder() .charge(new BigDecimal("13.37"), Currency.EUR) .autoCapture(false) .build(); Intent intent = ui.createTransactionIntent(paramters); startActivityForResult(intent, MposUi.REQUEST_CODE_PAYMENT); The result in the onActivityResult() will be the same as for a normal charge transaction.
Make sure to provide a receipt to the shopper.
Capturing a Pre-Authorization
To capture an Pre-Authorization later, you create
TransactionParameters
that contains the transactionIdentifier
of the previous transaction. Optionally, you can also change the amount that should ultimately be captured.TransactionParameters parameters = new TransactionParameters.Builder() .capture("<transactionIdentifer>") // For partial captures, specify the amount to be captured // and the currency from the Pre-Authorization //.amountAndCurrency(new BigDecimal("1.00"), io.mpos.transactions.Currency.EUR) .build(); Intent intent = ui.createTransactionIntent(paramters); startActivityForResult(intent, MposUi.REQUEST_CODE_PAYMENT);
As a result, you will receive one of the following via the
onActivityResult()
:- The original transaction that is now captured, indicated bytransaction.captured = true.
- An error indicating why capturing the charge failed.