cancel
Showing results for 
Search instead for 
Did you mean: 

How to make company/business name an editable field in Accept Hosted Payment Form

I would like to add an editable company/business name field to my Accept Hosted Payment Form. How can I achieve this?

Here is the JSON object in my getHostedPaymentPageRequest -

function authUser(dono_amount, customer_type, user_email_address, user_first_name, user_last_name, user_business, user_address, user_city, user_state, user_zip, user_phone_number, show_credit_card, show_bank_account) {
$.when(
$.ajax({
url: "https://apitest.authorize.net/xml/v1/request.api",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
"getHostedPaymentPageRequest": {
"merchantAuthentication": {
"name": "[name]",
"transactionKey": "[key]"
},
"transactionRequest": {
"transactionType": "authCaptureTransaction",
"amount": dono_amount,
"profile": {
"customerProfileId": "[id]"
},
"customer": {
"type": customer_type,
"email": user_email_address,
},
"billTo": {
"firstName": user_first_name,
"lastName": user_last_name,
"company": user_business,
"address": user_address,
"city": user_city,
"state": user_state,
"zip": user_zip,
"country": "US",
"phoneNumber": user_phone_number
}
},
"hostedPaymentSettings": {
"setting": [{
"settingName": "hostedPaymentReturnOptions",
"settingValue": "{\"showReceipt\": true, \"url\": \"https://mysite.com/receipt\", \"urlText\": \"Donate\", \"cancelUrl\": \"mysite.com\", \"cancelUrlText\": \"Cancel\"}"
}, {
"settingName": "hostedPaymentButtonOptions",
"settingValue": "{\"text\": \"Donate\"}"
}, {
"settingName": "hostedPaymentStyleOptions",
"settingValue": "{\"bgColor\": \"#41413F\"}"
}, {
"settingName": "hostedPaymentPaymentOptions",
"settingValue": "{\"cardCodeRequired\": true, \"showCreditCard\": " + show_credit_card + ", \"showBankAccount\": " + show_bank_account + "}"
}, {
"settingName": "hostedPaymentSecurityOptions",
"settingValue": "{\"captcha\": true}"
}, {
"settingName": "hostedPaymentShippingAddressOptions",
"settingValue": "{\"show\": false, \"required\": false}"
}, {
"settingName": "hostedPaymentBillingAddressOptions",
"settingValue": "{\"show\": true, \"required\": false}"
}, {
"settingName": "hostedPaymentCustomerOptions",
"settingValue": "{\"showEmail\": true, \"requiredEmail\": true, \"addPaymentProfile\": false}"
}, {
"settingName": "hostedPaymentOrderOptions",
"settingValue": "{\"show\": true, \"merchantName\": \"MerchantName\"}"
}, {
"settingName": "hostedPaymentIFrameCommunicatorUrl",
"settingValue": "{\"url\": \"}"
}]
}
}
}),
dataType: "json",
success: function (response) {
console.log(response);
console.log(response.token);
$("#send_token input").attr("value", response.token)
}
})
).done(function () {
$("#iframe_holder").addClass("open-iframe");
$("#add_payment").show();
$("#send_token").attr({ "action": "https://test.authorize.net/payment/payment", "target": "add_payment" }).submit();
});
}

dvieira
Member
1 REPLY 1
To make the company/business name editable in Accept Hosted Payment Form, customize the form's HTML to include an input field for the company/business name. Ensure the field is correctly mapped and processed during payment submission. 
 

 

 

 

 

 

 

 

 

johnsen875
Member