val paybutton2 = create( activity, configuration.merchant.providerMode, configuration.merchant.identifier, configuration.merchant.secret ) val paybuttonConfiguration = UiConfiguration.Builder() .paymentOptions(/*...*/) .summaryFeatures(/*...*/) .customMerchantReceipt { transaction: Transaction -> PrintLayoutFactory.Builder() .addParagraph("This is Custom Receipt") .addParagraph("Welcome to our shop") .addImage("/sdcard/Download/logo.png") .addParagraph("This is centered", AccessoryPrinter.Align.CENTER) .addParagraph("This is right", AccessoryPrinter.Align.RIGHT) .addParagraph("This is left", AccessoryPrinter.Align.LEFT) .addLabelValue("Date", "12.12.2020") .addLabelValue("Time", "13:55") .addParagraph("amount is :" + transaction.amount) .forReceipt(transaction.merchantReceipt) .addMerchantInfo() .addClearingDetails() .addEject() .build() } .build() paybutton2.configuration = paybuttonConfiguration
io.mpos.paybutton.MposUi paybutton2 = io.mpos.paybutton.MposUi.create( activity, configuration.getMerchant().getProviderMode(), configuration.getMerchant().getIdentifier(), configuration.getMerchant().getSecret() ); UiConfiguration paybuttonConfiguration = new UiConfiguration.Builder() .paymentOptions(/*...*/) .summaryFeatures(/*...*/) .customMerchantReceipt( transaction -> new PrintLayoutFactory.Builder() .addParagraph("This is Custom Receipt") .addParagraph("Welcome to our shop") .addImage("/sdcard/Download/logo.png") .addParagraph("This is centered", AccessoryPrinter.Align.CENTER) .addParagraph("This is right", AccessoryPrinter.Align.RIGHT) .addParagraph("This is left", AccessoryPrinter.Align.LEFT) .addLabelValue("Date", "12.12.2020") .addLabelValue("Time", "13:55") .addParagraph("amount is :" + transaction.getAmount()) .forReceipt(transaction.getMerchantReceipt()) .addMerchantInfo() .addClearingDetails() .addEject() .build() ) .build(); paybutton2.setConfiguration(paybuttonConfiguration);
// you should reuse the same instance of mposui and not create a new one val paybutton2 = create( activity, configuration.merchant.providerMode, configuration.merchant.identifier, configuration.merchant.secret ) val paybuttonConfiguration = UiConfiguration.Builder() .terminalParameters(accessoryParameters) .build() paybutton2.setConfiguration(paybuttonConfiguration) // start activity with this intent: paybutton2.createCustomPrintIntent( PrintLayoutFactory.Builder() .addParagraph("This is a custom receipt") .addParagraph("It can be printed anytime") .addParagraph("even without transaction") .addEject() .build() )
// you should reuse the same instance of mposui and not create a new one io.mpos.paybutton.MposUi paybutton2 = io.mpos.paybutton.MposUi.create( activity, configuration.getMerchant().getProviderMode(), configuration.getMerchant().getIdentifier(), configuration.getMerchant().getSecret() ); UiConfiguration paybuttonConfiguration = new UiConfiguration.Builder() .terminalParameters(accessoryParameters) .build(); paybutton2.setConfiguration(paybuttonConfiguration); // start activity with this intent: paybutton2.createCustomPrintIntent( new PrintLayoutFactory.Builder() .addParagraph("This is a custom receipt") .addParagraph("It can be printed anytime") .addParagraph("even without transaction") .addEject() .build()