public function sendData($data) { // Initialise the PaymentWall configuration $this->setPaymentWallObject(); // Create the charge object $charge = new \Paymentwall_Charge($data['sale_id']); $charge->get(); // Get the response data -- this is returned as a JSON string. $charge_data = json_decode($charge->getRawResponseData(), true); // Construct the response object $this->response = new Response($this, $charge_data); return $this->response; }