private function bindKhipuClass()
 {
     $this->app->bind(Khipu::class, function ($app) {
         $khipu = new Khipu();
         $khipu->authenticate(config('khipu.id'), config('khipu.key'));
         return $khipu;
     });
 }
 /**
  * Método que genera el formulario de pago en HTML
  *
  * @param string $button_type
  *   Dimensión del boton a mostrar
  *
  * @return string
  *   Formulario renderizado
  */
 public function renderForm($button_type = '110x50')
 {
     $values = $this->getFormLabels();
     $html = new DOMDocument();
     $html->formatOutput = true;
     $form = $html->createElement('form');
     $form->setAttribute('action', $this->getApiUrl());
     $form->setAttribute('method', 'POST');
     foreach ($values as $name => $value) {
         $input_hidden = $html->createElement('input');
         $input_hidden->setAttribute('type', 'hidden');
         $input_hidden->setAttribute('name', $name);
         $input_hidden->setAttribute('value', $value);
         $form->appendChild($input_hidden);
     }
     $input_hidden = $html->createElement('input');
     $input_hidden->setAttribute('type', 'hidden');
     $input_hidden->setAttribute('name', 'agent');
     $input_hidden->setAttribute('value', $this->agent);
     $form->appendChild($input_hidden);
     $buttons = Khipu::getButtonsKhipu();
     if (isset($buttons[$button_type])) {
         $button = $buttons[$button_type];
     } else {
         $button = $buttons['100x50'];
     }
     $submit = $html->createElement('input');
     $submit->setAttribute('type', 'image');
     $submit->setAttribute('src', $button);
     $form->appendChild($submit);
     $html->appendChild($form);
     return $html->saveHTML();
 }
 /**
  * Iniciamos el servicio
  */
 public function __construct()
 {
     // Asignamos la url del servicio
     $this->apiUrl = Khipu::getUrlService('VerifyPaymentNotification');
     // Iniciamos los datos requeridos por le servicio
     $this->data = array('api_version' => '', 'receiver_id' => '', 'notification_id' => '', 'subject' => '', 'amount' => '', 'currency' => '', 'transaction_id' => '', 'payer_email' => '', 'custom' => '', 'notification_signature' => '');
 }
 /**
  * Iniciamos el servicio
  */
 public function __construct($receiver_id, $secret)
 {
     parent::__construct($receiver_id, $secret);
     // Asignamos la url del servicio
     $this->apiUrl = Khipu::getUrlService('PaymentStatus');
     $this->data = array('payment_id' => '');
 }
 /**
  * Iniciamos el servicio
  */
 public function __construct($receiver_id, $secret)
 {
     parent::__construct($receiver_id, $secret);
     // Asignamos la url del servicio
     $this->apiUrl = Khipu::getUrlService('GetPaymentNotification');
     $this->data = array('notification_token' => '');
 }
 /**
  * Iniciamos el servicio
  */
 public function __construct($receiver_id, $secret)
 {
     parent::__construct($receiver_id, $secret);
     // Asignamos la url del servicio
     $this->apiUrl = Khipu::getUrlService('SetRejectedByPayer');
     $this->data = array('payment_id' => '', 'text' => '');
 }
 /**
  * Iniciamos el servicio
  */
 public function __construct($receiver_id, $secret)
 {
     parent::__construct($receiver_id, $secret);
     // Asignamos la url del servicio
     $this->apiUrl = Khipu::getUrlService('UpdatePaymentNotificationUrl');
     $this->data = array('url' => '', 'api_version' => '');
 }
 /**
  * Iniciamos el servicio
  */
 public function __construct($receiver_id, $secret)
 {
     parent::__construct($receiver_id, $secret);
     // Asignamos la url del servicio
     $this->apiUrl = Khipu::getUrlService('SetBillExpired');
     $this->data = array('bill_id' => '', 'text' => '');
 }
 /**
  * Iniciamos el servicio
  */
 public function __construct($receiver_id, $secret)
 {
     parent::__construct($receiver_id, $secret);
     // Iniciamos la variable apiUrl con la url del servicio.
     $this->apiUrl = Khipu::getUrlService('CreatePaymentURL');
     // Iniciamos el arreglo $data con los valores que requiere el servicio.
     $this->data = array('receiver_id' => $receiver_id, 'subject' => '', 'body' => '', 'amount' => 0, 'custom' => '', 'notify_url' => '', 'return_url' => '', 'cancel_url' => '', 'bank_id' => '', 'expires_date' => '', 'transaction_id' => '', 'picture_url' => '', 'payer_email' => '');
 }
 /**
  * Iniciamos el servicio identificando al cobrador.
  */
 function __construct($receiver_id, $secret)
 {
     parent::__construct($receiver_id, $secret);
     // Cargamos el objeto KhipuRecipientes para adjuntar destinatarios.
     $this->recipients = new KhipuRecipients();
     // Iniciamos la variable apiUrl con la url del servicio.
     $this->apiUrl = Khipu::getUrlService('CreateEmail');
     // Iniciamos el arreglo $data con los valores que requiere el servicio.
     $this->data = array('receiver_id' => $receiver_id, 'subject' => '', 'body' => '', 'transaction_id' => '', 'custom' => '', 'notify_url' => '', 'return_url' => '', 'cancel_url' => '', 'pay_directly' => 'true', 'send_emails' => 'true', 'expires_date' => '', 'picture_url' => '');
 }
 /**
  * Iniciamos el servicio
  */
 public function __construct($receiver_id, $secret)
 {
     parent::__construct($receiver_id, $secret);
     // Asignamos la url del servicio
     $this->apiUrl = Khipu::getUrlService('ReceiverBanks');
 }