public function get_transaction($id) { try { $displayResult = OmiseTransaction::retrieve($id); } catch (OmiseException $e) { $displayResult = $e->getMessage(); } return $displayResult; }
/** * Assert that a transaction object is returned after a successful retrieve with transaction id. * And validate json structure that's return back. * */ public function testValidateOmiseTransactionObjectRetrievedStructure() { $transaction = OmiseTransaction::retrieve('trxn_test_4zmrjhlflnz6id6q0bo'); $this->assertArrayHasKey('object', $transaction); $this->assertArrayHasKey('id', $transaction); $this->assertArrayHasKey('type', $transaction); $this->assertArrayHasKey('amount', $transaction); $this->assertArrayHasKey('currency', $transaction); $this->assertArrayHasKey('created', $transaction); }
<?php $transactions = OmiseTransaction::retrieve('trxn_test_4xuy2z4w5vmvq4x5pfs');
/** * Get transaction list from Omise server * @return OmiseTransaction|array */ public function getOmiseTransactionList() { // 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 = OmiseTransaction::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 $transactions = OmiseTransaction::retrieve();