コード例 #1
0
 private function makeRequisition()
 {
     require_once VENDOR_PATH . 'PagSeguro/PagSeguroLibrary.php';
     $payment = new \PagSeguroPaymentRequest();
     $payment->setCurrency('BRL');
     $payment->addItem('0001', $this->productName, $this->productQuantity, $this->productPrice);
     $payment->setReference($this->pid);
     $payment->setShippingType(3);
     $payment->setsender($this->clientName, $this->clientMail, $this->clientAreaCode, $this->clientPhone);
     $payment->setRedirectUrl($this->redirectUrl);
     $credentials = \PagSeguroConfig::getAccountCredentials();
     if (defined('ALLOW_PAYMENT_REQUEST') and ALLOW_PAYMENT_REQUEST === true) {
         $this->paymentUrl = $payment->register($credentials);
     } else {
         $this->paymentUrl = '/loja/checkout/pid/' . $this->pid . '/continue/ok/';
     }
 }