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]; }]; UIViewController *viewController = [ui createTransactionViewControllerWithTransactionParameters:tp processParameters:pp completed:/*...*/];
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]; }]; UIViewController *viewController = [ui createTransactionViewControllerWithTransactionParameters:tp processParameters:pp completed:/*...*/];
NSLog(@"Included Tip: %@",transaction.details.includedTipAmount);
TippingProcessStepParameters steps = new TippingProcessStepParameters.Builder() .askForTipAmount().showConfirmationScreen(true)//deprecated way to enable add tip screen .showAddTipConfirmationScreen(true) //new way of enabling add tip screen .showTotalAmountConfirmationScreen(true) //enable the total amount confirmation screen .maxTipAmount(new BigDecimal(2.0)) // enables the maximum acceptable tip amount check .numberFormat(6, 2).build(); TransactionProcessParameters transactionProcessParameters = new TransactionProcessParameters.Builder() .addStep(steps) .build(); Intent intent = MposUi.getInitializedInstance().createTransactionIntent(params,transactionProcessParameters); startActivityForResult(intent, MposUi.REQUEST_CODE_PAYMENT);
BothTippingProcessStepParameters steps = new TippingProcessStepParameters.Builder() .askForTotalAmount().showConfirmationScreen(false)//deprecated way to disable add tip screen .showAddTipConfirmationScreen(false) //new way of disabling add tip screen .showTotalAmountConfirmationScreen(true) //enable the total amount confirmation screen .maxTipAmount(new BigDecimal(2.0)) // enables the maximum acceptable tip amount check .numberFormat(6, 2).build(); TransactionProcessParameters transactionProcessParameters = new TransactionProcessParameters.Builder() .addStep(steps) .build(); Intent intent = MposUi.getInitializedInstance().createTransactionIntent(params,transactionProcessParameters); startActivityForResult(intent, MposUi.REQUEST_CODE_PAYMENT);
System.out.println("Included Tip: " + transaction.getDetails().getIncludedTipAmount());