I'm writing a module which prevent an user to checkout (with payment method Paypal pro, using Master Card, Visa, etc) if the zip code and address he provided not match those information in his card.
At first, I created 2 sandbox account (merchant and buyer) to check paypal's response. Here is the request I pushed to paypal sandbox:
array ( 'PAYMENTACTION' => 'Sale', 'IPADDRESS' => '127.0.0.1', 'RETURNFMFDETAILS' => 1, 'AMT' => '30.75', 'CURRENCYCODE' => 'USD', 'INVNUM' => '100011074', 'NOTIFYURL' => 'http://www.spacex.local/paypal/ipn/', 'EMAIL' => '[email protected]', 'CREDITCARDTYPE' => 'MasterCard', 'ACCT' => '5110925307034185', 'EXPDATE' => '112024', 'CVV2' => '185', 'ISSUENUMBER' => NULL, 'ITEMAMT' => '22.00', 'TAXAMT' => '0.00', 'SHIPPINGAMT' => '8.75', 'BUSINESS' => NULL, 'FIRSTNAME' => 'fgdgdfg', 'LASTNAME' => 'dgdgdfg', 'MIDDLENAME' => NULL, 'SALUTATION' => NULL, 'SUFFIX' => NULL, 'COUNTRYCODE' => 'US', 'STATE' => 'AK', 'CITY' => 'sdfsdfsdf', 'STREET' => 'asdfasdfsdf', 'ZIP' => '12345', 'PHONENUM' => '12345679', 'SHIPTOCOUNTRYCODE' => 'US', 'SHIPTOSTATE' => 'AK', 'SHIPTOCITY' => 'sdfsdfsdf', 'SHIPTOSTREET' => 'asdfasdfsdf', 'SHIPTOZIP' => '12345', 'SHIPTOPHONENUM' => '12345679', 'SHIPTOSTREET2' => '', 'STREET2' => '', 'SHIPTONAME' => 'fgdgdfg dgdgdfg', 'METHOD' => 'DoDirectPayment', )
And here is the response
array ( 'TIMESTAMP' => '2015-05-26T09:03:56Z', 'CORRELATIONID' => '181a742e9983a', 'ACK' => 'Success', 'VERSION' => '72.0', 'BUILD' => '16770825', 'AMT' => '30.75', 'CURRENCYCODE' => 'USD', 'AVSCODE' => 'X', 'CVV2MATCH' => 'M', 'TRANSACTIONID' => '5SN572797S568915L', )
The information I need is
AVSCODE with value "X" which means "Street address and 9-digit postal code match." (see https://developer.paypal.com/docs/classic/api/AVSResponseCodes/#avs-response-codes). However, my buyer sandbox account doesn't even have any address and zip code (since I can't find anywhere to save address and zip code to my account), why does this happen?