/** * Gets info for a charge. * * @return array|null */ public function info() { if (!$this->id || !$this->local_customer) { return null; } if (!$this->local_charge) { $this->local_charge = $this->local_customer->charges()->where('id', $this->id)->first(); $this->gateway->apiDelay(); } if (!$this->local_charge) { return null; } return array('id' => $this->id, 'created_at' => (string) $this->local_charge->created_at, 'amount' => $this->local_charge->amount, 'paid' => $this->local_charge->paid, 'refunded' => $this->local_charge->refunded, 'captured' => $this->local_charge->captured, 'card' => $this->local_charge->card_id, 'invoice_id' => null, 'description' => $this->local_charge->description); }
/** * Gets all charges for a customer. * * @return array */ public function charges() { $this->info(); if (!$this->local_customer) { return array(); } $charges = $this->local_customer->charges()->limit(100)->get(); $this->gateway->apiDelay(); $charges_array = array(); foreach ($charges as $charge) { $charges_array[] = $this->charge($charge); } return $charges_array; }