Asking for a Tip
Asking guests for a tip is made easy for your merchants with on-reader tipping. At the beginning of each transaction, the guest can be asked whether they want to add a tip and can then enter the tip amount on the card reader. This feature also enables you to ask the guest to enter the total amount of the transaction, including a potential tip, on the card reader. Contact your account manager to activate this feature.
On-reader tipping is currently only available on the Miura card readers.
Asking for the Tip Amount
The workflow to ask for a tip is shown below.
In order to ask the shopper to enter the tip amount, create the
MPTransactionProcessTippingStepParameters
with the
tippingAmountParametersWithOptionalsBlock
and use them to create the
MPTransactionProcessParameters
. Then pass them along as
processParameters
to
startTransactionWithParameters
:
MPTransactionProcessTippingStepParameters *params = [MPTransactionProcessTippingStepParameters tippingAmountParametersWithOptionalsBlock: ^(id<MPTransactionProcessTippingAmountStepParametersOptionals> _Nonnull optionals) { [optionals setShowConfirmationScreen:YES]; [optionals setFormatWithIntegerDigits:6 fractionDigits:2]; }]; MPTransactionProcessParameters *pp = [MPTransactionProcessParameters parametersWithSteps: ^(id<MPTransactionProcessParametersSteps> steps) { [steps setTippingStepParameters:params]; }]; MPTransactionProcess *process = [transactionProvider startTransactionWithParameters:transactionParameters accessoryParameters:accessoryParameters
processParameters
:pp registered:/*...*/ statusChanged:/*...*/ actionRequired:/*...*/ completed:/*...*/];
Asking for the Total Amount
The workflow for asking for a tip is shown below.
In order to ask the shopper to enter the total amount (including a potential tip), create the
MPTransactionProcessTippingStepParameters
with the
tippingTotaltParametersWithOptionalsBlock
and use them to create the
MPTransactionProcessParameters
. Then pass them along as
processParameters
to
startTransactionWithParameters
:
MPTransactionProcessTippingStepParameters *params = [MPTransactionProcessTippingStepParameters tippingTotaltParametersWithOptionalsBlock: ^(id<MPTransactionProcessTippingTotalStepParametersOptionals> _Nonnull optionals) { [optionals setShowConfirmationScreen:NO]; [optionals setFormatWithIntegerDigits:6 fractionDigits:2]; }]; MPTransactionProcessParameters *pp = [MPTransactionProcessParameters parametersWithSteps: ^(id<MPTransactionProcessParametersSteps> steps) { [steps setTippingStepParameters:params]; }]; MPTransactionProcess *process = [transactionProvider startTransactionWithParameters:transactionParameters accessoryParameters:accessoryParameters
processParameters
:pp registered:/*...*/ statusChanged:/*...*/ actionRequired:/*...*/ completed:/*...*/];
Getting the Tip Amount
After the transaction has been completed, you can access the included tip amount via the
details.includedTipAmount
property of the
MPTransaction
object that you receive as part of the
completed
block:
NSLog(@"Included Tip: %@",transaction.details.includedTipAmount);
Asking for a Tip with Alipay
Asking guests for a tip is made easy for your merchants with on-reader tipping. At the beginning of each transaction, the guest can be asked whether they want to add a tip and can then enter the tip amount on the card reader. This feature also enables you to ask the guest to enter the total amount of the transaction, including a potential tip, on the card reader. Contact your account manager to activate this feature.
On-reader tipping is currently only available on the Miura card readers.
Asking for the Tip Amount
The workflow for asking for a tip is shown below.
In order to ask the shopper to enter the tip amount, create
TippingProcessStepParameters
with
askForTipAmount()
and use them to create the
TransactionProcessParameters
. Then pass along the process parameters to
startTransaction
:
TippingProcessStepParameters steps = new TippingProcessStepParameters.Builder() .askForTipAmount() .showConfirmationScreen(true) .numberFormat(6, 2).build(); TransactionProcessParameters transactionProcessParameters = new TransactionProcessParameters.Builder() .addStep(steps) .build(); TransactionProcess paymentProcess = transactionProvider.startTransaction(transactionParameters, accessoryParameters,
transactionProcessParameters
, this);
Ask for the total amount
The workflow for asking for a tip is shown below.
In order to ask the shopper to enter the total amount (including a potential tip), create the
TippingProcessStepParameters
with the
askForTotalAmount()
and use them to create the
TransactionProcessParameters
. Then pass along the process parameters to
startTransaction
:
TippingProcessStepParameters steps = new TippingProcessStepParameters.Builder() .askForTotalAmount() .showConfirmationScreen(false) .numberFormat(6, 2).build(); TransactionProcessParameters transactionProcessParameters = new TransactionProcessParameters.Builder() .addStep(steps) .build(); TransactionProcess paymentProcess = transactionProvider.startTransaction(transactionParameters, accessoryParameters,
transactionProcessParameters
, this);
Getting the Included Tip Amount
You can access the included tip amount via the
getDetails().getIncludedTipAmount()
method of the
Transaction
object:
System.out.println("Included Tip: " + transaction.getDetails().getIncludedTipAmount());