public function sendData($data) { // Initialise the PaymentWall configuration $this->setPaymentWallObject(); // Create the charge object $charge = new \Paymentwall_Charge($data['sale_id']); $charge->capture(); // Get the response data -- this is returned as a JSON string. $charge_response = $charge->getPublicData(); $charge_data = json_decode($charge_response, true); // echo "Charge Data == " . print_r($charge_data, true) . "\n"; // Get the remaining data from the response // echo "Charge == " . print_r($charge, true) . "\n"; // echo "Charge ID == " . $charge->getId() . "\n"; $charge_data['transaction_reference'] = $charge->getId(); // Construct the response object $this->response = new Response($this, $charge_data); return $this->response; }