TIM SDK
TIM API C
loyalty_coupon.h File Reference

Description

Loyalty coupon. Contains amount value given by merchant.

Object type loyalty_coupon.

Functions

ta_e_result_code_t ta_loyalty_coupon_create (ta_object_t *loyalty_coupon, ta_object_t amount, ta_e_currency_t currency, ta_object_t exponent, ta_object_t id, ta_e_coupon_rejection_reason_t rejection_reason)
 Create object of type loyalty_coupon. More...
 
ta_e_result_code_t ta_loyalty_coupon_get_amount (ta_object_t loyalty_coupon, ta_object_t *amount)
 Coupon amount. More...
 
ta_e_result_code_t ta_loyalty_coupon_get_currency (ta_object_t loyalty_coupon, ta_e_currency_t *currency)
 Coupon currency. More...
 
ta_e_result_code_t ta_loyalty_coupon_get_exponent (ta_object_t loyalty_coupon, ta_object_t *exponent)
 Exponent of coupon amount. More...
 
ta_e_result_code_t ta_loyalty_coupon_get_id (ta_object_t loyalty_coupon, ta_object_t *id)
 Coupon ID. More...
 
ta_e_result_code_t ta_loyalty_coupon_get_rejection_reason (ta_object_t loyalty_coupon, ta_e_coupon_rejection_reason_t *rejection_reason)
 Coupon rejection reason. More...
 

Function Documentation

◆ ta_loyalty_coupon_create()

ta_e_result_code_t ta_loyalty_coupon_create ( ta_object_t loyalty_coupon,
ta_object_t  amount,
ta_e_currency_t  currency,
ta_object_t  exponent,
ta_object_t  id,
ta_e_coupon_rejection_reason_t  rejection_reason 
)

Create object of type loyalty_coupon.

Parameters
[out]loyalty_couponPointer to variable to write created object instance to. Created object instance is retained.
[in]amountCoupon amount in minor units as object of type integer.
[in]currencyCurrency of amount.
[in]exponentExponent of amount as object of type integer.
[in]idCoupon ID.
[in]rejection_reasonRejection reason.
Return values
ta_c_rc_okObject instance has been created and written to loyalty_coupon.
ta_c_rc_invalid_argumentloyalty_coupon is null-pointer.
ta_c_rc_invalid_argumentcurrency is not a valid value from ta_e_currency_t.
ta_c_rc_invalid_argumentamount is less than 0.
ta_c_rc_invalid_argumentexponent is less than 0.
ta_c_rc_invalid_argumentamount is ta_object_invalid.
ta_c_rc_invalid_argumentexponent is ta_object_invalid.
ta_c_rc_invalid_argumentid is ta_object_invalid.
ta_c_rc_invalid_argumentrejection_reason is not a valid value from ta_e_coupon_rejection_reason_t.
ta_c_rc_out_of_memoryFailed allocating memory.

◆ ta_loyalty_coupon_get_amount()

ta_e_result_code_t ta_loyalty_coupon_get_amount ( ta_object_t  loyalty_coupon,
ta_object_t amount 
)

Coupon amount.

Parameters
[in]loyalty_couponObject instance of type loyalty_coupon.
[out]amountPointer to variable to write value to. Object instance of type integer and is not retained.
Return values
ta_c_rc_okObject instance written to amount.
ta_c_rc_invalid_argumentloyalty_coupon is ta_object_invalid.
ta_c_rc_invalid_argumentloyalty_coupon is not of type loyalty_coupon.
ta_c_rc_invalid_argumentamount is null-pointer.

◆ ta_loyalty_coupon_get_currency()

ta_e_result_code_t ta_loyalty_coupon_get_currency ( ta_object_t  loyalty_coupon,
ta_e_currency_t currency 
)

Coupon currency.

Parameters
[in]loyalty_couponObject instance of type loyalty_coupon.
[out]currencyPointer to variable to write value to.
Return values
ta_c_rc_okObject instance written to amount.
ta_c_rc_invalid_argumentloyalty_coupon is ta_object_invalid.
ta_c_rc_invalid_argumentloyalty_coupon is not of type loyalty_coupon.
ta_c_rc_invalid_argumentcurrency is null-pointer.

◆ ta_loyalty_coupon_get_exponent()

ta_e_result_code_t ta_loyalty_coupon_get_exponent ( ta_object_t  loyalty_coupon,
ta_object_t exponent 
)

Exponent of coupon amount.

Parameters
[in]loyalty_couponObject instance of type loyalty_coupon.
[out]exponentPointer to variable to write value to. Object instance of type integer and is not retained.
Return values
ta_c_rc_okObject instance written to exponent.
ta_c_rc_invalid_argumentloyalty_coupon is ta_object_invalid.
ta_c_rc_invalid_argumentloyalty_coupon is not of type loyalty_coupon.
ta_c_rc_invalid_argumentexponent is null-pointer.

◆ ta_loyalty_coupon_get_id()

ta_e_result_code_t ta_loyalty_coupon_get_id ( ta_object_t  loyalty_coupon,
ta_object_t id 
)

Coupon ID.

Parameters
[in]loyalty_couponObject instance of type loyalty_coupon.
[out]idPointer to variable to write object instance to. Object instance is of type string and is not retained.
Return values
ta_c_rc_okObject instance written to id.
ta_c_rc_invalid_argumentloyalty_coupon is ta_object_invalid.
ta_c_rc_invalid_argumentloyalty_coupon is not of type loyalty_coupon.
ta_c_rc_invalid_argumentid is null-pointer.

◆ ta_loyalty_coupon_get_rejection_reason()

ta_e_result_code_t ta_loyalty_coupon_get_rejection_reason ( ta_object_t  loyalty_coupon,
ta_e_coupon_rejection_reason_t rejection_reason 
)

Coupon rejection reason.

Parameters
[in]loyalty_couponObject instance of type loyalty_coupon.
[out]rejection_reasonPointer to variable to write value to.
Return values
ta_c_rc_okObject instance written to rejection_reason.
ta_c_rc_invalid_argumentloyalty_coupon is ta_object_invalid.
ta_c_rc_invalid_argumentloyalty_coupon is not of type loyalty_coupon.
ta_c_rc_invalid_argumentrejection_reason is null-pointer.