As an alternative to webhook – which is based on sending notifications from InstaMed to an application – applications can receive real-time notifications by polling InstaMed about a specific transaction. This allows real-time notification without requiring unsolicited messaging from an outside system that may be blocked by firewalls and security features. Using a token generated through an SSO session, an application can determine whether a transaction has been processed or updated.
Initiating a polling response is done by getting the status of the token and then getting the transaction details once the token is complete.
Get Token Status
- URL: https://online.instamed.com/Forms/WebServices/SSOService.asmx
- Method: GetSSOTokenStatus
- After performing SSO and loading a page to the RelayStateURL, poll https://online.instamed.com/Forms/WebServices/SSOService.asmx every 10 seconds for up to 15 minutes (token expiration time limit)
- While the token status = NEW, sleep for 10 seconds
- If the taken status = EXPIRED, the SSO session expired before the transaction was completed
- If the token status = complete, retrieve the payment details (see the following example)
Get Transaction Details
- URL: https://online.instamed.com/payment/NVP.aspx
Request merchantID=6011000551245&storeID=001&terminalID=002&transactionAction=ViewReceipt&requestToken=false&allowPartialPayment=false&singleSignOnToken=NTJmY2Y5NmMtOTg2Yi00NDM0LTk2ZWYtZjc3OGE1OTVhN2Qz& Response IsEMVVerifiedByPIN=false&isEMVTransaction=false&EMVCardEntryMode=Swiped&cardBrand=VISA&cardExpirationMonth=6&cardExpirationYear=2017&cardBINNumber=411111&cardHolderName= &lastFourDigits=1111&authorizationNumber=A3807B&responseCode=010&responseMessage=Partially Approved $1.00&transactionStatus=D&primaryTransactionID=0ca7530a86084b468fff132ab7f04491&authorizationText=I AGREE TO PAY THE ABOVE AMOUNT ACCORDING TO MY CARD HOLDER AGREEMENT.&transactionID=0ca7530a86084b468fff132ab7f04491&transactionDate=2016-01-15T20:37:21.5238539Z