/** * Assert that an account object is returned after a successful reload. * */ public function testReload() { $account = OmiseAccount::retrieve(); $account->reload(); $this->assertArrayHasKey('object', $account); $this->assertEquals('account', $account['object']); }
/** * Retrieve user's account from their Omise account * @return OmiseAccount|Exception */ public function retrieveOmiseAccount() { try { return OmiseAccount::retrieve($this->_public_key, $this->_secret_key); } catch (Exception $e) { return array('error' => $e->getMessage()); } }
/** * Retrieve account from Omise server * @return OmiseAccount|array */ public function getOmiseAccount() { // Load `omise-php` library. $this->load->library('omise/omise-php/lib/Omise'); // Load language. $this->language->load('payment/omise'); // Get Omise Keys. if ($keys = $this->_getOmiseKeys()) { try { $omise = OmiseAccount::retrieve($keys['public_key'], $keys['secret_key']); return $omise; } catch (Exception $e) { return array('error' => $e->getMessage()); } } else { return $this->_error($this->language->get('error_extension_disabled')); } }
<?php $account = OmiseAccount::retrieve(); // After retrieving it, the account can be refreshed: $account->reload();