Ejemplo n.º 1
0
 public function getRedirectParams($description = null)
 {
     $transaction = $this->getTransaction();
     // NOOOO.. THE UGLY HACKING
     $return = Config::get('site_root') . 'presale/transaction:complete';
     $method = $transaction->shipment_method;
     if ($method == 'presale-remainder') {
         $return = Config::get('site_root') . 'presale/transaction:confirm_complete';
     }
     return array('cmd' => '_xclick', 'business' => Config::get('shopPaypalAccount'), 'notify_url' => Config::get('site_root') . $this->returnRoute . 'paypal' . $this->getMethod() . '.html', 'bn' => Config::get('ident') . '_BuyNow_WPS_' . strtoupper(Lang::getInstance()->getShortLang()), 'amount' => $transaction->payment_amount, 'item_name' => issetor($description, Config::get('sitename') . ': ' . String::makePlural($transaction->shipment_itemsqty, 'item')), 'quantity' => 1, 'address_ override' => 1, 'address1' => $transaction->shipment_address, 'zip' => $transaction->shipment_zipcode, 'city' => $transaction->shipment_city, 'state' => $transaction->shipment_region, 'country' => $transaction->shipment_country, 'email' => $transaction->email, 'first_name' => $transaction->name, 'currency_code' => Config::get('currencyCode'), 'custom' => $transaction->secret, 'no_shipping' => 1, 'no_note' => 1, 'return' => $return, 'rm' => 1);
 }
Ejemplo n.º 2
0
 public function getRedirectUrl($description = null)
 {
     $transaction = $this->getTransaction();
     $mollie = new Client();
     $mollie->setApiKey($this->getApiKey());
     $order_id = $transaction->secret;
     $data = array("amount" => $transaction->payment_amount, "description" => isset($description) ? $description : Config::get('sitename') . ': ' . String::makePlural($transaction->shipment_itemsqty, 'item'), "redirectUrl" => Config::get('site_root') . $this->returnRoute . 'mollie_' . $this->getMethod() . '.html?order_id=' . $order_id, "method" => $this->getMethod(), "metadata" => array("order_id" => $order_id));
     $payment = $mollie->payments->create($data);
     // save details
     $transaction->payment_providerid = $payment->id;
     $transaction->save();
     $url = $payment->getPaymentUrl();
     return $this->ping($url) ? $url : false;
 }
Ejemplo n.º 3
0
 public function getRedirectUrl($description = null)
 {
     $transaction = $this->getTransaction();
     $request = array("type" => "transaction", "transactionreq" => array("username" => Config::get('shopWedealUsername'), "password" => Config::get('shopWedealPassword'), "reference" => $transaction->secret, "description" => Config::get('ident') . ': ' . String::makePlural($transaction->shipment_itemsqty, 'item'), "amount" => str_replace(".", ",", (string) $transaction->payment_amount), "methodcode" => "0101", "maxcount" => "1", "test" => $this->isSandbox() ? "true" : "false", "successurl" => Config::get('site_root') . 'shop/transaction:callback/wedeal.html', "failurl" => Config::get('site_root') . 'shop/transaction:callback/wedeal.html'));
     $res = $this->sendRequest($request, true);
     if ($res['success'] === true) {
         $url = $res['response'];
         if (substr($url, 0, 7) === 'http://' || substr($url, 0, 8) === 'https://') {
             return $this->ping($url) ? $res['response'] : false;
         } else {
             Log::log("Wedeal::getRedirectUrl() returned no URL but: " . $res['response']);
             return false;
         }
     } else {
         Log::log("Wedeal::getRedirectUrl() returned no URL but: " . $res['response']);
         return false;
     }
 }