Last active
May 10, 2019 07:42
EposSDK Send Sale Receipt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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