16#include "ByteArrayUtil.h"
24using namespace keyple::core::util;
25using namespace keyple::core::util::cpp;
28 const std::vector<uint8_t>& cardResponse,
const int offset)
29: mOffset(offset), mCardResponse(cardResponse) {}
38 return ByteArrayUtil::twoBytesSignedToInt(mCardResponse, mOffset);
43 return ByteArrayUtil::threeBytesSignedToInt(mCardResponse, mOffset + 14);
48 std::vector<uint8_t> loadTime(2);
49 loadTime[0] = mCardResponse[mOffset + 4];
50 loadTime[1] = mCardResponse[mOffset + 5];
57 std::vector<uint8_t> loadDate(2);
58 loadDate[0] = mCardResponse[mOffset + 2];
59 loadDate[1] = mCardResponse[mOffset + 3];
66 return mCardResponse[mOffset + 6];
71 std::vector<uint8_t> samId(4);
72 System::arraycopy(mCardResponse, mOffset + 7, samId, 0, 4);
79 std::vector<uint8_t> tnNum(2);
80 tnNum[0] = mCardResponse[mOffset + 17];
81 tnNum[1] = mCardResponse[mOffset + 18];
83 return ByteArrayUtil::twoBytesToInt(tnNum, 0);
88 std::vector<uint8_t> samTNum(3);
89 System::arraycopy(mCardResponse, mOffset + 11, samTNum, 0, 3);
91 return ByteArrayUtil::threeBytesToInt(samTNum, 0);
96 os <<
"SV_DEBIT_LOG_RECORD_ADAPTER: {"
101 <<
"KVC: " << ra.
getKvc() <<
", "
102 <<
"SAM_ID: " << ra.
getSamId() <<
", "
103 <<
"SV_TRANSACTION_NUMBER: " << ra.
getSvTNum() <<
", "
104 <<
"SV_SAM_TRANSACTION_NUMBER: " << ra.
getSamTNum()
110std::ostream&
operator<<(std::ostream& os,
const std::shared_ptr<SvDebitLogRecordAdapter> ra)
113 os <<
"SV_DEBIT_LOG_RECORD_ADAPTER: null";
124 "\"amount\":" + std::to_string(
getAmount()) +
", " \
125 "\"balance\":" + std::to_string(
getBalance()) +
", " \
126 "\"debitDate\":" + ByteArrayUtil::toHex(
getDebitDate()) +
", " \
127 "\"loadTime\":" + ByteArrayUtil::toHex(
getDebitDate()) +
", " \
128 "\"kvc\":" + std::to_string(
getKvc()) +
", " \
129 "\"samId\": \"" + ByteArrayUtil::toHex(
getSamId()) +
"\", " \
130 "\"svTransactionNumber\":" + std::to_string(
getSvTNum()) +
", " \
131 "\"svSamTransactionNumber\":" + std::to_string(
getSamTNum()) +
"" \
const std::vector< uint8_t > & getRawData() const override
uint8_t getKvc() const override
SvDebitLogRecordAdapter(const std::vector< uint8_t > &cardResponse, const int offset)
int getSamTNum() const override
int getAmount() const override
int getSvTNum() const override
int getBalance() const override
const std::vector< uint8_t > getDebitDate() const override
const std::vector< uint8_t > getSamId() const override
const std::vector< uint8_t > getDebitTime() const override
const std::string toJSONString() const
std::ostream & operator<<(std::ostream &os, const std::shared_ptr< ApduRequestAdapter > ara)