Esempio n. 1
0
 public function __construct($data)
 {
     $this->_data = $data;
     if (isset($data['card'])) {
         $this->_card = QuickBooks_Payments_CreditCard::fromArray($data['card']);
     }
 }
Esempio n. 2
0
 public function getCards($Context, $id)
 {
     $id = str_replace(array('{', '}', '-'), '', $id);
     $url = str_replace('<id>', $id, QuickBooks_Payments::URL_CARD);
     print "Trying to get gards for: " . $url . "\n";
     $resp = $this->_http($Context, $url, null);
     print "Request: ";
     print_r($this->_last_request);
     print "Response: ";
     print_r($this->_last_response);
     // error_log($resp);
     $data = json_decode($resp, true);
     if ($this->_handleError($data)) {
         return false;
     }
     $list = array();
     foreach ($data as $card) {
         // How do I stuff this into
         $creditcard = new QuickBooks_Payments_CreditCard();
         $list[] = $creditcard->fromArray($card);
     }
     print_r($list);
     return $list;
 }