cancel
Showing results for 
Search instead for 
Did you mean: 

Accept.js and Street address verification

Hello,

 

I am trying to implement Accept.js with php and using my own form. For some reason, the street address is not getting verified correctly. As long as there are numbers in the field, it gets verified whether its correct or not. Send it with no numbers just the street name and it fails (as it should). Zip code and ccv appear to be working correctly. Any ideas?

jts74
Member
2 REPLIES 2

Hi,

 

Are you trying to Get an accept payment page API ?

I tried it on the sandbox without numbers in the stree address and was able to get a successful response.

 

<getHostedPaymentPageRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
  <merchantAuthentication>
    <name>78BZ5Xprry</name>
    <transactionKey>8s2F95Q7brhHd7Tn</transactionKey>
  </merchantAuthentication>
  <transactionRequest>
    <transactionType>authCaptureTransaction</transactionType>
    <amount>20.00</amount>
    <profile>
      <customerProfileId>123456789</customerProfileId>
    </profile>
    <customer>
      <email>ellen@mail.com</email>
    </customer>
    <billTo>
        <firstName>Ellen</firstName>
        <lastName>Johnson</lastName>
        <company>Souveniropolis</company>
        <address>Main Street</address>
        <city>Pecan Springs</city>
        <state>TX</state>
        <zip>44628</zip>
        <country>USA</country>
    </billTo>
  </transactionRequest>
  <hostedPaymentSettings>
    <setting>
      <settingName>hostedPaymentReturnOptions</settingName>
      <settingValue>{"showReceipt": true, "url": "https://mysite.com/receipt", "urlText": "Continue", "cancelUrl": "https://mysite.com/cancel", "cancelUrlText": "Cancel"}</settingValue>
    </setting>
    <setting>
      <settingName>hostedPaymentButtonOptions</settingName>
      <settingValue>{"text": "Pay"}</settingValue>
    </setting>
    <setting>
      <settingName>hostedPaymentStyleOptions</settingName>
      <settingValue>{"bgColor": "blue"}</settingValue>
    </setting>
    <setting>
      <settingName>hostedPaymentPaymentOptions</settingName>
      <settingValue>{"cardCodeRequired": false, "showCreditCard": true, "showBankAccount": true}</settingValue>
    </setting>
    <setting>
      <settingName>hostedPaymentSecurityOptions</settingName>
      <settingValue>{"captcha": false}</settingValue>
    </setting>
    <setting>
      <settingName>hostedPaymentShippingAddressOptions</settingName>
      <settingValue>{"show": false, "required": false}</settingValue>
    </setting>
    <setting>
      <settingName>hostedPaymentBillingAddressOptions</settingName>
      <settingValue>{"show": true, "required":false}</settingValue>
    </setting>
    <setting>
      <settingName>hostedPaymentCustomerOptions</settingName>
      <settingValue>{"showEmail": false, "requiredEmail": false, "addPaymentProfile": true}</settingValue>
    </setting>
    <setting>
      <settingName>hostedPaymentOrderOptions</settingName>
      <settingValue>{"show": true, "merchantName": "G and S Questions Inc."}</settingValue>
    </setting>
    <setting>
      <settingName>hostedPaymentIFrameCommunicatorUrl</settingName>
      <settingValue>{"url": "https://mysite.com/special"}</settingValue>
    </setting>
  </hostedPaymentSettings>
</getHostedPaymentPageRequest>

 

<?xml version="1.0" encoding="utf-8"?>
<getHostedPaymentPageResponse xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="https://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
  <messages>
    <resultCode>Ok</resultCode>
    <message>
      <code>I00001</code>
      <text>Successful.</text>
    </message>
  </messages>
  <token>fpXAkWfQzJUD6zzuU+yz9olx2YkoHd2bPzjm6u/teYYsKi3KmR9xmszKsEvw8bafqxwpshKqAUuXUp0uPMvWjelVNZDv+TYDcsq2+X+B7kuoQpnQeBnhMZg</token>
</getHostedPaymentPageResponse>

 

Is this what you are trying to accomplish ?

rajvpate
Administrator Administrator
Administrator

I'm not using the Hosted Payment form. Its the accept.js.

 

$transRequestXmlStr=<<<XML
<?xml version="1.0" encoding="UTF-8"?>
<createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<merchantAuthentication></merchantAuthentication>
<transactionRequest>
<transactionType>authCaptureTransaction</transactionType>
<amount>$grandtotal</amount>
<currencyCode>USD</currencyCode>
<payment>
<opaqueData>
<dataDescriptor>assignDD</dataDescriptor>
<dataValue>assignDV</dataValue>
</opaqueData>
</payment>
<order>
<invoiceNumber>$webid</invoiceNumber>
<description></description>
</order>
<customer>
<id></id>
<email>$b[email]</email>
</customer>
<billTo>
<firstName>$b[first]</firstName>
<lastName>$b[last]</lastName>
<company></company>
<address>$address</address>
<city>$b[city]</city>
<state>$b[state]</state>
<zip>$b[zip]</zip>
<country>USA</country>
<phoneNumber>$b[phone]</phoneNumber>
</billTo>
<shipTo>
<firstName>$b[ship_first]</firstName>
<lastName>$b[ship_last]</lastName>
<company></company>
<address>$b[ship_address1]</address>
<city>$b[ship_city]</city>
<state>$b[ship_state]</state>
<zip>$b[ship_zip]</zip>
<country>USA</country>
</shipTo>
</transactionRequest>
</createTransactionRequest>
XML;

 

AVS will catch a wrong zip code but only fail the street match if you dont include any numbers. But if you put any numbers in the address field its passes. This is in live mode. AVS is currently working correctly in our production method which is DPM.