TIM SDK
TIM API C
sub_transaction.h File Reference

Description

Sub transaction.

Object type sub_transaction.

Functions

ta_e_result_code_t ta_sub_transaction_create (ta_object_t *sub_transaction)
 Create sub transaction. More...
 
ta_e_result_code_t ta_sub_transaction_copy (ta_object_t *sub_transaction, const ta_object_t *source_sub_transaction)
 Create copy of sub transaction. More...
 
ta_e_result_code_t ta_sub_transaction_get_function (ta_object_t sub_transaction, ta_e_transaction_type_t *function)
 Transaction function. Allowed are: purchase, giro, cash_advance. More...
 
ta_e_result_code_t ta_sub_transaction_set_function (ta_object_t sub_transaction, ta_e_transaction_type_t function)
 Transaction function. Allowed are: purchase, giro, cash_advance. More...
 
ta_e_result_code_t ta_sub_transaction_get_amount (ta_object_t sub_transaction, ta_object_t *amount)
 Amount. More...
 
ta_e_result_code_t ta_sub_transaction_set_amount (ta_object_t sub_transaction, ta_object_t amount)
 Amount. More...
 
ta_e_result_code_t ta_sub_transaction_get_rate (ta_object_t sub_transaction, int *rate)
 DCC excange rate. More...
 
ta_e_result_code_t ta_sub_transaction_set_rate (ta_object_t sub_transaction, int rate)
 DCC excange rate. More...
 
ta_e_result_code_t ta_sub_transaction_get_rate_exponent (ta_object_t sub_transaction, int *rate_exponent)
 DCC excange rate exponent. More...
 
ta_e_result_code_t ta_sub_transaction_set_rate_exponent (ta_object_t sub_transaction, int rate_exponent)
 DCC excange rate exponent. More...
 

Function Documentation

◆ ta_sub_transaction_copy()

ta_e_result_code_t ta_sub_transaction_copy ( ta_object_t sub_transaction,
const ta_object_t source_sub_transaction 
)

Create copy of sub transaction.

Parameters
[out]sub_transactionPointer to variable to write created object instance to. Created object instance is retained.
[in]source_sub_transactionObject of type sub_transaction to create copy of.
Return values
ta_c_rc_okObject instance has been created and written to sub_transaction.
ta_c_rc_invalid_argumentsub_transaction is null-pointer.
ta_c_rc_invalid_argumentsource_sub_transaction is ta_invalid_object.
ta_c_rc_invalid_argumentsource_sub_transaction is not of type sub_transaction.
ta_c_rc_out_of_memoryFailed allocating memory.

◆ ta_sub_transaction_create()

ta_e_result_code_t ta_sub_transaction_create ( ta_object_t sub_transaction)

Create sub transaction.

Parameters
[out]sub_transactionPointer to variable to write created object instance to. Created object instance is retained.
Return values
ta_c_rc_okObject instance has been created and written to sub_transaction.
ta_c_rc_invalid_argumentsub_transaction is null-pointer.
ta_c_rc_out_of_memoryFailed allocating memory.

◆ ta_sub_transaction_get_amount()

ta_e_result_code_t ta_sub_transaction_get_amount ( ta_object_t  sub_transaction,
ta_object_t amount 
)

Amount.

In a request defines the original amount for the transaction (given by ECR), in response the final authorized amount (given by host) in minor units.

In a transaction request this field defines the amount in minor units that shall be authorized for this transaction.

In a transcation response this field defines the amount in minor units that has actually been authorized. If the full amount has been authorized as sent in the transaction request, the value of the <sixml:Amount> field in the request and the response is equal.

PartialApproval: If the transaction has been approved only partially by the aquiring host, the terminal must return on SIXml the actual authorized amount that has been returned from host to terminal in the authorization response.

Example for ep2: The ECR sends an <sixml:Amount>10000</sixml:Amount> field on SIXml to the terminal in the transaction request and the terminal sends this amount as <ep2:AmtAuth>10000</ep2:AmtAuth> (=100 CHF) in the authorization request to the ep2 aquiring host. The host then only can partially approve the transaction and returns the partial approval amount <ep2:AmtAuth>8000</ep2:AmtAuth> (= 80 CHF) in the authorization response to the terminal. The terminal then must return the actually approved amount back to the ECR, <sixml:Amount Currency='CHF' Exponent='2'>8000</sixml:Amount>

The amount is additionally defined by the corresponding sixml:Currency and sixml:Exponent attributes. An amount can have a negative value, e.g. in case of returning a gas canister.

Example: <sixml:Amount Currency='CHF' Exponent='2'>10000</sixml:Amount> This is CHF 100.00 Example: <sixml:Amount Currency='CHF' Exponent='2'>-10000</sixml:Amount> This is CHF -100.00 Specification: banking.

Parameters
[in]sub_transactionObject instance of type sub_transaction.
[out]amountPointer to variable to write object instance to. Object instance is of type amount and is not retained. Object instance is ta_invalid_object if value is not set in sub_transaction.
Return values
ta_c_rc_okObject instance written to amount.
ta_c_rc_invalid_argumentsub_transaction is ta_invalid_object.
ta_c_rc_invalid_argumentsub_transaction is not of type sub_transaction.
ta_c_rc_invalid_argumentamount is null-pointer.

◆ ta_sub_transaction_get_function()

ta_e_result_code_t ta_sub_transaction_get_function ( ta_object_t  sub_transaction,
ta_e_transaction_type_t function 
)

Transaction function. Allowed are: purchase, giro, cash_advance.

Available if Banking guide is enabled.

Parameters
[in]sub_transactionObject instance of type sub_transaction.
[out]functionPointer to variable to write value to. Value is ta_c_tt_undefined if value is not set in sub_transaction.
Return values
ta_c_rc_okValue written to function.
ta_c_rc_invalid_argumentsub_transaction is ta_invalid_object.
ta_c_rc_invalid_argumentsub_transaction is not of type sub_transaction.
ta_c_rc_invalid_argumentfunction is null-pointer.

◆ ta_sub_transaction_get_rate()

ta_e_result_code_t ta_sub_transaction_get_rate ( ta_object_t  sub_transaction,
int *  rate 
)

DCC excange rate.

The DCC amount (sixml:AmuntDcc) will be calculated as follows: transaction amount (sixml:Amount) / DCC rate (sixml:Rate).

Example: <sixml:Amount Currency="EUR" Exponent="2">2000</sixml:Amount> and the DCC currency is "CHF", the sixml:Rate="8623328" and sixml:RateExponent="7" => 20.00 EUR / 0.8623328 => 23.19 CHF

Optional: Only in multi currency situations Specification: banking.

Parameters
[in]sub_transactionObject instance of type sub_transaction.
[out]ratePointer to variable to write value to.
Return values
ta_c_rc_okObject instance written to rate.
ta_c_rc_invalid_argumentsub_transaction is ta_invalid_object.
ta_c_rc_invalid_argumentsub_transaction is not of type sub_transaction.
ta_c_rc_invalid_argumentrate is null-pointer.

◆ ta_sub_transaction_get_rate_exponent()

ta_e_result_code_t ta_sub_transaction_get_rate_exponent ( ta_object_t  sub_transaction,
int *  rate_exponent 
)

DCC excange rate exponent.

Parameters
[in]sub_transactionObject instance of type sub_transaction.
[out]rate_exponentPointer to variable to write value to.
Return values
ta_c_rc_okObject instance written to rate.
ta_c_rc_invalid_argumentsub_transaction is ta_invalid_object.
ta_c_rc_invalid_argumentsub_transaction is not of type sub_transaction.
ta_c_rc_invalid_argumentrate_exponent is null-pointer.

◆ ta_sub_transaction_set_amount()

ta_e_result_code_t ta_sub_transaction_set_amount ( ta_object_t  sub_transaction,
ta_object_t  amount 
)

Amount.

In a request defines the original amount for the transaction (given by ECR), in response the final authorized amount (given by host) in minor units.

In a transaction request this field defines the amount in minor units that shall be authorized for this transaction.

In a transcation response this field defines the amount in minor units that has actually been authorized. If the full amount has been authorized as sent in the transaction request, the value of the <sixml:Amount> field in the request and the response is equal.

PartialApproval: If the transaction has been approved only partially by the aquiring host, the terminal must return on SIXml the actual authorized amount that has been returned from host to terminal in the authorization response.

Example for ep2: The ECR sends an <sixml:Amount>10000</sixml:Amount> field on SIXml to the terminal in the transaction request and the terminal sends this amount as <ep2:AmtAuth>10000</ep2:AmtAuth> (=100 CHF) in the authorization request to the ep2 aquiring host. The host then only can partially approve the transaction and returns the partial approval amount <ep2:AmtAuth>8000</ep2:AmtAuth> (= 80 CHF) in the authorization response to the terminal. The terminal then must return the actually approved amount back to the ECR, <sixml:Amount Currency='CHF' Exponent='2'>8000</sixml:Amount>

The amount is additionally defined by the corresponding sixml:Currency and sixml:Exponent attributes. An amount can have a negative value, e.g. in case of returning a gas canister.

Example: <sixml:Amount Currency='CHF' Exponent='2'>10000</sixml:Amount> This is CHF 100.00 Example: <sixml:Amount Currency='CHF' Exponent='2'>-10000</sixml:Amount> This is CHF -100.00 Specification: banking.

Parameters
[in]sub_transactionObject instance of type sub_transaction.
[in]amountObject instance to set. Object instance can be ta_invalid_object to clear the value in sub_transaction. If object instance is not ta_invalid_object is has to be of type amount.
Return values
ta_c_rc_okObject instance assigned to sub_transaction.
ta_c_rc_invalid_argumentsub_transaction is ta_invalid_object.
ta_c_rc_invalid_argumentsub_transaction is not of type sub_transaction.
ta_c_rc_invalid_argumentamount is not ta_invalid_object and is not of type amount.

◆ ta_sub_transaction_set_function()

ta_e_result_code_t ta_sub_transaction_set_function ( ta_object_t  sub_transaction,
ta_e_transaction_type_t  function 
)

Transaction function. Allowed are: purchase, giro, cash_advance.

Available if Banking guide is enabled.

Parameters
[in]sub_transactionObject instance of type sub_transaction.
[in]functionValue to set. Value can be ta_c_tt_undefined to clear the value in sub_transaction.
Return values
ta_c_rc_okValue assigned to sub_transaction.
ta_c_rc_invalid_argumentsub_transaction is ta_invalid_object.
ta_c_rc_invalid_argumentsub_transaction is not of type sub_transaction.
ta_c_rc_invalid_argumentfunction is null-pointer.
ta_c_rc_invalid_argumentfunction is not purchase, giro or cash_advance.

◆ ta_sub_transaction_set_rate()

ta_e_result_code_t ta_sub_transaction_set_rate ( ta_object_t  sub_transaction,
int  rate 
)

DCC excange rate.

The DCC amount (sixml:AmuntDcc) will be calculated as follows: transaction amount (sixml:Amount) / DCC rate (sixml:Rate).

Example: <sixml:Amount Currency="EUR" Exponent="2">2000</sixml:Amount> and the DCC currency is "CHF", the sixml:Rate="8623328" and sixml:RateExponent="7" => 20.00 EUR / 0.8623328 => 23.19 CHF

Optional: Only in multi currency situations Specification: banking.

Parameters
[in]sub_transactionObject instance of type sub_transaction.
[in]rateValue to set.
Return values
ta_c_rc_okObject instance assigned to sub_transaction.
ta_c_rc_invalid_argumentsub_transaction is ta_invalid_object.
ta_c_rc_invalid_argumentsub_transaction is not of type sub_transaction.

◆ ta_sub_transaction_set_rate_exponent()

ta_e_result_code_t ta_sub_transaction_set_rate_exponent ( ta_object_t  sub_transaction,
int  rate_exponent 
)

DCC excange rate exponent.

Parameters
[in]sub_transactionObject instance of type sub_transaction.
[in]rate_exponentValue to set
Return values
ta_c_rc_okObject instance assigned to sub_transaction.
ta_c_rc_invalid_argumentsub_transaction is ta_invalid_object.
ta_c_rc_invalid_argumentsub_transaction is not of type sub_transaction.