* ================
 * PaypalExpress System Form
 * ================
 * 
 * */
$order = $this->item->order;
$merchantPayment = $this->item->merchantPayment;
$debugmode = false;
$SandboxMode = $merchantPayment->SandboxMode;
$donation = false;
$paymentData = $merchantPayment->Data;
$uri = JURI::getInstance();
$urlBase = $uri->toString(array('scheme', 'host', 'port'));
$urlBack = $urlBase . JRoute::_('index.php?view=payment&actionmode=cancel&payedOrderId=' . $order->OrderId);
$url = $urlBase . JRoute::_('index.php?view=payment&actionmode=paypalexpress&payedOrderId=' . $order->OrderId);
$urlBack = $url;
$suffixOrder = "";
if (isset($this->item->paymentCount)) {
    $suffixOrder = (string) ($this->item->paymentCount + 1);
    $overrideAmount = $this->item->overrideAmount;
}
if ($this->actionmode == 'donation') {
    $donation = true;
}
$paypalExpress = new paypalExpress($merchantPayment->Data, $order, $this->language, $urlBack, $url, $SandboxMode, $donation);
echo $paypalExpress->getUrl();
?>



Exemple #2
0
function payment_PaypalExpress($order, $merchantPayment, $actionmode = "")
{
    global $base_url;
    $debugmode = true;
    $SandboxMode = $merchantPayment->SandboxMode;
    //$SandboxMode  = false;
    $donation = false;
    $paymentData = $merchantPayment->Data;
    $url = get_site_url() . '/payment/?actionmode=paypalexpress&payedOrderId=' . $order->OrderId;
    $urlBack = get_site_url() . '/payment/?actionmode=cancel&payedOrderId=' . $order->OrderId;
    //$urlBack = $url;
    $suffixOrder = "";
    if ($actionmode == 'donation') {
        $donation = true;
    }
    $paypalExpress = new paypalExpress($merchantPayment->Data, $order, $GLOBALS['bfi_lang'], $urlBack, $url, $SandboxMode, $donation);
    return $paypalExpress->getUrl();
}