This file contains 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 com.annimon.stream.Collectors; | |
import com.annimon.stream.Stream; | |
import java.math.BigDecimal; | |
import java.math.RoundingMode; | |
import java.util.ArrayList; | |
import java.util.Currency; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Locale; |
This file contains 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
//We assume you have complete a Sale or retreived a Sale Response using History query/search. | |
//Note: having a valid Sale Response object is mandatory for the steps below. | |
let saleResponse: WDSaleResponse = WDSaleResponse() //In your code, instead of an empty sale, saleResponse is your actual sale response object | |
//Receipt for individual payments: | |
//If you want the receipt for a payment you know its id (instead of the whole Sale), you can get the saleResponse of that subPayment by using the function: | |
//let subPaymentResponse = saleResponse.paymentForReceipt:yourPaymentId | |
//subPaymentResponse.receipt(:showReturns:format:... |
This file contains 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
let sdk: WDePOS = WDePOS.sharedInstance() | |
//Example for getting a zip of receipt images previously uploaded | |
sdk.fileManager.files("merchantId", category: "receiptImages") { (files, error) in | |
if error != nil || files == nil { | |
//Unknown error when loading receipt images - \(error?.localizedDescription ?? "")") | |
return | |
} | |
guard let files = files, let file = files.first, let fileId = file.internalId, let fileName = file.originalFileName else { |
This file contains 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.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() |
This file contains 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 com.jakewharton.rxrelay2.BehaviorRelay; | |
import com.jakewharton.rxrelay2.Relay; | |
import java.math.BigDecimal; | |
import java.util.ArrayList; | |
import java.util.List; | |
import de.wirecard.epos.model.sale.builder.PurchaseRequest; | |
import de.wirecard.epos.model.sale.builder.payment.EftCardPurchasePayment; | |
import de.wirecard.epos.model.sale.sales.SaleItem; |
This file contains 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
let sdk: WDePOS = WDePOS.sharedInstance() | |
// Discover active terminals and use it - in this case we use the first one | |
// Alternatively use the one discovered previously and stored in an instance variable (or user preferences) | |
sdk.terminalManager.discoverDevices(WDExtensionTypeUUID.WDPosMateExtensionUUID) { (terminals: [WDTerminal]?, error: Error?) in | |
if let terminalsArr = terminals { | |
//Here we assume that at least one terminal is present | |
let terminal:WDTerminal! = terminalsArr.first | |
// Create the instance of the Sale Request |
NewerOlder