public function process() { $json_string = khipu_create_payment($this->config->get('khipu_manual_receiverid'), $this->config->get('khipu_manual_secret'), $this->request->post, 'opencart-khipu-manual-2.5;;' . $this->config->get('config_url') . ';;' . $this->config->get('config_name')); $response = json_decode($json_string); if (!$response) { error_log('no response from khipu'); return; } $url = 'manual-url'; $this->response->redirect($response->{$url}); }
public function process() { $json_string = khipu_create_payment($this->config->get('khipu_receiverid'), $this->config->get('khipu_secret'), $this->request->post, 'opencart-khipu-2.5;;' . $this->config->get('config_url') . ';;' . $this->config->get('config_name')); // We need the string json to use it with the khipu.js $response = json_decode($json_string); if (!$response) { // TODO ERROR //return $this->comm_error(); error_log('no response from khipu'); return; } $readyForTerminal = 'ready-for-terminal'; if (!$response->{$readyForTerminal}) { $this->response->redirect($response->url); return; } $this->response->redirect($this->url->link('payment/khipu/terminal', 'data=' . $this->base64url_encode_compress($json_string), 'SSL')); }