/** * Constructor. Decodes the Bold response string. * * @param string $response The response from the Bold server in json. */ public function __construct($response) { parent::__construct($response); // If a list of notifications is returned in the data, the json decoded body object will have an array in the data key, if the data key is an object, it is just one notification. if (is_array($this->body_object->data)) { foreach ($this->data as $notification) { $new_notification = new BoldNotification($notification); $this->notifications[] = $new_notification; } } else { $this->notifications[] = new BoldNotification($this->data); } }
/** * Constructor. Decodes the Bold response string. * * @param string $response The response from the Bold server in json. */ public function __construct($response) { parent::__construct($response); // If a list of deliveries is returned in the data, the json decoded body object will have an array in the data key, if the data key is an object, it is just one delivery. if (is_array($body_object->data)) { foreach ($this->data as $delivery) { $new_delivery = new BoldDelivery($delivery); $this->deliveries[] = $new_delivery; } } else { $this->deliveries[] = new BoldDelivery($this->data); } }
/** * Constructor. Decodes the Bold response string. * * @param string $response The response from the Bold server in json. */ public function __construct($response) { parent::__construct($response); // If a list of transfers is returned in the data, the json decoded body object will have an array in the data key, if the data key is an object, it is just one transfer. if (is_array($this->body_object->data)) { foreach ($this->data as $transfer) { $new_transfer = new BoldTransfer($transfer); // When getting a full list of transfers the recipient is included if (isset($transfer['recipient'])) { $new_recipient = new BoldRecipient($transfer['recipient']); $new_transfer->setRecipient($new_recipient); } $this->transfers[] = $new_transfer; } } else { $new_transfer = new BoldTransfer($this->data); $this->transfers[] = $new_transfer; } }
/** * Constructor. Decodes the Bold response string. * * @param string $response The response from the Bold server in json. */ public function __construct($response) { parent::__construct($response); // If a list of wallets is returned in the data, the json decoded body object will have an array in the data key, if the data key is an object, it is just one wallet. if (is_array($this->body_object->data)) { foreach ($this->data as $wallet) { $new_wallet = new BoldWallet($wallet); $this->wallets[] = $new_wallet; } } else { $this->wallets[] = new BoldWallet($this->data); } }