Posts: 2
Registered: ‎04-18-2017

Iframe Response/

[ Edited ]

Hi i am new to the world and i have been playing around with the hosted payment form. i am creating a Applicaiton and trying to integrate this payment page. I have gotten the iframe to open the gateway. but how can i get a response back from the iframe and forward the origianl page? i have a little example code here that i have modified. 

Our client doesnt want the form to be hosted on there page so that is why we are using the iframe so we can have handle everything.

I know this is a broad look at this but i have read through alot of the documentation and still have not come up with any conclusions.

If there are any tips or tricks to do this in asp. it would be greatly appreciated.

Protected Sub ASPxPopupControl1_Load(sender As Object, e As EventArgs) Handles ASPxPopupControl1.Load
        Dim ApiLoginID As String = "Login"
        Dim ApiTransactionKey As String = "Key"
        Dim amount As Decimal = 400
        ApiOperationBase(Of ANetApiRequest, ANetApiResponse).RunEnvironment = AuthorizeNet.Environment.SANDBOX
        ApiOperationBase(Of ANetApiRequest, ANetApiResponse).MerchantAuthentication = New merchantAuthenticationType() With {
                .name = ApiLoginID,
                .ItemElementName = ItemChoiceType.transactionKey,
                .Item = ApiTransactionKey
        Dim settings As settingType() = New settingType(3) {}

        settings(0) = New settingType()
        settings(0).settingName = settingNameEnum.hostedPaymentButtonOptions.ToString()
        settings(0).settingValue = "{""text"": ""Pay""}"

        settings(1) = New settingType()
        settings(1).settingName = settingNameEnum.hostedPaymentOrderOptions.ToString()
        settings(1).settingValue = "{""show"": false}"

        settings(2) = New settingType()
        settings(2).settingName = settingNameEnum.hostedPaymentReturnOptions.ToString()
        settings(2).settingValue = "{""url"": ""https://localhost:44342/Summary2.0.aspx"", ""urlText"":""Continue"" ,""cancelUrl"":""https://localhost:44342/Summary2.0.aspx"",""cancelUrlText"":""Cancel""}"

        Dim transactiontype = transactionTypeEnum.authCaptureTransaction.ToString()
        Dim transactionRequest = New transactionRequestType()
        transactionRequest.transactionType = transactiontype
        transactionRequest.amount = amount
        Dim request = New getHostedPaymentPageRequest()
        request.transactionRequest = transactionRequest
        request.hostedPaymentSettings = settings
        Dim controller = New getHostedPaymentPageController(request)
        Dim response = controller.GetApiResponse()
        token = response.token.ToString()
        ASPxPopupControl1.ContentUrl = ""
    End Sub


Posts: 2
Registered: ‎04-18-2017

Re: Iframe Response/

Another Question that is had is that if i send the user to the payment page. will i ever get a response. if the payment is successfull or declinced?