I am writing the unit test project to get the card details for a given temp token.
1. To create a temp token using moneris api in unit test proj
ResTempAdd resTempToken = new ResTempAdd(pan, expiryDate, crypt type, duration); HttpsPostRequest mpgReq = new HttpsPostRequest("esqa.moneris.com", "store1", "yesguy", resTempToken); Receipt monerisReceipt = mpgReq.GetReceipt();
datakey= Receipt.GetDataKey();
2. Based on the temp token generated from step 1, I call
ResLookupMasked resLookupMasked = new ResLookupMasked(datakey); HttpsPostRequest mpgReq = new HttpsPostRequest("esqa.moneris.com", "store1", "yesguy", "false", resLookupMasked); Receipt receipts = mpgReq.GetReceipt();
I don't get the card details from the receipts, instead some of the properties shows (currentdatakey : null, hasmultipledatakey: true)
Can you please help me in getting the card details on passing the temp token. in real time, i will get the temp token on postin the iframe, so step 1 is just meant for testing purpose.
In reply to RR_Moneris:
ResTempAdd API was called at the unit test proj where we cannot use the iframe. The returned result is just same as the iframe which is the temp datakey.
The problem we are facing is getting the exp date for the card associated with the temp token while using ResLookupMasked. Following is the error we get from the receipt.
Receipt.currentTag = "ResolveData"
Receipt.hasMutipleDataKey= true
receipts.globalErrorReceipt
<?xml version="1.0"?><response><receipt><ReceiptId>Global Error Receipt</ReceiptId><ReferenceNum>null</ReferenceNum><ResponseCode>null</ResponseCode><ISO>null</ISO> <AuthCode>null</AuthCode><TransTime>null</TransTime><TransDate>null</TransDate><TransType>null</TransType><Complete>false</Complete><Message>null</Message><TransAmount>null</TransAmount><CardType>null</CardType><TransID>null</TransID><TimedOut>null</TimedOut></receipt></response>
Thanks for your quick response, please help us in getting this resolved.
In reply to sathish: