cancel
Showing results for 
Search instead for 
Did you mean: 

Accept Hosted Customer form default country

I'm displaying an add payment form for CIM customers using https://accept.authorize.net/customer/addPayment with a billing address required.

The country field appears to default to USA. Is it possible to choose another default? I'm implementing a solution for a Canadian customer.

monki
Contributor
9 REPLIES 9

Monki,

Are you passing the country property in the billing information?

David

marine2026
Trusted Contributor

Can I pass billing information in the token request? I don't see that as part of the API for getHostedProfilePageRequest, only for getHostedPaymentPageRequest...

@marine2026 do you know it's possible to pass billing information in the token request for getHostedProfilePageRequest?

hostedProfileBillingAddressOptions may be what you are looking for within the getHostedProfilePageRequest

marine2026
Trusted Contributor

According to the docs, hostedProfileBillingAddressOptions is a string set to either showBillingAddress or showNone, it describes nothing related to the default country...

monki
Contributor

The abbreviated request is shown below, and it includes "billing information". And it has an option for showing this "billing information" in the requested form.

{
  "getHostedPaymentPageRequest": {
    "merchantAuthentication": {
      "name": "5KP3u95bQpv",
      "transactionKey": "346HZ32z3fP4hTG2"
    },
    "transactionRequest": {
      "transactionType": "authCaptureTransaction",
      "amount": "20.00",
      "profile": {
        "customerProfileId": "123456789"
      },
      "customer": {
        "email": "ellen@mail.com"
      },
      "billTo": {
        "firstName": "Ellen",
        "lastName": "Johnson",
        "company": "Souveniropolis",
        "address": "14 Main Street",
        "city": "Pecan Springs",
        "state": "TX",
        "zip": "44628",
        "country": "US"
      }
    },
    "hostedPaymentSettings": {
      "setting": [{
        "settingName": "hostedPaymentReturnOptions",
        "settingValue": "{\"showReceipt\": true, \"url\": \"https://mysite.com/receipt\", \"urlText\": \"Continue\", \"cancelUrl\": \"https://mysite.com/cancel\", \"cancelUrlText\": \"Cancel\"}"
      }, {
        "settingName": "hostedPaymentButtonOptions",
        "settingValue": "{\"text\": \"Pay\"}"
      }, {
        "settingName": "hostedPaymentStyleOptions",
        "settingValue": "{\"bgColor\": \"blue\"}"
      }, {
        "settingName": "hostedPaymentPaymentOptions",
        "settingValue": "{\"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\": false, \"requiredEmail\": false, \"addPaymentProfile\": true}"
      }, {
        "settingName": "hostedPaymentOrderOptions",
        "settingValue": "{\"show\": true, \"merchantName\": \"G and S Questions Inc.\"}"
      }, {
        "settingName": "hostedPaymentIFrameCommunicatorUrl",
        "settingValue": "{\"url\": \"https://mysite.com/special\"}"
      }]
    }
  }
}

 

marine2026
Trusted Contributor

My mistake, I responded about a transaction type you are not asking about. Sorry!

marine2026
Trusted Contributor

I believe that getHostedProfilePageRequest shows a form that is configured by the options passed in the request.

The form that shows can include billing information.

If you firstly createCustomerProfileRequest, you'll have a customerProfileId that will be passed in the getHostedProfilePageRequest, that can show the billing information you passed in the createCustomerProfileRequest.

marine2026
Trusted Contributor

I can't rely on creating a customer profile before this, this is a function accessed by existing users to add a credit card to their existing CIM profile.