WC_Gateway_PayPal_Express_Response_AngellEYE

The PayPal for WooCommerce WC Gateway PayPal Express Response AngellEYE class.

Defined (1)

The class is defined in the following location(s).

/angelleye-includes/express-checkout/class-wc-gateway-paypal-express-response-angelleye.php  
  1. class WC_Gateway_PayPal_Express_Response_AngellEYE { 
  2.  
  3. public function ec_get_shipping_details($response) { 
  4. try { 
  5. $details = array(); 
  6. if (isset($response['FIRSTNAME'])) { 
  7. $details = array( 
  8. 'first_name' => $response['FIRSTNAME'],  
  9. 'last_name' => isset($response['LASTNAME']) ? $response['LASTNAME'] : '',  
  10. 'company' => isset($response['BUSINESS']) ? $response['BUSINESS'] : '',  
  11. 'email' => isset($response['EMAIL']) ? $response['EMAIL'] : '',  
  12. 'phone' => isset($response['PHONENUM']) ? $response['PHONENUM'] : '',  
  13. 'address_1' => isset($response['SHIPTOSTREET']) ? $response['SHIPTOSTREET'] : '',  
  14. 'address_2' => isset($response['SHIPTOSTREET2']) ? $response['SHIPTOSTREET2'] : '',  
  15. 'city' => isset($response['SHIPTOCITY']) ? $response['SHIPTOCITY'] : '',  
  16. 'postcode' => isset($response['SHIPTOZIP']) ? $response['SHIPTOZIP'] : '',  
  17. 'country' => isset($response['SHIPTOCOUNTRYCODE']) ? $response['SHIPTOCOUNTRYCODE'] : '',  
  18. 'state' => (isset($response['SHIPTOCOUNTRYCODE']) && isset($response['SHIPTOSTATE'])) ? $this->ec_get_state_code($response['SHIPTOCOUNTRYCODE'], $response['SHIPTOSTATE']) : '' 
  19. ); 
  20. return $details; 
  21. } catch (Exception $ex) { 
  22.  
  23.  
  24. public function ec_get_state_code($country_code, $state) { 
  25. try { 
  26. if ($country_code !== 'US' && isset(WC()->countries->states[$country_code])) { 
  27. $local_states = WC()->countries->states[$country_code]; 
  28. if (!empty($local_states) && in_array($state, $local_states)) { 
  29. foreach ($local_states as $key => $val) { 
  30. if ($val === $state) { 
  31. return $key; 
  32. return $state; 
  33. } catch (Exception $ex) { 
  34.  
  35.  
  36. public function ec_get_note_text($response) { 
  37. return isset($response['PAYMENTREQUEST_0_NOTETEXT']) ? $response['PAYMENTREQUEST_0_NOTETEXT'] : ''; 
  38.  
  39. public function ec_get_payer_id($response) { 
  40. return isset($response['PAYERID']) ? $response['PAYERID'] : ''; 
  41.  
  42. public function ec_is_response_success($paypal_response) { 
  43. if (strtoupper($paypal_response['ACK']) == 'SUCCESS') { 
  44. return true; 
  45.  
  46. public function ec_is_response_success_or_successwithwarning($paypal_response) { 
  47. if (strtoupper($paypal_response['ACK']) == 'SUCCESS' || strtoupper($paypal_response['ACK']) == "SUCCESSWITHWARNING") { 
  48. return true; 
  49.  
  50. public function ec_is_response_successwithwarning($paypal_response) { 
  51. if (strtoupper($paypal_response['ACK']) == 'SUCCESSWITHWARNING') { 
  52. return true;