PageRenderTime 74ms CodeModel.GetById 34ms RepoModel.GetById 1ms app.codeStats 1ms

/phpPayPal.php

https://github.com/cmarkell/phpPayPal
PHP | 2319 lines | 1622 code | 301 blank | 396 comment | 71 complexity | 145fdb527f4c2286ab6ac1503de3f225 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. /*
  3. Created by Drew Johnston, 2007, drewjoh.com
  4. Please give credit where credit is due. :)
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. Get, Create and Update Recurring Payment Profiles available thanks to Bill Joslin (billjoslin.com)!
  15. */
  16. class phpPayPal {
  17. // ---------------------------
  18. // PRIVATE VARIABLES
  19. // ---------------------------
  20. // NOTE: LIVE and SANDBOX variables are included. Sandbox is enabled by default.
  21. private $sandbox = TRUE;
  22. private $live = FALSE;
  23. public $API_USERNAME = NULL;
  24. public $API_PASSWORD = NULL;
  25. public $API_SIGNATURE = NULL;
  26. private $API_ENDPOINT = NULL;
  27. public $USE_PROXY = NULL;
  28. public $PROXY_HOST = NULL;
  29. public $PROXY_PORT = NULL;
  30. private $PAYPAL_URL = NULL;
  31. public $return_url = NULL;
  32. public $cancel_url = NULL;
  33. public $VERSION = '3.0';
  34. // ----------------------------
  35. // PUBLIC VARIABLES
  36. // ----------------------------
  37. // Array of the response variables from PayPal requests
  38. public $Response;
  39. /* -------------------
  40. ERROR VARIABLES
  41. -------------------
  42. - $Error = an array of PayPal's response to any paypal errors
  43. - All $_error's = are filled for any error that occurs, including PayPal errors
  44. - If a method returns false, the $_error's should be filled with error information
  45. */
  46. // Array of the error response from PayPal - [TIMESTAMP] [CORRELATIONID] [ACK] [L_ERRORCODE0] [L_SHORTMESSAGE0] [L_LONGMESSAGE0] [L_SEVERITYCODE0] [VERSION] [BUILD]
  47. public $Error;
  48. public $_error = false;
  49. public $_error_ack;
  50. public $_error_type;
  51. public $_error_date;
  52. public $_error_code;
  53. public $_error_short_message;
  54. public $_error_long_message;
  55. public $_error_corrective_action;
  56. public $_error_severity_code;
  57. public $_error_version;
  58. public $_error_build;
  59. public $_error_display_message;
  60. /* ----------------------
  61. REQUEST VARIABLES
  62. ----------------------
  63. - All values found in a Request
  64. - Format is $our_variable_name; // PAYPALS_VARIABLE_NAME
  65. */
  66. public $payment_type = 'Sale'; // PAYMENTTYPE
  67. public $email; // EMAIL
  68. public $salutation; // SALUTATION
  69. public $first_name; // FIRSTNAME
  70. public $middle_name; // MIDDLENAME
  71. public $last_name; // LASTNAME
  72. public $suffix; // SUFFIX
  73. public $credit_card_type; // CREDITCARDTYPE --- Visa, MasterCard, Discover, Amex, Switch, Solo
  74. public $credit_card_number; // ACCT
  75. public $expire_date; // EXPDATE - MMYYYY
  76. public $cvv2_code; // CVV2
  77. public $address1; // STREET
  78. public $address2; // STREET2
  79. public $city; // CITY
  80. public $state; // STATE
  81. public $postal_code; // ZIP
  82. public $phone_number; // PHONENUM
  83. public $country_code; // COUNTRYCODE
  84. public $currency_code = "USD"; // CURRENCYCODE
  85. public $ip_address; //IPADDRESS
  86. public $amount_total; // AMT
  87. public $amount_shipping; // SHIPPINGAMT
  88. public $amount_handling; // HANDLINGAMT
  89. public $amount_tax; // TAXAMT
  90. public $amount_sales_tax; // SALESTAX - This is apparently only used with getTransactionDetails, and appears to be the same as amount_tax
  91. public $amount_items; // ITEMAMT
  92. public $amount_max; // MAXAMT
  93. public $amount_fee; // FEEAMT
  94. public $amount_settle; // SETTLEAMT
  95. public $amount_refund_net; // NETREFUNDAMT
  96. public $amount_refund_fee; // FEEREFUNDAMT
  97. public $amount_refund_total; // GROSSREFUNDAMT
  98. public $billing_type;
  99. public $billing_agreement;
  100. public $shipping_name; // SHIPTONAME
  101. public $shipping_address1; // SHIPTOSTREET
  102. public $shipping_address2; // SHIPTOSTREET2
  103. public $shipping_city; // SHIPTOCITY
  104. public $shipping_state; // SHIPTOSTATE
  105. public $shipping_postal_code; // SHIPTOZIP
  106. public $shipping_country_code; // SHIPTOCOUNTRYCODE
  107. public $shipping_country_name;
  108. public $shipping_phone_number; // SHIPTOPHONENUM
  109. public $description; // DESC
  110. public $custom; // CUSTOM
  111. public $invoice_number; // INVNUM
  112. public $note; // NOTE
  113. public $notify_url; // NOTIFYURL
  114. public $require_confirmed_shipping_address; // REQCONFIRMSHIPPING
  115. public $no_shipping; // NOSHIPPING
  116. public $address_override; // ADDROVERRIDE
  117. public $local_code; // LOCALECODE
  118. public $page_style; // PAGESTYLE
  119. public $hdr_image; // HDRIMG
  120. public $hdr_border_color; //HDRBORDERCOLOR
  121. public $hdr_back_color; // HDRBACKCOLOR
  122. public $payflow_color; // PAYFLOWCOLOR
  123. public $channel_type; // CHANNELTYPE
  124. public $solution_type; // SOLUTIONTYPE
  125. public $user_action; // USERACTION
  126. public $return_fmf_details = 0; // RETURNFMFDETAILS - 0 by default
  127. // Variables found in Authorize and Capture
  128. public $authorization_id; // AUTHORIZATIONID
  129. public $complete_type; // COMPLETETYPE
  130. public $soft_descriptor; // SOFTDESCRIPTOR
  131. public $transaction_entity; // TRANSACTIONENTITY
  132. // Variables that are returned to us
  133. public $ack;
  134. public $token; // TOKEN
  135. public $payer_id; // PAYERID
  136. public $payer_status; // PAYERSTATUS
  137. public $payer_business; // PAYERBUSINESS
  138. public $address_owner; // ADDRESSOWNER
  139. public $address_status; // ADDRESSSTATUS
  140. public $address_id;
  141. public $business; // BUSINESS
  142. public $avs_code;
  143. public $cvv2_match;
  144. public $transaction_id; // TRANSACTIONID
  145. public $parent_transaction_id; // PARENTTRANSACTIONID
  146. public $refund_transaction_id; // REFUNDTRANSACTIONID
  147. public $transaction_type; // TRANSACTIONTYPE
  148. public $payment_status; // PAYMENTSTATUS
  149. public $payment_pending_reason; // PENDINGREASON
  150. public $payment_reason_code; // REASONCODE
  151. public $order_time; // ORDERTIME
  152. public $timestamp;
  153. public $exchange_rate; // EXCHANGERATE
  154. public $receipt_id; // RECEIPTID
  155. public $receiver_business; // RECEIVERBUSINESS
  156. public $receiver_email; // RECEIVEREMAIL
  157. public $receiver_id; // RECEIVERID
  158. public $subscription_id; // SUBSCRIPTIONID
  159. public $subscription_date; // SUBSCRIPTIONDATE
  160. public $effective_date; // EFFECTIVEDATE
  161. public $retry_time; // RETRYTIME
  162. public $user_name; // USERNAME
  163. public $password; // PASSWORD
  164. public $recurrences; // RECURRENCES
  165. public $reattempt; // REATTEMPT
  166. public $recurring; // RECURRING
  167. public $period; // PERIOD
  168. public $buyer_id; // BUYERID
  169. public $closing_date; // CLOSINGDATE
  170. public $multi_item; // MULTIITEM
  171. public $refund_type; // REFUNDTYPE
  172. // Other
  173. public $build;
  174. public $version;
  175. public $correlation_id;
  176. /*
  177. This is the Items array, contains KEY => VALUE pairs for NAME => VALUE of items where NAME = name of item variable
  178. Names include: name, number, quantity, amount_tax, amount_total
  179. */
  180. public $ItemsArray;
  181. /* -----------------------
  182. COUNTRY NAMES & CODES
  183. -----------------------
  184. - This is an array of country names and their country codes
  185. - Organized in CODE => NAME format ($countries[COUNTRY_CODE] = COUNTRY_NAME)
  186. - This is purely for informational purposes, the class itself doesn't use these.
  187. - PayPal does use the country CODES when sending address information; can come in very handy then.
  188. - List should include all countries that PayPal accepts payments from.
  189. */
  190. public $countries = array ("US"=>"United States","AL"=>"Albania","DZ"=>"Algeria","AS"=>"American Samoa","AD"=>"Andorra","AI"=>"Anguilla","AG"=>"Antigua and Barbuda","AR"=>"Argentina","AM"=>"Armenia","AW"=>"Aruba","AU"=>"Australia","AT"=>"Austria","AZ"=>"Azerbaijan Republic","BS"=>"Bahamas","BH"=>"Bahrain","BD"=>"Bangladesh","BB"=>"Barbados","BY"=>"Belarus","BE"=>"Belgium","BZ"=>"Belize","BJ"=>"Benin","BM"=>"Bermuda","BO"=>"Bolivia","BA"=>"Bosnia and Herzegovina","BW"=>"Botswana","BR"=>"Brazil","VG"=>"British Virgin Islands","BN"=>"Brunei","BG"=>"Bulgaria","BF"=>"Burkina Faso","KH"=>"Cambodia","CM"=>"Cameroon","CA"=>"Canada","CV"=>"Cape Verde","KY"=>"Cayman Islands","CL"=>"Chile","C2"=>"China","CO"=>"Colombia","CK"=>"Cook Islands","CR"=>"Costa Rica","CI"=>"Cote D'Ivoire","HR"=>"Croatia","CY"=>"Cyprus","CZ"=>"Czech Republic","DK"=>"Denmark","DJ"=>"Djibouti","DM"=>"Dominica","DO"=>"Dominican Republic","TP"=>"East Timor","EC"=>"Ecuador","EG"=>"Egypt","SV"=>"El Salvador","EE"=>"Estonia","FM"=>"Federated States of Micronesia","FJ"=>"Fiji","FI"=>"Finland","FR"=>"France","GF"=>"French Guiana","PF"=>"French Polynesia","GA"=>"Gabon Republic","GE"=>"Georgia","DE"=>"Germany","GH"=>"Ghana","GI"=>"Gibraltar","GR"=>"Greece","GD"=>"Grenada","GP"=>"Guadeloupe","GU"=>"Guam","GT"=>"Guatemala","GN"=>"Guinea","GY"=>"Guyana","HT"=>"Haiti","HN"=>"Honduras","HK"=>"Hong Kong","HU"=>"Hungary","IS"=>"Iceland","IN"=>"India","ID"=>"Indonesia","IE"=>"Ireland","IL"=>"Israel","IT"=>"Italy","JM"=>"Jamaica","JP"=>"Japan","JO"=>"Jordan","KZ"=>"Kazakhstan","KE"=>"Kenya","KW"=>"Kuwait","LA"=>"Laos","LV"=>"Latvia","LB"=>"Lebanon","LS"=>"Lesotho","LT"=>"Lithuania","LU"=>"Luxembourg","MO"=>"Macau","MK"=>"Macedonia","MG"=>"Madagascar","MY"=>"Malaysia","MV"=>"Maldives","ML"=>"Mali","MT"=>"Malta","MH"=>"Marshall Islands","MQ"=>"Martinique","MU"=>"Mauritius","MX"=>"Mexico","MD"=>"Moldova","MN"=>"Mongolia","MS"=>"Montserrat","MA"=>"Morocco","MZ"=>"Mozambique","NA"=>"Namibia","NP"=>"Nepal","NL"=>"Netherlands","AN"=>"Netherlands Antilles","NZ"=>"New Zealand","NI"=>"Nicaragua","MP"=>"Northern Mariana Islands","NO"=>"Norway","OM"=>"Oman","PK"=>"Pakistan","PW"=>"Palau","PS"=>"Palestine","PA"=>"Panama","PG"=>"Papua New Guinea","PY"=>"Paraguay","PE"=>"Peru","PH"=>"Philippines","PL"=>"Poland","PT"=>"Portugal","PR"=>"Puerto Rico","QA"=>"Qatar","RO"=>"Romania","RU"=>"Russia","RW"=>"Rwanda","VC"=>"Saint Vincent and the Grenadines","WS"=>"Samoa","SA"=>"Saudi Arabia","SN"=>"Senegal","CS"=>"Serbia and Montenegro","SC"=>"Seychelles","SG"=>"Singapore","SK"=>"Slovakia","SI"=>"Slovenia","SB"=>"Solomon Islands","ZA"=>"South Africa","KR"=>"South Korea","ES"=>"Spain","LK"=>"Sri Lanka","KN"=>"St. Kitts and Nevis","LC"=>"St. Lucia","SZ"=>"Swaziland","SE"=>"Sweden","CH"=>"Switzerland","TW"=>"Taiwan","TZ"=>"Tanzania","TH"=>"Thailand","TG"=>"Togo","TO"=>"Tonga","TT"=>"Trinidad and Tobago","TN"=>"Tunisia","TR"=>"Turkey","TM"=>"Turkmenistan","TC"=>"Turks and Caicos Islands","UG"=>"Uganda","UA"=>"Ukraine","AE"=>"United Arab Emirates","GB"=>"United Kingdom","UY"=>"Uruguay","UZ"=>"Uzbekistan","VU"=>"Vanuatu","VE"=>"Venezuela","VN"=>"Vietnam","VI"=>"Virgin Islands (USA)","YE"=>"Yemen","ZM"=>"Zambia");
  191. /* --------------------
  192. STATES
  193. --------------------
  194. - States for certain countries, many of these are required formats for PayPal
  195. - Multidimensional array
  196. - $states[COUNTRY_CODE][STATE_CODE] = STATE_NAME
  197. */
  198. public $states = array(
  199. 'US' => array ("AK"=>"AK","AL"=>"AL","AR"=>"AR","AZ"=>"AZ","CA"=>"CA","CO"=>"CO","CT"=>"CT","DC"=>"DC","DE"=>"DE","FL"=>"FL","GA"=>"GA","HI"=>"HI",
  200. "IA"=>"IA","ID"=>"ID","IL"=>"IL","IN"=>"IN","KS"=>"KS","KY"=>"KY","LA"=>"LA","MA"=>"MA","MD"=>"MD","ME"=>"ME","MI"=>"MI","MN"=>"MN",
  201. "MO"=>"MO","MS"=>"MS","MT"=>"MT","NC"=>"NC","ND"=>"ND","NE"=>"NE","NH"=>"NH","NJ"=>"NJ","NM"=>"NM","NV"=>"NV","NY"=>"NY","OH"=>"OH",
  202. "OK"=>"OK","OR"=>"OR","PA"=>"PA","RI"=>"RI","SC"=>"SC","SD"=>"SD","TN"=>"TN","TX"=>"TX","UT"=>"UT","VA"=>"VA","VT"=>"VT","WA"=>"WA",
  203. "WI"=>"WI","WV"=>"WV","WY"=>"WY","AA"=>"AA","AE"=>"AE","AP"=>"AP","AS"=>"AS","FM"=>"FM","GU"=>"GU","MH"=>"MH","MP"=>"MP","PR"=>"PR",
  204. "PW"=>"PW","VI"=>"VI")
  205. ,
  206. 'CA' => array ("AB"=>"Alberta", "BC"=>"British Columbia", "MB"=>"Manitoba", "NB"=>"New Brunswick", "NL"=>"Newfoundland", "NS"=>"Nova Scotia",
  207. "NU"=>"Nunavut", "NT"=>"Northwest Territories", "ON"=>"Ontario", "PE"=>"Prince Edward Island", "QC"=>"Quebec", "SK"=>"Saskatchewan",
  208. "YT"=>"Yukon")
  209. ,
  210. 'AU' => array ("Australian Capital Territory"=>"Australian Capital Territory","New South Wales"=>"New South Wales","Northern Territory"=>"Northern Territory",
  211. "Queensland"=>"Queensland","South Australia"=>"South Australia","Tasmania"=>"Tasmania","Victoria"=>"Victoria","Western Australia"=>"Western Australia")
  212. ,
  213. 'GB' => array ("Aberdeen City"=>"Aberdeen City","Aberdeenshire"=>"Aberdeenshire","Angus"=>"Angus","Antrim"=>"Antrim","Argyll and Bute"=>"Argyll and Bute",
  214. "Armagh"=>"Armagh","Avon"=>"Avon","Bedfordshire"=>"Bedfordshire","Berkshire"=>"Berkshire","Blaenau Gwent"=>"Blaenau Gwent","Borders"=>"Borders",
  215. "Bridgend"=>"Bridgend","Bristol"=>"Bristol","Buckinghamshire"=>"Buckinghamshire","Caerphilly"=>"Caerphilly","Cambridgeshire"=>"Cambridgeshire",
  216. "Cardiff"=>"Cardiff","Carmarthenshire"=>"Carmarthenshire","Ceredigion"=>"Ceredigion","Channel Islands"=>"Channel Islands","Cheshire"=>"Cheshire",
  217. "Clackmannan"=>"Clackmannan","Cleveland"=>"Cleveland","Conwy"=>"Conwy","Cornwall"=>"Cornwall","Cumbria"=>"Cumbria","Denbighshire"=>"Denbighshire",
  218. "Derbyshire"=>"Derbyshire","Devon"=>"Devon","Dorset"=>"Dorset","Down"=>"Down","Dumfries and Galloway"=>"Dumfries and Galloway","Durham"=>"Durham",
  219. "East Ayrshire"=>"East Ayrshire","East Dunbartonshire"=>"East Dunbartonshire","East Lothian"=>"East Lothian","East Renfrewshire"=>"East Renfrewshire",
  220. "East Riding of Yorkshire"=>"East Riding of Yorkshire","East Sussex"=>"East Sussex","Edinburgh City"=>"Edinburgh City","Essex"=>"Essex",
  221. "Falkirk"=>"Falkirk","Fermanagh"=>"Fermanagh","Fife"=>"Fife","Flintshire"=>"Flintshire","Glasgow"=>"Glasgow","Gloucestershire"=>"Gloucestershire",
  222. "Greater Manchester"=>"Greater Manchester","Gwynedd"=>"Gwynedd","Hampshire"=>"Hampshire","Herefordshire"=>"Herefordshire",
  223. "Hertfordshire"=>"Hertfordshire","Highland"=>"Highland","Humberside"=>"Humberside","Inverclyde"=>"Inverclyde","Isle of Anglesey"=>"Isle of Anglesey",
  224. "Isle of Man"=>"Isle of Man","Isle of Wight"=>"Isle of Wight","Isles of Scilly"=>"Isles of Scilly","Kent"=>"Kent","Lancashire"=>"Lancashire",
  225. "Leicestershire"=>"Leicestershire","Lincolnshire"=>"Lincolnshire","London"=>"London","Londonderry"=>"Londonderry","Merseyside"=>"Merseyside",
  226. "Merthyr Tydfil"=>"Merthyr Tydfil","Middlesex"=>"Middlesex","Midlothian"=>"Midlothian","Monmouthshire"=>"Monmouthshire","Moray"=>"Moray",
  227. "Neath Port Talbot"=>"Neath Port Talbot","Newport"=>"Newport","Norfolk"=>"Norfolk","North Ayrshire"=>"North Ayrshire",
  228. "North Lanarkshire"=>"North Lanarkshire","North Yorkshire"=>"North Yorkshire","Northamptonshire"=>"Northamptonshire","Northumberland"=>"Northumberland",
  229. "Nottinghamshire"=>"Nottinghamshire","Orkney"=>"Orkney","Oxfordshire"=>"Oxfordshire","Pembrokeshire"=>"Pembrokeshire",
  230. "Perthshire and Kinross"=>"Perthshire and Kinross","Powys"=>"Powys","Renfrewshire"=>"Renfrewshire","Rhondda Cynon Taff"=>"Rhondda Cynon Taff",
  231. "Rutland"=>"Rutland","Shetland"=>"Shetland","Shropshire"=>"Shropshire","Somerset"=>"Somerset","South Ayrshire"=>"South Ayrshire",
  232. "South Lanarkshire"=>"South Lanarkshire","South Yorkshire"=>"South Yorkshire","Staffordshire"=>"Staffordshire","Stirling"=>"Stirling",
  233. "Suffolk"=>"Suffolk","Surrey"=>"Surrey","Swansea"=>"Swansea","The Vale of Glamorgan"=>"The Vale of Glamorgan","Tofaen"=>"Tofaen",
  234. "Tyne and Wear"=>"Tyne and Wear","Tyrone"=>"Tyrone","Warwickshire"=>"Warwickshire","West Dunbartonshire"=>"West Dunbartonshire",
  235. "West Lothian"=>"West Lothian","West Midlands"=>"West Midlands","West Sussex"=>"West Sussex","West Yorkshire"=>"West Yorkshire",
  236. "Western Isles"=>"Western Isles","Wiltshire"=>"Wiltshire","Worcestershire"=>"Worcestershire","Wrexham"=>"Wrexham")
  237. ,
  238. 'ES' => array ("Alava" => "Alava", "Albacete" => "Albacete", "Alicante" => "Alicante", "Almeria" => "Almeria", "Asturias" => "Asturias",
  239. "Avila" => "Avila", "Badajoz" => "Badajoz", "Barcelona" => "Barcelona", "Burgos" => "Burgos", "Caceres" => "Caceres",
  240. "Cadiz" => "Cadiz", "Cantabria" => "Cantabria", "Castellon" => "Castellon", "Ceuta" => "Ceuta", "Ciudad Real" => "Ciudad Real",
  241. "Cordoba" => "Cordoba", "Cuenca" => "Cuenca", "Guadalajara" => "Guadalajara", "Gerona" => "Gerona", "Granada" => "Granada",
  242. "Guipuzcoa" => "Guipuzcoa", "Huelva" => "Huelva", "Huesca" => "Huesca", "Islas Baleares" => "Islas Baleares", "Jaen" => "Jaen",
  243. "La Coruna" => "La Coruna", "Las Palmas" => "Las Palmas", "La Rioja" => "La Rioja", "Leon" => "Leon", "Lerida" => "Lerida",
  244. "Lugo" => "Lugo", "Madrid" => "Madrid", "Malaga" => "Malaga", "Melilla" => "Melilla", "Murcia" => "Murcia", "Navarra" => "Navarra",
  245. "Orense" => "Orense", "Palencia" => "Palencia", "Pontevedra" => "Pontevedra", "Salamanca" => "Salamanca",
  246. "Santa Cruz de Tenerife" => "Santa Cruz de Tenerife", "Segovia" => "Segovia", "Sevilla" => "Sevilla", "Soria" => "Soria",
  247. "Tarragona" => "Tarragona", "Teruel" => "Teruel", "Toledo" => "Toledo", "Valencia" => "Valencia", "Valladolid" => "Valladolid",
  248. "Vizcaya" => "Vizcaya", "Zamora" => "Zamora", "Zaragoza" => "Zaragoza")
  249. );
  250. // ----------------------------
  251. // Internal Use Varibles
  252. // ----------------------------
  253. /* -----------------------------------------
  254. AVS Response Code Values and Meanings
  255. -----------------------------------------
  256. - $AvsResponseCodesArray[CODE][MESSAGE]
  257. - $AvsResponseCodesArray[CODE][DETAILS]
  258. */
  259. public $AvsResponseCodesArray = array (
  260. 'A' => array('message' => 'Address', 'details' => 'Address Only (no ZIP)'),
  261. 'B' => array('message' => 'International "A"', 'details' => 'Address Only (no ZIP)'),
  262. 'C' => array('message' => 'International "N"', 'details' => 'None - The transaction is declined.'),
  263. 'D' => array('message' => 'International "X"', 'details' => 'Address and Postal Code'),
  264. 'E' => array('message' => 'Not Allowed for MOTO (Internet/Phone) transactions', 'details' => 'Not applicable - The transaction is declined.'),
  265. 'F' => array('message' => 'UK-Specific "X"', 'details' => 'Address and Postal Code'),
  266. 'G' => array('message' => 'Global Unavailable', 'details' => 'Not applicable'),
  267. 'I' => array('message' => 'International Unavailable', 'details' => 'Not applicable'),
  268. 'N' => array('message' => 'No', 'details' => 'None - The transaction is declined.'),
  269. 'P' => array('message' => 'Postal (International "Z")', 'details' => 'Postal Code only (no Address)'),
  270. 'R' => array('message' => 'Retry', 'details' => 'Not Applicable'),
  271. 'S' => array('message' => 'Service Not Supported', 'details' => 'Not Applicable'),
  272. 'U' => array('message' => 'Unavailable', 'details' => 'Not Applicable'),
  273. 'W' => array('message' => 'Whole ZIP', 'details' => 'Nine-digit ZIP code (no Address)'),
  274. 'X' => array('message' => 'Exact Match', 'details' => 'Address and nine-digit ZIP code'),
  275. 'Y' => array('message' => 'Yes', 'details' => 'Address and five-digit ZIP'),
  276. 'Z' => array('message' => 'ZIP', 'details' => 'Five-digit ZIP code (no Address)'),
  277. '' => array('message' => 'Error', 'details' => 'Not Applicable')
  278. );
  279. /* ---------------------------------------
  280. CVV Rsponse Code Values and Meanings
  281. ---------------------------------------
  282. - $CvvResponseCodesArray[CODE][MESSAGE]
  283. - $CvvResponseCodesArray[CODE][DETAILS]
  284. */
  285. public $CvvResponseCodesArray = array (
  286. 'M' => array('message' => 'Match', 'details' => 'CVV2'),
  287. 'N' => array('message' => 'No Match', 'details' => 'None'),
  288. 'P' => array('message' => 'Not Processed', 'details' => 'Not Applicable'),
  289. 'S' => array('message' => 'Service not supported', 'details' => 'Not Applicable'),
  290. 'U' => array('message' => 'Service not available', 'details' => 'Not Applicable'),
  291. 'X' => array('message' => 'No response', 'details' => 'Not Applicable')
  292. );
  293. /* ---------------------------------------
  294. CVV Rsponse Code Values and Meanings for Switch and Solo cards
  295. ---------------------------------------
  296. - TODO: ??
  297. */
  298. /* --------------------------------------------
  299. REQUEST FIELDS ARRAYS
  300. --------------------------------------------
  301. */
  302. public $RequestFieldsArray = array(
  303. 'DoCapture' => array(
  304. 'authorization_id' => array('name' =>'AUTHORIZATIONID', 'required' => 'yes'),
  305. 'amount' => array('name' =>'AMT', 'required' => 'yes'),
  306. 'currency_code' => array('name' =>'CURRENCYCODE', 'required' => 'no'),
  307. 'complete_type' => array('name' =>'COMPLETETYPE', 'required' => 'yes'),
  308. 'invoice_number' => array('name' =>'INVNUM', 'required' => 'no'),
  309. 'note' => array('name' =>'NOTE', 'required' => 'no'),
  310. 'soft_descriptor' => array('name' =>'SOFTDESCRIPTOR', 'required' => 'no')
  311. ),
  312. 'DoAuthorization' => array(
  313. 'transaction_id' => array('name' =>'TRANSACTIONID', 'required' => 'yes'),
  314. 'amount' => array('name' =>'AMT', 'required' => 'yes'),
  315. 'transaction_entity' => array('name' =>'TRANSACTIONENTITY', 'required' => 'no'),
  316. 'currency_code' => array('name' =>'CURRENCYCODE', 'required' => 'no')
  317. ),
  318. 'DoReauthorization' => array(
  319. 'authorization_id' => array('name' =>'AUTHORIZATIONID', 'required' => 'yes'),
  320. 'amount' => array('name' =>'AMT', 'required' => 'yes')
  321. ),
  322. 'DoVoid' => array(
  323. 'authorization_id' => array('name' =>'AUTHORIZATIONID', 'required' => 'yes'),
  324. 'note' => array('name' =>'NOTE', 'required' => 'no')
  325. ),
  326. 'DoDirectPayment' => array(
  327. 'payment_type' => array('name' => 'PAYMENTACTION', 'required' => 'yes'),
  328. 'ip_address' => array('name' => 'IPADDRESS', 'required' => 'yes'),
  329. 'return_fmf_details' => array('name' => 'RETURNFMFDETAILS', 'required' => 'no'),
  330. 'amount_total' => array('name' => 'AMT', 'required' => 'yes'),
  331. 'credit_card_type' => array('name' => 'CREDITCARDTYPE', 'required' => 'yes'),
  332. 'credit_card_number' => array('name' => 'ACCT', 'required' => 'yes'),
  333. 'expire_date' => array('name' => 'EXPDATE', 'required' => 'yes'),
  334. 'first_name' => array('name' => 'FIRSTNAME', 'required' => 'yes'),
  335. 'last_name' => array('name' => 'LASTNAME', 'required' => 'yes'),
  336. 'address1' => array('name' => 'STREET', 'required' => 'no'),
  337. 'address2' => array('name' => 'STREET2', 'required' => 'no'),
  338. 'city' => array('name' => 'CITY', 'required' => 'no'),
  339. 'state' => array('name' => 'STATE', 'required' => 'no'),
  340. 'country_code' => array('name' => 'COUNTRYCODE', 'required' => 'no'),
  341. 'postal_code' => array('name' => 'ZIP', 'required' => 'no'),
  342. 'notify_url' => array('name' => 'NOTIFYURL', 'required' => 'no'),
  343. 'currency_code' => array('name' => 'CURRENCYCODE', 'required' => 'no'),
  344. 'amount_items' => array('name' => 'ITEMAMT', 'required' => 'no'),
  345. 'amount_shipping' => array('name' => 'SHIPPINGAMT', 'required' => 'no'),
  346. 'amount_handling' => array('name' => 'HANDLINGAMT', 'required' => 'no'),
  347. 'amount_tax' => array('name' => 'TAXAMT', 'required' => 'no'),
  348. 'description' => array('name' => 'DESC', 'required' => 'no'),
  349. 'custom' => array('name' => 'CUSTOM', 'required' => 'no'),
  350. 'invoice_number' => array('name' => 'INVNUM', 'required' => 'no'),
  351. 'cvv2_code' => array('name' => 'CVV2', 'required' => 'yes'),
  352. 'start_date' => array('name' => 'STARTDATE', 'required' => 'no'), // For Maestro/Solo cards
  353. 'issue_number' => array('name' => 'ISSUENUMBER', 'required' => 'no'), // For maestro/Solo Cards
  354. 'email' => array('name' => 'EMAIL', 'required' => 'no'),
  355. 'phone_number' => array('name' => 'PHONENUM', 'required' => 'no'),
  356. 'shipping_name' => array('name' => 'SHIPTONAME', 'required' => 'no'),
  357. 'shipping_address1' => array('name' => 'SHIPTOSTREET', 'required' => 'no'),
  358. 'shipping_address2' => array('name' => 'SHIPTOSTREET2', 'required' => 'no'),
  359. 'shipping_city' => array('name' => 'SHIPTOCITY', 'required' => 'no'),
  360. 'shipping_state' => array('name' => 'SHIPTOSTATE', 'required' => 'no'),
  361. 'shipping_postal_code' => array('name' => 'SHIPTOZIP', 'required' => 'no'),
  362. 'shipping_country_code' => array('name' => 'SHIPTOCOUNTRYCODE', 'required' => 'no'),
  363. 'shipping_phone_number' => array('name' => 'SHIPTOPHONENUM', 'required' => 'no')
  364. ),
  365. 'SetExpressCheckout' => array(
  366. 'return_url' => array('name' => 'RETURNURL', 'required' => 'yes'),
  367. 'cancel_url' => array('name' => 'CANCELURL', 'required' => 'yes'),
  368. 'amount_total' => array('name' => 'AMT', 'required' => 'yes'),
  369. 'currency_code' => array('name' => 'CURRENCYCODE', 'required' => 'no'),
  370. 'amount_max' => array('name' => 'MAXAMT', 'required' => 'no'),
  371. 'payment_type' => array('name' => 'PAYMENTACTION', 'required' => 'no'),
  372. 'email' => array('name' => 'EMAIL', 'required' => 'no'),
  373. 'description' => array('name' => 'DESC', 'required' => 'no'),
  374. 'custom' => array('name' => 'CUSTOM', 'required' => 'no'),
  375. 'invoice_number' => array('name' => 'INVNUM', 'required' => 'no'),
  376. 'phone_number' => array('name' => 'PHONENUM', 'required' => 'no'),
  377. 'shipping_name' => array('name' => 'SHIPTONAME', 'required' => 'no'),
  378. 'shipping_address1' => array('name' => 'SHIPTOSTREET', 'required' => 'no'),
  379. 'shipping_address2' => array('name' => 'SHIPTOSTREET2', 'required' => 'no'),
  380. 'shipping_city' => array('name' => 'SHIPTOCITY', 'required' => 'no'),
  381. 'shipping_state' => array('name' => 'SHIPTOSTATE', 'required' => 'no'),
  382. 'shipping_postal_code' => array('name' => 'SHIPTOZIP', 'required' => 'no'),
  383. 'shipping_country_code' => array('name' => 'SHIPTOCOUNTRYCODE', 'required' => 'no'),
  384. 'shipping_phone_number' => array('name' => 'SHIPTOPHONENUM', 'required' => 'no'),
  385. 'require_confirmed_shipping_address' => array('name' => 'REQCONFIRMSHIPPING', 'required' => 'no'),
  386. 'no_shipping' => array('name' => 'NOSHIPPING', 'required' => 'no'),
  387. 'address_override' => array('name' => 'ADDROVERRIDE', 'required' => 'no'),
  388. 'token' => array('name' => 'TOKEN', 'required' => 'no'),
  389. 'locale_code' => array('name' => 'LOCALECODE', 'required' => 'no'),
  390. 'page_style' => array('name' => 'PAGESTYLE', 'required' => 'no'),
  391. 'hdr_img' => array('name' => 'HDRIMG', 'required' => 'no'),
  392. 'hdr_border_color' => array('name' => 'HDRBORDERCOLOR', 'required' => 'no'),
  393. 'hdr_background_color' => array('name' => 'HDRBACKCOLOR', 'required' => 'no'),
  394. 'payflow_color' => array('name' => 'PAYFLOWCOLOR', 'required' => 'no'),
  395. 'user_action' => array('name' => 'USERACTION', 'required' => 'no'),
  396. 'channel_type' => array('name' => 'CHANNELTYPE', 'required' => 'no'),
  397. 'solution_type' => array('name' => 'SOLUTIONTYPE', 'required' => 'no') ,
  398. 'billing_type' => array('name' => 'L_BILLINGTYPE0', 'required' => 'no'),
  399. 'billing_agreement' => array('name' => 'L_BILLINGAGREEMENTDESCRIPTION0', 'required' => 'no')
  400. ),
  401. 'GetExpressCheckoutDetails' => array(
  402. 'token' => array('name' => 'TOKEN', 'required' => 'yes')
  403. ),
  404. 'DoExpressCheckoutPayment' => array(
  405. 'token' => array('name' => 'TOKEN', 'required' => 'yes'),
  406. 'payment_type' => array('name' => 'PAYMENTACTION', 'required' => 'yes'),
  407. 'payer_id' => array('name' => 'PAYERID', 'required' => 'yes'),
  408. 'amount_total' => array('name' => 'AMT', 'required' => 'yes'),
  409. 'description' => array('name' => 'DESC', 'required' => 'no'),
  410. 'custom' => array('name' => 'CUSTOM', 'required' => 'no'),
  411. 'invoice_number' => array('name' => 'INVNUM', 'required' => 'no'),
  412. 'notify_url' => array('name' => 'NOTIFYURL', 'required' => 'no'),
  413. 'amount_items' => array('name' => 'ITEMAMT', 'required' => 'no'),
  414. 'amount_shipping' => array('name' => 'SHIPPINGAMT', 'required' => 'no'),
  415. 'amount_handling' => array('name' => 'HANDLINGAMT', 'required' => 'no'),
  416. 'amount_tax' => array('name' => 'TAXAMT', 'required' => 'no'),
  417. 'currency_code' => array('name' => 'CURRENCYCODE', 'required' => 'no'),
  418. 'shipping_name' => array('name' => 'SHIPTONAME', 'required' => 'no'),
  419. 'shipping_address1' => array('name' => 'SHIPTOSTREET', 'required' => 'no'),
  420. 'shipping_address2' => array('name' => 'SHIPTOSTREET2', 'required' => 'no'),
  421. 'shipping_city' => array('name' => 'SHIPTOCITY', 'required' => 'no'),
  422. 'shipping_state' => array('name' => 'SHIPTOSTATE', 'required' => 'no'),
  423. 'shipping_postal_code' => array('name' => 'SHIPTOZIP', 'required' => 'no'),
  424. 'shipping_country_code' => array('name' => 'SHIPTOCOUNTRYCODE', 'required' => 'no'),
  425. 'shipping_phone_number' => array('name' => 'SHIPTOPHONENUM', 'required' => 'no')
  426. ),
  427. 'GetTransactionDetails' => array(
  428. 'transaction_id' => array('name' => 'TRANSACTIONID', 'required' => 'yes')
  429. ),
  430. 'RefundTransaction' => array(
  431. 'transaction_id' => array('name' => 'TRANSACTIONID', 'required' => 'yes'),
  432. 'refund_type' => array('name' => 'REFUNDTYPE', 'required' => 'yes'),
  433. 'amount_total' => array('name' => 'AMT', 'required' => 'no'),
  434. 'note' => array('name' => 'NOTE', 'required' => 'no'),
  435. ),
  436. 'CreateRecurringPaymentsProfile' => array(
  437. 'token' => array('name' => 'TOKEN', 'required' => 'yes'),
  438. 'payer_id' => array('name' => 'PAYERID', 'required' => 'yes'),
  439. 'email' => array('name' => 'EMAIL', 'required' => 'yes'),
  440. 'country_code' => array('name' => 'COUNTRYCODE', 'required' => 'no'),
  441. 'business' => array('name' => 'BUSINESS', 'required' => 'no'),
  442. 'payer_status' => array('name' => 'PAYERSTATUS', 'required' => 'no'),
  443. 'subscriber_name' => array('name' => 'SUBSCRIBERNAME', 'required' => 'yes'),
  444. 'profile_reference' => array('name' => 'PROFILEREFERENCE', 'required' => 'yes'),
  445. 'credit_card_type' => array('name' => 'CREDITCARDTYPE', 'required' => 'yes'),
  446. 'credit_card_number' => array('name' => 'ACCT', 'required' => 'yes'),
  447. 'expire_date' => array('name' => 'EXPDATE', 'required' => 'yes'),
  448. 'first_name' => array('name' => 'FIRSTNAME', 'required' => 'yes'),
  449. 'last_name' => array('name' => 'LASTNAME', 'required' => 'yes'),
  450. 'address1' => array('name' => 'STREET', 'required' => 'no'),
  451. 'address2' => array('name' => 'STREET2', 'required' => 'no'),
  452. 'city' => array('name' => 'CITY', 'required' => 'no'),
  453. 'state' => array('name' => 'STATE', 'required' => 'no'),
  454. 'country_code' => array('name' => 'COUNTRYCODE', 'required' => 'no'),
  455. 'postal_code' => array('name' => 'ZIP', 'required' => 'no'),
  456. 'shipping_name' => array('name' => 'SHIPTONAME', 'required' => 'no'),
  457. 'shipping_address1' => array('name' => 'SHIPTOSTREET', 'required' => 'no'),
  458. 'shipping_address2' => array('name' => 'SHIPTOSTREET2', 'required' => 'no'),
  459. 'shipping_city' => array('name' => 'SHIPTOCITY', 'required' => 'no'),
  460. 'shipping_state' => array('name' => 'SHIPTOSTATE', 'required' => 'no'),
  461. 'shipping_postal_code' => array('name' => 'SHIPTOZIP', 'required' => 'no'),
  462. 'shipping_country_code' => array('name' => 'SHIPTOCOUNTRYCODE', 'required' => 'no'),
  463. 'shipping_phone_number' => array('name' => 'SHIPTOPHONENUM', 'required' => 'no'),
  464. 'description' => array('name' => 'DESC', 'required' => 'yes'), // You must match the billing agreement var in set Express checkout
  465. 'currency' => array('name' => 'CURRENCYCODE', 'required' => 'yes'),
  466. 'payment_type' => array('name' => 'PAYMENTACTION', 'required' => 'yes'),
  467. 'billing_type' => array('name' => 'L_BILLINGTYPE0', 'required' => 'yes'),
  468. 'billing_agreement' => array('name' => 'L_BILLINGAGREEMENTDESCRIPTION0', 'required' => 'yes'),
  469. 'profile_start_date' => array('name' => 'PROFILESTARTDATE', 'required' => 'yes'),
  470. 'billing_period' => array('name' => 'BILLINGPERIOD', 'required' => 'yes'), // Day Week Month SemiMonth Year
  471. 'billing_frequency' => array('name' => 'BILLINGFREQUENCY', 'required' => 'yes'),
  472. 'billing_amount' => array('name' => 'AMT', 'required' => 'yes'),
  473. 'tax_amount' => array('name' => 'TAXAMT', 'required' => 'yes'),
  474. 'ship_amount' => array('name' => 'SHIPPINGAMT', 'required' => 'yes'),
  475. 'inital_amount' => array('name' => 'INITAMT', 'required' => 'no'),
  476. 'failed_inital_amount' => array('name' => 'FAILEDINITAMTACTION', 'required' => 'no'),
  477. 'billing_total_cycles' => array('name' => 'TOTALBILLINGCYCLES', 'required' => 'no'),
  478. 'trial_billing_period' => array('name' => 'TRIALBILLINGPERIOD', 'required' => 'no'),
  479. 'trial_billing_frequency' => array('name' => 'TRIALBILLINGFREQUENCY', 'required' => 'no'),
  480. 'trial_amount' => array('name' => 'TRIALAMT', 'required' => 'no'),
  481. 'trial_billing_cycle' => array('name' => 'TRIALTOTALBILLINGCYCLES', 'required' => 'no'),
  482. 'max_failed_attempts' => array('name' => 'MAXFAILEDPAYMENTS', 'required' => 'no'),
  483. 'auto_bill_amt' => array('name' => 'AUTOBILLOUTAMT', 'required' => 'no')
  484. ),
  485. 'UpdateRecurringPaymentsProfile' => array(
  486. 'profile_id' => array('name' => 'PROFILEID', 'required' => 'yes'),
  487. 'note' => array('name' => 'NOTE', 'required' => 'no'),
  488. 'description' => array('name' => 'DESC', 'required' => 'no'),
  489. 'subscriber_name' => array('name' => 'SUBSCRIBERNAME', 'required' => 'no'),
  490. 'profile_reference' => array('name' => 'PROFILEREFERENCE', 'required' => 'no'),
  491. 'additional_billing_cycles' => array('name' => 'ADDITIONALBILLINGCYCLES', 'required' => 'no'),
  492. 'amount' => array('name' => 'AMT', 'required' => 'yes'),
  493. 'shipping_amount' => array('name' => 'SHIPPINGAMT', 'required' => 'no'),
  494. 'tax_amount' => array('name' => 'TAXAMT', 'required' => 'no'),
  495. 'outstanding_amount' => array('name' => 'OUTSTANDINGAMT', 'required' => 'no'),
  496. 'auto_bill_out' => array('name' => 'AUTOBILLOUTAMT', 'required' => 'no'),
  497. 'max_failed_payments' => array('name' => 'MAXFAILEDPAYMENTS', 'required' => 'no'),
  498. 'profile_start_date' => array('name' => 'PROFILESTARTDATE' , 'required' => 'no'),
  499. 'ship_to_name' => array('name' => 'SHIPTONAME', 'required' => 'no'),
  500. 'ship_to_street' => array('name' => 'SHIPTOSTREET', 'required' => 'no'),
  501. 'ship_to_street_2' => array('name' => 'SHIPTOSTREET2', 'required' => 'no'),
  502. 'ship_to_city' => array('name' => 'SHIPTOCITY', 'required' => 'no'),
  503. 'ship_to_province' => array('name' => 'SHIPTOSTATE', 'required' => 'no'),
  504. 'ship_to_postal_code' => array('name' => 'SHIPTOZIP', 'required' => 'no'),
  505. 'ship_to_country' => array('name' => 'SHIPTOCOUNTRY', 'required' => 'no'),
  506. 'ship_to_phone_number' => array('name' => 'SHIPTOPHONENUM', 'required' => 'no'),
  507. 'billing_period' => array('name' => 'BILLINGPERIOD', 'required' => 'yes'),
  508. 'billing_frequency' => array('name' => 'BILLINGFREQUENCY', 'required' => 'yes'),
  509. 'total_billing_cycles' => array('name' => 'TOTALBILLINGCYCLES', 'required' => 'no'),
  510. 'trial_billing_period' => array('name' => 'TRIALBILLINGPERIOD', 'required' => 'no'),
  511. 'trial_billing_frequnecy' => array('name' => 'TRIALBILLINGFREQUENCY', 'required' => 'no'),
  512. 'trial_total_cycles' => array('name' => 'TRIALTOTALBILLINGCYCLES', 'required' => 'no'),
  513. 'trial_amount' => array('name' => 'TRIALAMT', 'required' => 'no'),
  514. 'currency' => array('name' => 'CURRENCYCODE', 'required' => 'yes'),
  515. 'shipping_amount' => array('name' => 'SHIPPINGAMT', 'required' => 'no'),
  516. 'tax_amount' => array('name' => 'TAXAMT', 'required' => 'no'),
  517. 'credit_card_type' => array('name' => 'CREDITCARDTYPE', 'required' => 'no'),
  518. 'credit_card_number' => array('name' => 'ACCT', 'required' => 'no'),
  519. 'expiration_date' => array('name' => 'EXPDATE', 'required' => 'no'),
  520. 'cvv2' => array('name' => 'CVV2', 'required' => 'no'),
  521. 'start_date' => array('name' => 'STARTDATE', 'required' => 'no'),
  522. 'email' => array('name' => 'EMAIL', 'required' => 'no'),
  523. 'first_name' => array('name' => 'FIRSTNAME', 'required' => 'no'),
  524. 'last_name' => array('name' => 'LASTNAME', 'required' => 'no'),
  525. 'street' => array('name' => 'STREET', 'required' => 'yes'),
  526. 'street2' => array('name' => 'STREET2', 'required' => 'no'),
  527. 'city' => array('name' => 'CITY', 'required' => 'yes'),
  528. 'province' => array('name' => 'STATE', 'required' => 'yes'),
  529. 'country_code' => array('name' => 'COUNTRYCODE', 'required' => 'yes'),
  530. 'postal_code' => array('name' => 'ZIP', 'required' => 'yes'),
  531. 'phone_number' => array('name' => 'PHONENUM', 'required' => 'no')
  532. ),
  533. 'DoReferenceTransaction' => array(
  534. 'reference_id' => array('name' => 'REFERENCEID', 'required' => 'yes'),
  535. 'payment_type' => array('name' => 'PAYMENTACTION', 'required' => 'yes'),
  536. 'return_fmf_details' => array('name' => 'RETURNFMFDETAILS', 'required' => 'no'),
  537. 'soft_descriptor' => array('name' => 'SOFTDESCRIPTOR', 'required' => 'no'),
  538. 'ship_to_name' => array('name' => 'SHIPTONAME', 'required' => 'no'),
  539. 'ship_to_street' => array('name' => 'SHIPTOSTREET', 'required' => 'no'),
  540. 'ship_to_street_2' => array('name' => 'SHIPTOSTREET2', 'required' => 'no'),
  541. 'ship_to_city' => array('name' => 'SHIPTOCITY', 'required' => 'no'),
  542. 'ship_to_province' => array('name' => 'SHIPTOSTATE', 'required' => 'no'),
  543. 'ship_to_postal_code' => array('name' => 'SHIPTOZIP', 'required' => 'no'),
  544. 'ship_to_country' => array('name' => 'SHIPTOCOUNTRY', 'required' => 'no'),
  545. 'ship_to_phone_number' => array('name' => 'SHIPTOPHONENUM', 'required' => 'no'),
  546. 'billing_period' => array('name' => 'BILLINGPERIOD', 'required' => 'yes'),
  547. 'billing_frequency' => array('name' => 'BILLINGFREQUENCY', 'required' => 'yes'),
  548. 'phone_number' => array('name' => 'PHONENUM', 'required' => 'no'),
  549. 'amount_total' => array('name' => 'AMT', 'required' => 'yes'),
  550. 'currency_code' => array('name' => 'CURRENCYCODE', 'required' => 'no'),
  551. 'amount_items' => array('name' => 'ITEMAMT', 'required' => 'no'),
  552. 'amount_shipping' => array('name' => 'SHIPPINGAMT', 'required' => 'no'),
  553. 'amount_handling' => array('name' => 'HANDLINGAMT', 'required' => 'no'),
  554. 'amount_tax' => array('name' => 'TAXAMT', 'required' => 'no'),
  555. 'description' => array('name' => 'DESC', 'required' => 'no'),
  556. 'custom' => array('name' => 'CUSTOM', 'required' => 'no'),
  557. 'invoice_number' => array('name' => 'INVNUM', 'required' => 'no'),
  558. 'button_source' => array('name' => 'BUTTONSOURCE', 'required' => 'no'),
  559. 'notify_url' => array('name' => 'NOTIFYURL', 'required' => 'no'),
  560. 'credit_card_type' => array('name' => 'CREDITCARDTYPE', 'required' => 'no'),
  561. 'credit_card_number' => array('name' => 'ACCT', 'required' => 'no'),
  562. 'cvv2_code' => array('name' => 'CVV2', 'required' => 'yes'),
  563. 'expire_date' => array('name' => 'EXPDATE', 'required' => 'no'),
  564. 'start_date' => array('name' => 'STARTDATE', 'required' => 'no'), // For Maestro/Solo cards
  565. 'issue_number' => array('name' => 'ISSUENUMBER', 'required' => 'no'), // For maestro/Solo Cards
  566. 'email' => array('name' => 'EMAIL', 'required' => 'no'),
  567. 'first_name' => array('name' => 'FIRSTNAME', 'required' => 'no'),
  568. 'last_name' => array('name' => 'LASTNAME', 'required' => 'no'),
  569. 'address1' => array('name' => 'STREET', 'required' => 'no'),
  570. 'address2' => array('name' => 'STREET2', 'required' => 'no'),
  571. 'city' => array('name' => 'CITY', 'required' => 'no'),
  572. 'state' => array('name' => 'STATE', 'required' => 'no'),
  573. 'country_code' => array('name' => 'COUNTRYCODE', 'required' => 'no'),
  574. 'postal_code' => array('name' => 'ZIP', 'required' => 'no')
  575. )
  576. );
  577. public $ResponseFieldsArray = array(
  578. 'DoCapture' => array(
  579. 'authorization_id' => 'AUTHORIZATIONID',
  580. 'email' => 'EMAIL',
  581. 'payer_id' => 'PAYERID',
  582. 'payer_status' => 'PAYERSTATUS',
  583. 'country_code' => 'COUNTRYCODE',
  584. 'business' => 'BUSINESS',
  585. 'address_status' => 'ADDRESSSTATUS',
  586. 'shipping_name' => 'SHIPTONAME',
  587. 'shipping_address1' => 'SHIPTOSTREET',
  588. 'shipping_address2' => 'SHIPTOSTREET2',
  589. 'shipping_city' => 'SHIPTOCITY',
  590. 'shipping_state' => 'SHIPTOSTATE',
  591. 'shipping_postal_code' => 'SHIPTOZIP',
  592. 'shipping_country_code' => 'SHIPTOCOUNTRYCODE',
  593. 'salutation' => 'SALUTATION',
  594. 'first_name' => 'FIRSTNAME',
  595. 'middle_name' => 'MIDDLENAME',
  596. 'last_name' => 'LASTNAME',
  597. 'suffix' => 'SUFFIX'
  598. ),
  599. 'DoAuthorization' => array(
  600. 'transaction_id' => 'TRANSACTIONID',
  601. 'amount' => 'AMT'
  602. ),
  603. 'DoReauthorization' => array(
  604. 'authorization_id' => 'AUTHORIZATIONID'
  605. ),
  606. 'DoVoid' => array(
  607. 'authorization_id' => 'AUTHORIZATIONID'
  608. ),
  609. 'DoDirectPayment' => array(
  610. 'timestamp' => 'TIMESTAMP',
  611. 'correlation_id' => 'CORRELATIONID',
  612. 'ack' => 'ACK',
  613. 'version' => 'VERSION',
  614. 'build' => 'BUILD',
  615. 'avs_code' => 'AVSCODE',
  616. 'cvv2_match' => 'CVV2MATCH',
  617. 'transaction_id' => 'TRANSACTIONID',
  618. 'amount_total' => 'AMT',
  619. 'currency_code' => 'CURRENCYCODE'
  620. )
  621. ,
  622. 'SetExpressCheckout' => array(
  623. 'timestamp' => 'TIMESTAMP',
  624. 'correlation_id' => 'CORRELATIONID',
  625. 'ack' => 'ACK',
  626. 'version' => 'VERSION',
  627. 'build' => 'BUILD',
  628. 'token' => 'TOKEN'
  629. )
  630. ,
  631. 'DoExpressCheckoutPayment' => array(
  632. 'timestamp' => 'TIMESTAMP',
  633. 'correlation_id' => 'CORRELATIONID',
  634. 'ack' => 'ACK',
  635. 'version' => 'VERSION',
  636. 'build' => 'BUILD',
  637. 'token' => 'TOKEN',
  638. 'transaction_id' => 'TRANSACTIONID',
  639. 'transaction_type' => 'TRANSACTIONTYPE',
  640. 'payment_type' => 'PAYMENTTYPE',
  641. 'order_time' => 'ORDERTIME',
  642. 'amount_total' => 'AMT',
  643. 'currency_code' => 'CURRENCYCODE',
  644. 'amount_fee' => 'FEEAMT',
  645. 'amount_settle' => 'SETTLEAMT',
  646. 'amount_tax' => 'TAXAMT',
  647. 'exchange_rate' => 'EXCHANGERATE',
  648. 'payment_status' => 'PAYMENTSTATUS',
  649. 'payment_pending_reason'=> 'PENDINGREASON',
  650. 'payment_reason_code' => 'REASONCODE'
  651. )
  652. ,
  653. 'GetExpressCheckoutDetails' => array(
  654. 'timestamp' => 'TIMESTAMP',
  655. 'correlation_id' => 'CORRELATIONID',
  656. 'ack' => 'ACK',
  657. 'version' => 'VERSION',
  658. 'build' => 'BUILD',
  659. 'token' => 'TOKEN',
  660. 'email' => 'EMAIL',
  661. 'payer_id' => 'PAYERID',
  662. 'payer_status' => 'PAYERSTATUS',
  663. 'salutation' => 'SALUTATION',
  664. 'first_name' => 'FIRSTNAME',
  665. 'middle_name' => 'MIDDLENAME',
  666. 'last_name' => 'LASTNAME',
  667. 'suffix' => 'SUFFIX',
  668. 'country_code' => 'COUNTRYCODE',
  669. 'business' => 'BUSINESS',
  670. 'shipping_name' => 'SHIPTONAME',
  671. 'shipping_address1' => 'SHIPTOSTREET',
  672. 'shipping_address2' => 'SHIPTOSTREET2',
  673. 'shipping_city' => 'SHIPTOCITY',
  674. 'shipping_state' => 'SHIPTOSTATE',
  675. 'shipping_country_code' => 'SHIPTOCOUNTRYCODE',
  676. 'shipping_country_name' => 'SHIPTOCOUNTRYNAME',
  677. 'shipping_postal_code' => 'SHIPTOZIP',
  678. 'address_id' => 'ADDRESSID', // Is this a returned variable? Some docs say yes, some no
  679. 'address_status' => 'ADDRESSSTATUS',
  680. 'description' => 'DESC',
  681. 'custom' => 'CUSTOM',
  682. 'phone_number' => 'PHONENUM'
  683. )
  684. ,
  685. 'GetTransactionDetails' => array(
  686. 'timestamp' => 'TIMESTAMP',
  687. 'correlation_id' => 'CORRELATIONID',
  688. 'ack' => 'ACK',
  689. 'version' => 'VERSION',
  690. 'build' => 'BUILD',
  691. 'receiver_business' => 'RECEIVERBUSINESS',
  692. 'receiver_email' => 'RECEIVEREMAIL',
  693. 'receiver_id' => 'RECEIVERID',
  694. 'email' => 'EMAIL',
  695. 'payer_id' => 'PAYERID',
  696. 'payer_status' => 'PAYERSTATUS',
  697. 'salutation' => 'SALUTATION',
  698. 'first_name' => 'FIRSTNAME',
  699. 'last_name' => 'LASTNAME',
  700. 'middle_name' => 'MIDDLENAME',
  701. 'suffix' => 'SUFFIX',
  702. 'payer_business' => 'PAYERBUSINESS',
  703. 'country_code' => 'COUNTRYCODE',
  704. 'business' => 'BUSINESS',
  705. 'shipping_name' => 'SHIPTONAME',
  706. 'shipping_address1' => 'SHIPTOSTREET',
  707. 'shipping_address2' => 'SHIPTOSTREET2',
  708. 'shipping_city' => 'SHIPTOCITY',
  709. 'shipping_state' => 'SHIPTOSTATE',
  710. 'shipping_country_code' => 'SHIPTOCOUNTRYCODE',
  711. 'shipping_country_name' => 'SHIPTOCOUNTRYNAME',
  712. 'shipping_postal_code' => 'SHIPTOZIP',
  713. 'address_id' => 'ADDRESSID', // Is this a returned variable? Some docs say yes, some no
  714. 'address_status' => 'ADDRESSSTATUS',
  715. 'address_owner' => 'ADDRESSOWNER',
  716. 'parent_transaction_id' => 'PARENTTRANSACTIONID',
  717. 'transaction_id' => 'TRANSACTIONID',
  718. 'receipt_id' => 'RECEIPTID',
  719. 'transaction_type' => 'TRANSACTIONTYPE',
  720. 'payment_type' => 'PAYMENTTYPE',
  721. 'order_time' => 'ORDERTIME',
  722. 'amount_total' => 'AMT',
  723. 'currency_code' => 'CURRENCYCODE',
  724. 'amount_fee' => 'FEEAMT',
  725. 'amount_settle' => 'SETTLEAMT',
  726. 'amount_tax' => 'TAXAMT',
  727. 'exchange_rate' => 'EXCHANGERATE',
  728. 'payment_status' => 'PAYMENTSTATUS',
  729. 'payment_pending_reason' => 'PENDINGREASON',
  730. 'payment_reason_code' => 'REASONCODE',
  731. 'amount_sales_tax' => 'SALESTAX',
  732. 'invoice_number' => 'INVNUM',
  733. 'note' => 'NOTE',
  734. 'custom' => 'CUSTOM',
  735. 'subscription_id' => 'SUBSCRIPTIONID',
  736. 'subscription_date' => 'SUBSCRIPTIONDATE',
  737. 'effective_date' => 'EFFECTIVEDATE',
  738. 'retry_time' => 'RETRYTIME',
  739. 'user_name' => 'USERNAME',
  740. 'recurrences' => 'RECURRENCES',
  741. 'reattempt' => 'REATTEMPT',
  742. 'recurring' => 'RECURRING',
  743. 'period' => 'PERIOD',
  744. 'buyer_id' => 'BUYERID',
  745. 'closing_date' => 'CLOSINGDATE',
  746. 'multi_item' => 'MULTIITEM'
  747. )
  748. ,
  749. 'RefundTransaction' => array(
  750. 'refund_transaction_id' => 'REFUNDTRANSACTIONID',
  751. 'amount_refund_net' => 'NETFUNDAMT',
  752. 'amount_refund_fee' => 'FEEREFUNDAMT',
  753. 'amount_refund_total' => 'GROSSREFUNDAMT'
  754. ),
  755. 'CreateRecurringPaymentsProfile' => array(
  756. 'profile_id' => 'PROFILEID',
  757. 'status' => 'STATUS'
  758. ),
  759. 'UpdateRecurringPaymentsProfile' => array(
  760. 'profile_id' => 'PROFILEID',
  761. ),
  762. 'GetRecurringPaymentsProfileDetails' => array(
  763. 'profile_id' => 'PROFILEID',
  764. 'status' => 'STATUS',
  765. 'auto_bill_out' => 'AUTOBILLOUTAMT',
  766. 'description' => 'DESC',
  767. 'max_failed_payments' => 'MAXFAILEDPAYMENTS',
  768. 'subcriber_name' => 'SUBSCRIBERNAME',
  769. 'profile_start_date' => 'PROFILESTARTDATE',
  770. 'nest_billing_date' => 'NEXTBILLINGDATE',
  771. 'num_cycles_completed' => 'NUMCYCLESCOMPLETED',
  772. 'num_cycles_remaining' => 'NUMCYCLESREMAINING',
  773. 'outstanding_balance' => 'OUTSTANDINGBALANCE',
  774. 'failed_billing_account'=> 'FAILEDPAYMENTCOUNT',
  775. 'trial_amount_paid' => 'TRIALAMTPAID',
  776. 'regular_amount_paid' => 'REGULARAMTPAID',
  777. 'aggregate_amount' => 'AGGREGATEAMT',
  778. 'aggregate_option_amount' => 'AGGREGATEOPTIONALAMT',
  779. 'final_payment_due_date' => 'FINALPAYMENTDUEDATE',
  780. 'time_stamp' => 'TIMESTAMP',
  781. 'correlation_id' => 'CORRELATIONID',
  782. 'ack' => 'ACK',
  783. 'version' => 'VERSION',
  784. 'build' => 'BUILD',
  785. 'ship_to_street' => 'SHIPTOSTREET',
  786. 'ship_to_street2' => 'SHIPTOSTREET2',
  787. 'ship_to_city' => 'SHIPTOCITY',
  788. 'ship_to_province' => 'SHIPTOSTATE',
  789. 'ship_to_postalcode' => 'SHIPTOZIP',
  790. 'ship_to_country_code' => 'SHIPTOCOUNTRYCODE',
  791. 'ship_to_country' => 'SHIPTOCOUNTRY',
  792. 'ship_to_country_name' => 'SHIPTOCOUNTRYNAME',
  793. 'ship_address_owner' => 'SHIPADDRESSOWNER',
  794. 'ship_address_status' => 'SHIPADDRESSSTATUS',
  795. 'billing_period' => 'BILLINGPERIOD',
  796. 'billing_frequency' => 'BILLINGFREQUENCY',
  797. 'total_biling_cycles' => 'TOTALBILLINGCYCLES',
  798. 'currency' => 'CURRENCYCODE',
  799. 'amount' => 'AMT',
  800. 'shipping_amount' => 'SHIPPINGAMT',
  801. 'tax_amount' => 'TAXAMT',
  802. 'regualar_billing_period' => 'REGULARBILLINGPERIOD',
  803. 'regular_billing_frequency' => 'REGULARBILLINGFREQUENCY',
  804. 'regular_billing_cycles' => 'REGULARTOTALBILLINGCYCLES',
  805. 'regular_currency' => 'REGULARCURRENCYCODE',
  806. 'regular_amount' => 'REGULARAMT',
  807. 'regular_shipping_amount' => 'REGULARSHIPPINGAMT',
  808. 'regular_tax_amount' => 'REGULARTAXAMT',
  809. 'credit_card_num' => 'ACCT',
  810. 'credit_card_type' => 'CREDITCARDTYPE',
  811. 'expiration_date' => 'EXPDATE',
  812. 'email' => 'EMAIL',
  813. 'first_name' => 'FIRSTNAME',
  814. 'last_name' => 'LASTNAME',
  815. 'street' => 'STREET',
  816. 'street2' => 'STREET2',
  817. 'city' => 'CITY',
  818. 'state' => 'STATE',
  819. 'postal_code' => 'ZIP',
  820. 'country_code' => 'COUNTRYCODE',
  821. 'country' => 'COUNTRY',
  822. 'address_owner' => 'ADDRESSOWNER',
  823. 'address_status' => 'ADDRESSSTATUS',
  824. 'payer_status' => 'PAYERSTATUS'
  825. ),
  826. 'DoReferenceTransaction' => array(
  827. 'avs_code' => 'AVSCODE',
  828. 'cvv2_match' => 'AVV2MATCH',
  829. 'billing_agreement_id' => 'BILLINGAGREEMENTID', // Should include filter ID…

Large files files are truncated, but you can click here to view the full file