cancel
Showing results for 
Search instead for 
Did you mean: 

Fully Hosted modal - Country Drop Down

Hi Guys,

 

Im usingin the fully hosted solution for our client to process payments.

 

The users that going to use the application are all from the US. I need to request them the hostedPaymentBillingAddressOptions and Im sending the setting when Im getting the token. 

 

There is a way to put the contry as us and disable it? 

 

 

 

 settingType[] settings = new settingType[7];

            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\": true}";

            settings[2] = new settingType();
            settings[2].settingName = settingNameEnum.hostedPaymentPaymentOptions.ToString();
            settings[2].settingValue = "{\"cardCodeRequired\": false, \"showCreditCard\": true, \"showBankAccount\": false}";

            //hostedPaymentIFrameCommunicatorUrl
            settings[3] = new settingType();
            settings[3].settingName = settingNameEnum.hostedPaymentIFrameCommunicatorUrl.ToString();
            settings[3].settingValue = "{\"url\": \"" + iframeUrl + "\"}";

            //hostedPaymentReturnOptions
            settings[4] = new settingType();
            settings[4].settingName = settingNameEnum.hostedPaymentReturnOptions.ToString();
            settings[4].settingValue = "{\"showReceipt\": false, \"cancelUrl\": \"" + iframeUrl + "#action=cancel\", \"cancelUrlText\": \"Cancel\"}";

            settings[5] = new settingType();
            settings[5].settingName = settingNameEnum.hostedPaymentCustomerOptions.ToString();
            settings[5].settingValue = "{\"showEmail\": false, \"requiredEmail\": false, \"addPaymentProfile\": true}";

            settings[6] = new settingType();
            settings[6].settingName = settingNameEnum.hostedPaymentBillingAddressOptions.ToString();
            settings[6].settingValue = "{\"show\": true,  \"required\": true}";

Thanks in advance!

 

mtarantooms01
Contributor
4 REPLIES 4

Hi mtarantooms01

 

There is a way to do this, but it may not be what you are looking for exactly, however it will work to accomplish your goal. 

 

The way you would do this would be to collect the address on your site and include them in the call to generate the token to call the hosted payment form and then set 

            settings[6] = new settingType();
            settings[6].settingName = settingNameEnum.hostedPaymentBillingAddressOptions.ToString();
            settings[6].settingValue = "{\"show\": false,  \"required\": false}";

 This way, the billing address will not be editable by the end-user. 

 

Alternatively, you could collect the billing address from the end-user on your site prior to generating the token and then set

            settings[6] = new settingType();
            settings[6].settingName = settingNameEnum.hostedPaymentBillingAddressOptions.ToString();
            settings[6].settingValue = "{\"show\": true,  \"required\": true}";

This will populate the billing fields with the values included within the token generation, but will be editable to the end-user. 

 

A working example of this would be: 

<getHostedPaymentPageRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">

              <merchantAuthentication>

                             <name>APILogin</name>

                             <transactionKey>TransKey</transactionKey>

              </merchantAuthentication>

              <transactionRequest>

                             <transactionType>authCaptureTransaction</transactionType>

                             <amount>20.00</amount>

                             <order>

                                           <invoiceNumber>INV-12345</invoiceNumber>

                                           <description>Product Description</description>

                             </order>

                             <lineItems>

                                           <lineItem>

                                                          <itemId>1</itemId>

                                                          <name>vase</name>

                                                          <description>Cannes logo </description>

                                                         <quantity>18</quantity>

                                                          <unitPrice>45.00</unitPrice>

                                           </lineItem>

                             </lineItems>

                             <tax>

                                           <amount>4.26</amount>

                                           <name>level2 tax name</name>

                                           <description>level2 tax</description>

                             </tax>

                             <duty>

                                           <amount>8.55</amount>

                                           <name>duty name</name>

                                           <description>duty description</description>

                             </duty>

                             <shipping>

                                           <amount>4.26</amount>

                                           <name>level2 tax name</name>

                                           <description>level2 tax</description>

                             </shipping>

                             <poNumber>456654</poNumber>

                             <customer>

                                           <id>99999456654</id>

                                           <email>customer@email.com</email>

                             </customer>

                             <billTo>

                                           <firstName>Ellen</firstName>

                                           <lastName>Johnson</lastName>

                                           <company>Souveniropolis</company>

                                           <address>14 Main Street</address>

                                           <city>Pecan Springs</city>

                                           <state>TX</state>

                                           <zip>44628</zip>

                                           <country>USA</country>

                             </billTo>

                             <shipTo>

                                           <firstName>China</firstName>

                                           <lastName>Bayles</lastName>

                                           <company>Thyme for Tea</company>

                                           <address>12 Main Street</address>

                                           <city>Pecan Springs</city>

                                           <state>TX</state>

                                           <zip>44628</zip>

                                           <country>USA</country>

                             </shipTo>

                             <customerIP>192.168.1.1</customerIP>

                             <transactionSettings>

                                           <setting>

                                                          <settingName>testRequest</settingName>

                                                          <settingValue>true</settingValue>

                                           </setting>

                                           <setting>

                                                          <settingName>recurringBilling</settingName>

                                                          <settingValue>Y</settingValue>

                                           </setting>           

                                           <setting>

                                                          <settingName>allowPartialAuth</settingName>

                                                          <settingValue>Y</settingValue>

                                           </setting>           

                                           <setting>

                                                          <settingName>duplicateWindow</settingName>

                                                          <settingValue>10000</settingValue>

                                           </setting>                                                      

                             </transactionSettings>

                             <userFields>

                                           <userField>

                                                          <name>MerchantDefinedFieldName1</name>

                                                          <value>MerchantDefinedFieldValue1</value>

                                           </userField>

                                           <userField>

                                                          <name>favorite_color</name>

                                                          <value>blue</value>

                                           </userField>

                             </userFields>

              </transactionRequest>

              <hostedPaymentSettings>

                             <setting>

                                           <settingName>hostedPaymentBillingAddressOptions</settingName>

                                           <settingValue>{"show": false, "required":false}</settingValue>

                             </setting>

                             <setting>

                                           <settingName>hostedPaymentShippingAddressOptions</settingName>

                                           <settingValue>{"show": false, "required":false}</settingValue>

                             </setting>

                             <setting>

                                           <settingName>hostedPaymentButtonOptions</settingName>

                                           <settingValue>{"text": "Pay"}</settingValue>

                             </setting>

                             <setting>

                                           <settingName>hostedPaymentReturnOptions</settingName>

                             <settingValue>{"url":"https://www.mystore.com/good","urlText":"Continue","cancelUrl":"https://www.mystore.com/cancel","can...>

                             </setting>

              </hostedPaymentSettings>

</getHostedPaymentPageRequest>

 

The above example is only an example of some of the fields you can include, not a statement of which fields you must include in the getHostedPaymentPageRequest. A complete list of the fields available for use can be found in our API Reference Guide and/or schema. 

 

I hope this information is helpful to you. 

 

Thank you,

Elaine

ElaineM
Moderator Moderator
Moderator

Hi Elaine, 

 

Thanks for the answer and sorry fo the delay.

 

I have another question to make.

 

Im still working on the modal. Our client want the end user fill the addess billing information. Because of that when I generate the token Im sending:

 

 

            settings[6] = new settingType();
            settings[6].settingName = settingNameEnum.hostedPaymentBillingAddressOptions.ToString();
            settings[6].settingValue = "{\"show\": true,  \"required\": true}";

 

When Im generating the token.

 

The problem is that I found this issue:

 

https://community.developer.authorize.net/t5/Integration-and-Testing/ANET-Hosted-Form-PaymentProfile...

 

I get an error that tells me that I cant send the billing data with profile data.

 

So I dont know if that problem is solved or not. 

 

From the other hand you mention: "you could collect the billing address from the end-user on your site prior to generating the token and then set". What do yo u mean by "prior to generating the token"? When Im creating the profile? Do you have an example of that kind of request?

 

 

Right now if I set the hostedPaymentBillingAddressOptions to true and set the createCustomerProfile I get that error.

 

Do you know anything abou that error? Is me that Im doing something wrong?

 

Im totally new at authorize.net and Im having a very hard time to finish to configure it.

 

Thanks for your help!

Hi @ElaineM,

 

Also want to add this:

 

If I pick one of the Saved CC  and I want to pay I get the error.

 

Capture.JPG

 

But If I add the new Payment Method and add a new CC and fill the Address data I can pay with out issues.

 

Capture.JPG

 

So I dont fully understand what the problem is. We want the user fill the address data on the modal. But If I send that with the prfoile data I get that error. Not sure how to continue with this.

 

Any could gide me on this?

 

Thanks.

 

 

 

Hello guys,

 

Sorry to insist.

 

No one can help me on this?

 

I any help or guide on this will be appreciated.

 

Thanks,