![]() |
Keyple Card Calypso C++ Library 2.1.0
Reference Terminal Reader API for C++
|
#include <CmdCardSvUndebit.h>
Public Member Functions | |
CmdCardSvUndebit (const std::shared_ptr< CalypsoCard > calypsoCard, const int amount, const uint8_t kvc, const std::vector< uint8_t > &date, const std::vector< uint8_t > &time) | |
void | finalizeCommand (const std::vector< uint8_t > &undebitComplementaryData) |
const std::vector< uint8_t > | getSvUndebitData () const |
bool | isSessionBufferUsed () const override |
CmdCardSvUndebit & | setApduResponse (const std::shared_ptr< ApduResponseApi > apduResponse) override |
const std::vector< uint8_t > | getSignatureLo () const |
const std::map< const int, const std::shared_ptr< StatusProperties > > & | getStatusTable () const override |
![]() | |
AbstractCardCommand (const CalypsoCardCommand &commandRef) | |
const CalypsoCardCommand & | getCommandRef () const override |
const CalypsoApduCommandException | buildCommandException (const std::type_info &exceptionClass, const std::string &message, const CardCommand &commandRef, const int statusWord) const final |
void | checkStatus () override |
![]() | |
AbstractApduCommand (const CardCommand &commandRef) | |
virtual void | addSubName (const std::string &subName) final |
virtual const std::string & | getName () const final |
virtual void | setApduRequest (const std::shared_ptr< ApduRequestAdapter > apduRequest) final |
virtual const std::shared_ptr< ApduRequestAdapter > | getApduRequest () const final |
virtual const std::shared_ptr< ApduResponseApi > | getApduResponse () const final |
virtual bool | isSuccessful () const final |
virtual const std::string | getStatusInformation () const final |
Additional Inherited Members | |
![]() | |
static const std::map< const int, const std::shared_ptr< StatusProperties > > | STATUS_TABLE |
(package-private)
Builds the SV Undebit command.
See specs: Calypso Stored Value balance (signed binaries' coding based on the two's complement method)
balance - 3 bytes signed binary - Integer from -8,388,608 to 8,388,607
-8,388,608 %10000000.00000000.00000000 -8,388,607 %10000000.00000000.00000001 -8,388,606 %10000000.00000000.00000010 -3 %11111111.11111111.11111101 -2 %11111111.11111111.11111110 -1 %11111111.11111111.11111111 0 %00000000.00000000.00000000 1 %00000000.00000000.00000001 2 %00000000.00000000.00000010 3 %00000000.00000000.00000011 8,388,605 %01111111.11111111.11111101 8,388,606 %01111111.11111111.11111110 8,388,607 %01111111.11111111.11111111
amount - 2 bytes signed binary
amount for debit - Integer 0..32767 => for negative value
-32767 %10000000.00000001 -32766 %10000000.00000010 -3 %11111111.11111101 -2 %11111111.11111110 -1 %11111111.11111111 0 %00000000.00000000 Notice: -32768 (%10000000.00000000) is not allowed.
Definition at line 78 of file CmdCardSvUndebit.h.
keyple::card::calypso::CmdCardSvUndebit::CmdCardSvUndebit | ( | const std::shared_ptr< CalypsoCard > | calypsoCard, |
const int | amount, | ||
const uint8_t | kvc, | ||
const std::vector< uint8_t > & | date, | ||
const std::vector< uint8_t > & | time | ||
) |
(package-private)
Instantiates a new CmdCardSvUndebit.
calypsoCard | the Calypso card. |
amount | amount to undebit (positive integer from 0 to 32767). |
kvc | the KVC. |
date | debit date (not checked by the card). |
time | debit time (not checked by the card). |
IllegalArgumentException | If the command is inconsistent |
Definition at line 44 of file CmdCardSvUndebit.cpp.
void keyple::card::calypso::CmdCardSvUndebit::finalizeCommand | ( | const std::vector< uint8_t > & | undebitComplementaryData | ) |
(package-private)
Complete the construction of the APDU to be sent to the card with the elements received from the SAM:
4-byte SAM id
3-byte challenge
3-byte transaction number
5 or 10 byte signature (hi part)
undebitComplementaryData | the data out from the SvPrepareDebit SAM command. |
Definition at line 89 of file CmdCardSvUndebit.cpp.
const std::vector< uint8_t > keyple::card::calypso::CmdCardSvUndebit::getSignatureLo | ( | ) | const |
Gets the SV signature.
The signature can be empty here in the case of a secure session where the transmission of the signature is postponed until the end of the session.
Definition at line 158 of file CmdCardSvUndebit.cpp.
|
overridevirtual |
(package-private)
Returns the internal status table
Reimplemented from keyple::card::calypso::AbstractApduCommand.
Definition at line 194 of file CmdCardSvUndebit.cpp.
const std::vector< uint8_t > keyple::card::calypso::CmdCardSvUndebit::getSvUndebitData | ( | ) | const |
(package-private)
Gets the SV Debit part of the data to include in the SAM SV Prepare Debit command
Definition at line 122 of file CmdCardSvUndebit.cpp.
|
overridevirtual |
(package-private)
Indicates if the session buffer is used when executing this command.Allows the management of the overflow of this buffer.
Implements keyple::card::calypso::AbstractCardCommand.
Definition at line 140 of file CmdCardSvUndebit.cpp.
|
overridevirtual |
(package-private)
Sets the command ApduResponseApi.
apduResponse | The APDU response. |
The permitted lengths are 0 (in session), 3 (not 3.2) or 6 (3.2)
IllegalStateException | If the length is incorrect. |
Reimplemented from keyple::card::calypso::AbstractCardCommand.
Definition at line 145 of file CmdCardSvUndebit.cpp.