EET (Czech Registration of Sales) in Swift
Česky:
"Knihovna" pro EET napsaná ve Swiftu. Vyžaduje XUCore (https://github.com/charlieMonroe/XUCore/).
-- Potřebné knihovny pro iOS:
- KissXML
- AEXML
- SwiftyRSA
- SwCrypto
Příklad použití:
let zeroPayment = XUEETCommunicator.PaymentCommand.PaymentAmount.VATPayment(vatExclusive: NSDecimalNumber.zero, vat: NSDecimalNumber.zero)
let amount = XUEETCommunicator.PaymentCommand.PaymentAmount(total: NSDecimalNumber.zero, baseRateVATPayment: zeroPayment, loweredRateVATPayment: zeroPayment)
let paymentCommand = XUEETCommunicator.PaymentCommand(documentNumber: "00001", paymentAmount: amount, transactionDate: Date())
let vatRegistrationNumber = "CZ0101010101"
let localeSpecificData = XUCzechLocaleSpecificPreferencesData()
// ... fill localeSpecificData.
let communicator = try XUEETCommunicator(localeSpecificData: localeSpecificData, vatRegistrationID: vatRegistrationNumber)
let response = try communicator.sendPayment(paymentCommand, validatingOnly: true, testMode: false) // možnost zapnutí playground serveru pomocí testMode argumentu
Pokud máte nějaké dotazy, pište.