We've introduced the flow in the SDK for this release to add support for processing sale with surcharge.
| Device | Platform | Acquirer |
|---|---|---|
| Axium | Android | FDRC, TSYS |
| BBPos Chipper 3X | Android, iOS | TSYS |
| Pax | Android | FDRC, TSYS |
There's a couple of required terminal settings to be configured for the new flow to work as expected.
You should ensure that the following settings are selected on the Processing Terminal > Features:
Allow surchargesSurcharge (%)allowBypass - indicates whether merchants are able to bypass surcharging for specific transactionsdiscloseFee - indicates whether the surcharge fee should be disclosed to the cardholder for acceptanceallowBypass - YESdiscloseFee - YESallowBypass - YESdiscloseFee - NOallowBypass - NOdiscloseFee - YESallowBypass - NOdiscloseFee - NOPlease make sure that you're already familiar on setting up the SDK, initializing the device, and performing transactions. If not, please check the below links.
Once the device is connected, start the sale by invoking the processSale method.
CoreSale sale = new CoreSale(BigDecimal.valueOf(Double.parseDouble(2.22)));
AndroidTerminal.getInstance().processSale(sale);
CoreSale *sale =[[CoreSale alloc] init];
sale.amount = [NSNumber numberWithDouble: 2.22];
[[WTPSTerminal singleton] processSale:sale];
To bypass surcharging for a specific transaction, you can set the CoreSale's bypassSurcharge field.
If the field is not set, the default value is false.
CoreSale sale = new CoreSale(BigDecimal.valueOf(Double.parseDouble(2.22)));
sale.setBypassSurcharge(true);
AndroidTerminal.getInstance().processSale(sale);
CoreSale *sale =[[CoreSale alloc] init];
sale.amount = [NSNumber numberWithDouble: 2.22];
[sale setBypassSurcharge:[NSNumber numberwithBool:YES]];
[[WTPSTerminal singleton] processSale:sale];
If the discloseFee is enabled on the terminal settings and surcharging is not bypassed, the onRequestSurchargeConfirm callback will fire with the surcharge amount.
@Override
public void onRequestSurchargeConfirm(CoreBinLookupResponse binLookupResponse) {
...
...
...
}
- (void) onRequestSurchargeConfirm:(CoreBinLookupResponse *)binLookupResponse {
...
...
...
}
To accept the surcharge fee, you can use the confirmSurchargeFee with the parameter set to true
AndroidTerminal.getInstance().confirmSurchargeFee(true);
[[WTPSTerminal singleton] confirmSurchargeFee:YES];
To decline and opt out of the sale, set the parameter to false.
AndroidTerminal.getInstance().confirmSurchargeFee(false);
[[WTPSTerminal singleton] confirmSurchargeFee:NO];
The onSaleResponse callback will fire on success. Here is where you can display receipts or do any other post transaction processing.
You should find the surcharge amount, if applied and not bypassed, in the sale response.
@Override
public void onSaleResponse(CoreSaleResponse response) {
if (response.getSurcharge() != null) {
BigDecimal surchargeAmount = response.getSurcharge().getAmount();
}
...
...
...
}
-(void)onSaleResponse:(CoreSaleResponse*)sale{
if(sale.surcharge != nil) {
NSNumber *surchargeAmount = sale.surcharge.amount;
}
...
...
...
}