Exemplo n.º 1
0
 private function process()
 {
     $classname = 'Sp4kAppsPaymentMethods' . ucfirst($this->method);
     $paymentProcessor = new $classname(new JRegistry($this->getState()->get('payment_data')));
     $paymentProcessor->execute();
     if ($payment_error = $paymentProcessor->getError()) {
         $this->status = 0;
         $this->_error = $payment_error;
     } else {
         $this->status = 1;
         //failed/complete/unresolved/abandoned/cancelled/rejected
         $this->processor_transaction_id = $paymentProcessor->transaction_id;
         $this->transaction_id = Sp4kAppsTransactionApp::getInstance(new Registry(['amount' => $paymentProcessor->amount, 'ref_id' => $paymentProcessor->transaction_id, 'method' => $paymentProcessor->name, 'invoice_id' => $this->invoice_id]))->getItem()->update()->id;
     }
     return;
 }
Exemplo n.º 2
0
 protected function execute()
 {
     if ($this->state->get('paging', false)) {
         $limit = $this->state->get('limit');
         $filters = $this->state->get('filters');
         $count = $this->state->get('count', false);
         $appState = new Joomla\Registry\Registry(['limit' => $limit, 'count' => $count, 'filters' => $filters]);
         /** @var Sp4kAppsTransactionApp $registrationApp */
         $app = Sp4kAppsTransactionApp::getInstance($appState);
         $appCollection = $app->getCollection();
         $this->count = $appCollection->count;
         $this->items = $appCollection->items;
     } else {
         $this->items = Sp4kAppsTransactionApp::getInstance(new Joomla\Registry\Registry($this->state->toObject()))->getItems();
     }
 }
Exemplo n.º 3
0
 private function createTransaction()
 {
     if ($this->process_payment_result) {
         $transactionData = new Registry(['payment_id' => $this->payment->id, 'ref_id' => $this->ref_id]);
         $this->transaction = Sp4kAppsTransactionApp::getInstance($transactionData)->getItem();
     }
 }
Exemplo n.º 4
0
 public function execute()
 {
     $this->item = Sp4kAppsTransactionApp::getInsance(new Joomla\Registry\Registry($this->state->toObject()))->getItem();
 }