- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Accept Hosted Payment Form Sample Page Problems
I am trying to get accept hosted payments to work but getting stuck. I tried many things always getting the same result.
To narrow it down I went all the way back to the sample code page almost exactly as it exists in the doc and using the token I got from the API test page using the default XML for the token request but with my sandbox credentials.
When I press the button to request the form I just get a popup that says "Missing or Invalid Token." This is the same result I got every time when I tried to integrate the code into our app.
I also get these two js errors in the iframe:
ERROR TypeError: Cannot read property 'billTo' of null
ERROR TypeError: Cannot read property 'offsetHeight' of null
Can anyone help?
Here is my page HTML
-------------------------------------
03-25-2020 05:58 PM - edited 03-25-2020 06:09 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I got the same thing over and over as well, until I cleaned up my "
const body = { getHostedPaymentPageRequest: { merchantAuthentication: { name: ANET_LOGIN_ID, transactionKey: ANET_TRX_KEY }, transactionRequest: { transactionType: "authCaptureTransaction", // authOnlyTransaction amount: parseFloat(amountDue), profile: { customerProfileId: customerProfileId, }, order: { invoiceNumber: invoiceNum, description : 'Plumbing Service' }, customer: { id : merchantCustomerId, email: customer.eMail, }, billTo : { firstName : customer.FirstName, lastName : customer.LastName, company : customer.NameType === 'Company'? customer.OriginalName : null, address : customer.BillAddress, city : customer.BillCity, state : customer.BillState, zip : customer.BillZip, country : customer.BillCountry === 'US'? 'USA' : customer.BillCountry, phoneNumber : customer.Phone, }, }, hostedPaymentSettings: { setting: [{ "settingName": "hostedPaymentReturnOptions", "settingValue": JSON.stringify({ showReceipt : true, url : orig_url, urlText : 'Continue', cancelUrl : orig_url, cancelUrlText : "Cancel" }), }, { "settingName": "hostedPaymentButtonOptions", "settingValue": '{"text": "Submit Payment"}' }, { "settingName": "hostedPaymentStyleOptions", "settingValue": '{"bgColor": "blue"}' }, { "settingName": "hostedPaymentPaymentOptions", "settingValue": JSON.stringify({ cardCodeRequired : false, showCreditCard : true, showBankAccount : true, }), }, { "settingName": "hostedPaymentSecurityOptions", "settingValue": '{"captcha": false}' }, { "settingName": "hostedPaymentShippingAddressOptions", "settingValue": '{"show": false, "required": false}' }, { "settingName": "hostedPaymentBillingAddressOptions", "settingValue": '{"show": true, "required": false}' }, { "settingName": "hostedPaymentCustomerOptions", "settingValue": '{"showEmail": true, "requiredEmail": false, "addPaymentProfile": true}' }, { "settingName": "hostedPaymentOrderOptions", "settingValue": JSON.stringify({ show : true, merchantName : "Our company name"}), }] } } };
03-26-2020 09:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Team,
We are currently using Active JS where we get CC info on our website, which is encrypted and sent via API to Authorize.net (AN).
We are switching to Actvive Hosted so that customer can be directed to AN to feed the CC details. in the Active Hosted Document of AN (link below), which is a 5 pointer document - it does not give following details:
1. I can't see what values how to post the form redirection
2. What is the url to post
3. What are the mandatory values to posted
https://developer.authorize.net/api/reference/features/accept_hosted.html
Reply from any of you will be of great help.
My email samin@blueskytelecom.com
07-23-2021 06:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nate, I was getting the same error as you until I sent the "IFrameCommunicator.html" path in the initial token request.
https://github.com/AuthorizeNet/accept-sample-app/blob/master/IFrameCommunicator.html
08-14-2023 09:33 PM

