Hi guys,
We have the HostedPayment URL service embedded within an iframe in our web page https://certtransaction.hostedpayments.com/?TransactionSetupID=<ID>,
So during the duplicate scenario testing with the amount $0.23 HostedPayment returns a DUPLICATE response error message within the iframe content as you can see in the attached screen shot, so we have a requirement to add a button to 'Retry' the payment in the PARENT WINDOW if the DUPLICATE error is displayed.
Do you know how to notify the parent window when there is an error such as the above within the iframe?
We were trying to access the iframe contentWindow with javascript coding but it is not enabled due the cross-origin security polices. https://www.w3schools.com/jsref/prop_frame_contentwindow.asp
Thanks,
Cristopher
Hi Cristopher,
Ultimately since Hosted Payments is designed to be customer facing the error is returned to the end user so that they are aware the transaction has already processed. Keep in mind that a TransactionSetupID can only be used once, meaning that the only way this response would be received in Production would be if two pages were rendered, with separate TransactionSetupIDs, for the same amount and the customer used the same card within 25 transactions. In this scenario you can build out your Parent window with logic to either override or disable duplicate checking:
DuplicateOverrideFlag: Set this flag to true to override the duplicate checking feature if the response from the host indicates a duplicate transaction has been attempted. In other words, if you send a transaction that was determined to be a duplicate by the host,set this flag to true and resend the same transaction to bypass the duplicate checking feature on the host. This is a per transaction request feature.
DuplicateCheckDisableFlag: Set this flag to true to disable the duplicate checking feature on the host. If this flag is set to true no duplicate checks will be performed for that transaction. This is a per transaction request feature.
Otherwise, we advise our ISVs to implement a TransactionQuery that they can call periodically after a TransactionSetup method so that the parent window will know the state of the transaction. You can use various parameters from the TransactionSetupID or the ReferenceNumber defined in the setup so that you can retrieve all the information.
While our ISVs have implemented various methods to get this information we are unable to advise on any specific implementation outside of the TransactionQuery method to retrieve this from our page. Since this is designed to be a reduced scope solution we have security preventing certain policies such as CORS that could be used to pull senstive information from the cardholder.
Hope this helps.
Thank you,