Skip to content

Instantly share code, notes, and snippets.

EposSDK Send Sale Receipt
import de.wirecard.epos.model.sale.SendingWay;
import de.wirecard.epos.model.with.With;
import de.wirecard.epos.model.with.WithFields;
import io.reactivex.android.schedulers.AndroidSchedulers;
//initialize your params
String id, number;
eposSDK.sales()
.sendReceipt(SendingWay.SMS, id, number) //Which way you want to send Receipt (Email or SMS); id of Sale; number or email adress where you want to send receipt
.observeOn(AndroidSchedulers.mainThread()) // in case you want result in main thread
.subscribe(() -> {
//successfully sent
}, throwable -> {
//error
});
//******************** USING WITH PARAMETER ********************//
WithFields withFields = With.fields().param("type", "FOR_ORIGINAL_SALE"); // add optional parameter type to backend request
eposSDK.sales()
.sendReceipt(SendingWay.SMS, id, number, withFields) //Which way you want to send Receipt (Email or SMS); id of Sale; number or email adress where you want to send receipt
.observeOn(AndroidSchedulers.mainThread()) // in case you want result in main thread
.subscribe(() -> {
//successfully sent
}, throwable -> {
//error
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment