Initial recognition is at fair value plus transaction cost. To arrive at the fair value, the future cash inflows should to be discounted using the prevailing market rate for a similar loan. The transaction price may consider as the fair value if the effect of the discounting is insignificant.
Subsequent measurement should beat amortized cost. In the case, where the difference between the initial fair value and the maturity value is insignificant, the transaction price may be considered for subsequent measurement purposes as well.