<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Accept Hosted 550 Error After Payment in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-550-Error-After-Payment/m-p/88761#M55936</link>
    <description>&lt;P&gt;I'm using authorize.net for a NextJS project for a client's payment processing. I am trying to make test transactions and it just won't work. I am correctly using the&amp;nbsp;getHostedPaymentPageRequest&amp;nbsp;to get my token, and when I go to display the form via Accept Hosted Redirect, that works too, but when I click "Pay", I get the email receipt that the payment worked, but on the hosted payment page I just see "Processing..." for around 2 minutes and then I get this error.&amp;nbsp;POST &lt;A href="https://test.authorize.net/Payment/Api.ashx" target="_blank"&gt;https://test.authorize.net/Payment/Api.ashx&lt;/A&gt; 550. I see several other people have asked similar questions to this, but they were not answered. Any help would be greatly appreciated. I will post my code below.&lt;/P&gt;&lt;P&gt;Get Hosted Payment Page Response&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;export async function POST(req) {
  try {
    const merchantAuthenticationType =
      new APIContracts.MerchantAuthenticationType()
    merchantAuthenticationType.setName(process.env.API_LOGIN_ID)
    merchantAuthenticationType.setTransactionKey(process.env.TRANSACTION_KEY)

    const transactionRequestType = new APIContracts.TransactionRequestType()
    transactionRequestType.setTransactionType(
      APIContracts.TransactionTypeEnum.AUTHCAPTURETRANSACTION
    )
    transactionRequestType.setAmount(utils.getRandomAmount())

    const setting1 = new APIContracts.SettingType()
    setting1.setSettingName('hostedPaymentButtonOptions')
    setting1.setSettingValue('{"text": "Pay"}')

    const setting2 = new APIContracts.SettingType()
    setting2.setSettingName('hostedPaymentOrderOptions')
    setting2.setSettingValue('{"show": false}')

    const setting3 = new APIContracts.SettingType()
    setting3.setSettingName('hostedPaymentStyleOptions')
    setting3.setSettingValue('{"bgColor": "#426224"}')

    const setting4 = new APIContracts.SettingType()
    setting4.setSettingName('hostedPaymentIFrameCommunicatorUrl')
    setting4.setSettingValue(
      '{"url": "https://ron-shirks.vercel.app/iframe.html"}'
    )

    const setting5 = new APIContracts.SettingType()
    setting5.setSettingName('hostedPaymentReturnOptions')
    setting5.setSettingValue(
      '{"showReceipt": true, "url": "https://ron-shirks.vercel.app/receipt", "urlText": "Continue", "cancelUrl": "https://ron-shirks.vercel.app/", "cancelUrlText": "Cancel"}'
    )

    const settingList = [setting1, setting2, setting3, setting4]

    const alist = new APIContracts.ArrayOfSetting()
    alist.setSetting(settingList)

    const getRequest = new APIContracts.GetHostedPaymentPageRequest()
    getRequest.setMerchantAuthentication(merchantAuthenticationType)
    getRequest.setTransactionRequest(transactionRequestType)
    getRequest.setHostedPaymentSettings(alist)

    const ctrl = new APIControllers.GetHostedPaymentPageController(
      getRequest.getJSON()
    )
    ctrl.setEnvironment('https://apitest.authorize.net/xml/v1/request.api')
    // ctrl.setEnvironment('https://api.authorize.net/xml/v1/request.api')

    // Define a function to execute the controller and return a promise
    function executeController(ctrl) {
      return new Promise((resolve, reject) =&amp;gt; {
        ctrl.execute(function () {
          try {
            var apiResponse = ctrl.getResponse()
            const response = new APIContracts.GetHostedPaymentPageResponse(
              apiResponse
            )
            resolve(response)
          } catch (error) {
            reject(error)
          }
        })
      })
    }

    const controllerResponse = await executeController(ctrl)

    return NextResponse.json({
      response: controllerResponse.token,
    })
  } catch (error) {
    console.error('An error occurred:', error)
    return NextResponse.error('Internal Server Error', { status: 500 })
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Display Form&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;return transToken ? (
    &amp;lt;form
      method='post'
      action='https://test.authorize.net/payment/payment'
      id='formAuthorizeNetTestPage'
      name='formAuthorizeNetTestPage'
    &amp;gt;
      &amp;lt;input type='hidden' name='token' value={transToken} /&amp;gt;
      Continue to Authorize.net to Payment Page
      &amp;lt;button id='btnContinue'&amp;gt;Continue to next page&amp;lt;/button&amp;gt;
    &amp;lt;/form&amp;gt;
  ) : (
    &amp;lt;div&amp;gt;
      You must have a form token. Have you made a call to the
      getHostedPaymentPageRequestAPI?
    &amp;lt;/div&amp;gt;
  )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Feb 2024 21:21:42 GMT</pubDate>
    <dc:creator>moderncaliber</dc:creator>
    <dc:date>2024-02-07T21:21:42Z</dc:date>
    <item>
      <title>Accept Hosted 550 Error After Payment</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-550-Error-After-Payment/m-p/88761#M55936</link>
      <description>&lt;P&gt;I'm using authorize.net for a NextJS project for a client's payment processing. I am trying to make test transactions and it just won't work. I am correctly using the&amp;nbsp;getHostedPaymentPageRequest&amp;nbsp;to get my token, and when I go to display the form via Accept Hosted Redirect, that works too, but when I click "Pay", I get the email receipt that the payment worked, but on the hosted payment page I just see "Processing..." for around 2 minutes and then I get this error.&amp;nbsp;POST &lt;A href="https://test.authorize.net/Payment/Api.ashx" target="_blank"&gt;https://test.authorize.net/Payment/Api.ashx&lt;/A&gt; 550. I see several other people have asked similar questions to this, but they were not answered. Any help would be greatly appreciated. I will post my code below.&lt;/P&gt;&lt;P&gt;Get Hosted Payment Page Response&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;export async function POST(req) {
  try {
    const merchantAuthenticationType =
      new APIContracts.MerchantAuthenticationType()
    merchantAuthenticationType.setName(process.env.API_LOGIN_ID)
    merchantAuthenticationType.setTransactionKey(process.env.TRANSACTION_KEY)

    const transactionRequestType = new APIContracts.TransactionRequestType()
    transactionRequestType.setTransactionType(
      APIContracts.TransactionTypeEnum.AUTHCAPTURETRANSACTION
    )
    transactionRequestType.setAmount(utils.getRandomAmount())

    const setting1 = new APIContracts.SettingType()
    setting1.setSettingName('hostedPaymentButtonOptions')
    setting1.setSettingValue('{"text": "Pay"}')

    const setting2 = new APIContracts.SettingType()
    setting2.setSettingName('hostedPaymentOrderOptions')
    setting2.setSettingValue('{"show": false}')

    const setting3 = new APIContracts.SettingType()
    setting3.setSettingName('hostedPaymentStyleOptions')
    setting3.setSettingValue('{"bgColor": "#426224"}')

    const setting4 = new APIContracts.SettingType()
    setting4.setSettingName('hostedPaymentIFrameCommunicatorUrl')
    setting4.setSettingValue(
      '{"url": "https://ron-shirks.vercel.app/iframe.html"}'
    )

    const setting5 = new APIContracts.SettingType()
    setting5.setSettingName('hostedPaymentReturnOptions')
    setting5.setSettingValue(
      '{"showReceipt": true, "url": "https://ron-shirks.vercel.app/receipt", "urlText": "Continue", "cancelUrl": "https://ron-shirks.vercel.app/", "cancelUrlText": "Cancel"}'
    )

    const settingList = [setting1, setting2, setting3, setting4]

    const alist = new APIContracts.ArrayOfSetting()
    alist.setSetting(settingList)

    const getRequest = new APIContracts.GetHostedPaymentPageRequest()
    getRequest.setMerchantAuthentication(merchantAuthenticationType)
    getRequest.setTransactionRequest(transactionRequestType)
    getRequest.setHostedPaymentSettings(alist)

    const ctrl = new APIControllers.GetHostedPaymentPageController(
      getRequest.getJSON()
    )
    ctrl.setEnvironment('https://apitest.authorize.net/xml/v1/request.api')
    // ctrl.setEnvironment('https://api.authorize.net/xml/v1/request.api')

    // Define a function to execute the controller and return a promise
    function executeController(ctrl) {
      return new Promise((resolve, reject) =&amp;gt; {
        ctrl.execute(function () {
          try {
            var apiResponse = ctrl.getResponse()
            const response = new APIContracts.GetHostedPaymentPageResponse(
              apiResponse
            )
            resolve(response)
          } catch (error) {
            reject(error)
          }
        })
      })
    }

    const controllerResponse = await executeController(ctrl)

    return NextResponse.json({
      response: controllerResponse.token,
    })
  } catch (error) {
    console.error('An error occurred:', error)
    return NextResponse.error('Internal Server Error', { status: 500 })
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Display Form&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;return transToken ? (
    &amp;lt;form
      method='post'
      action='https://test.authorize.net/payment/payment'
      id='formAuthorizeNetTestPage'
      name='formAuthorizeNetTestPage'
    &amp;gt;
      &amp;lt;input type='hidden' name='token' value={transToken} /&amp;gt;
      Continue to Authorize.net to Payment Page
      &amp;lt;button id='btnContinue'&amp;gt;Continue to next page&amp;lt;/button&amp;gt;
    &amp;lt;/form&amp;gt;
  ) : (
    &amp;lt;div&amp;gt;
      You must have a form token. Have you made a call to the
      getHostedPaymentPageRequestAPI?
    &amp;lt;/div&amp;gt;
  )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 21:21:42 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-550-Error-After-Payment/m-p/88761#M55936</guid>
      <dc:creator>moderncaliber</dc:creator>
      <dc:date>2024-02-07T21:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted 550 Error After Payment</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-550-Error-After-Payment/m-p/88976#M56070</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Which programming language is best for setting up a &lt;STRONG&gt;personal website&lt;/STRONG&gt;?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2024 19:12:06 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-550-Error-After-Payment/m-p/88976#M56070</guid>
      <dc:creator>homa</dc:creator>
      <dc:date>2024-03-07T19:12:06Z</dc:date>
    </item>
  </channel>
</rss>

