Skip to content

Instantly share code, notes, and snippets.

@WirecardMobileServices
Created September 16, 2019 11:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WirecardMobileServices/112709bb2af16f6d1678d3fc194b16bc to your computer and use it in GitHub Desktop.
Save WirecardMobileServices/112709bb2af16f6d1678d3fc194b16bc to your computer and use it in GitHub Desktop.
import de.wirecard.epos.EposSDK;
import de.wirecard.epos.model.with.With;
import de.wirecard.epos.model.with.WithBase;
import de.wirecard.epos.model.with.WithFields;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
//handling FileRecords
WithFields withFields = With.fields().scheduler(Schedulers.newThread());
epos.fileManager()
.getFileRecord("fileId", withFields)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(fileRecord -> {
// getFileRecord was performed successfully
// Single<FileRecords> is returned, you have now some basic information about this file
}, throwable -> {
// handle error
});
epos.fileManager()
.getFilesList("merchantId","categoryName", withFields)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(fileRecordsList -> {
// getFilesList for merchant and category was performed successfully
// Single<List<FileRecords>> is returned, you have now all files aligned with specified merchnat and for mentioned category
}, throwable -> {
// handle error
});
epos.fileManager()
.getFilesCategories(withFields)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(fileRecordCategoryList -> {
// getFilesCategories was performed successfully
// Single<List<FileRecordCategory>> is returned, you have now list of all categories
}, throwable -> {
// handle error
});
// Download particular file
WithBase withBase = With.base().scheduler(Schedulers.io());
epos.fileManager()
.getFile("fileId",withBase)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(fileRecordCategoryList -> {
// getFile was performed successfully
// Single<File> is returned, you can access to phisical file data
}, throwable -> {
// handle error
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment