The PayButton also makes it really easy to implement Pre-Authorizations and Captures, allowing you to support the payment workflows that your merchants require.
Regardless of the kind of additional transaction you are going to make,
they will always be based on a set of
and used in conjunction with
Pre-Authorizations make it possible to reserve a guaranteed amount on the shopper's card and either Capture or Refund it later on. This 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:
To perform a Pre-Authorization on the card, modify the
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!
To capture an Pre-Authorization later on, you create
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
transaction.captured = true;