コード例 #1
0
ファイル: Paypal.php プロジェクト: openbizx/openbizx-cubix
 public function GetPaymentURL($orderId, $amount, $title = null, $customData = null)
 {
     $config = $this->_getProviderInfo();
     if ($customData) {
         $customData = json_encode($customData);
     }
     $paypal = new paypal_class();
     $paypal->add_field("cmd", "_xclick");
     $paypal->add_field("business", $config['account']);
     $paypal->add_field("return", $this->returnURL);
     $paypal->add_field("cancel_return", $this->cancelURL);
     $paypal->add_field("quantity", 1);
     $paypal->add_field("amount", $amount);
     $paypal->add_field("item_name", $title);
     $paypal->add_field("item_number", $orderId);
     $paypal->add_field("undefined_quantity", 0);
     $paypal->add_field("no_shipping", 1);
     $paypal->add_field("no_note", 1);
     $paypal->add_field("rm", 2);
     $paypal->add_field("custom", $customData);
     $paypal->add_field("charset", 'utf-8');
     $paypal->add_field("currency_code", $this->currencyCode);
     $url = $paypal->build_param_url();
     return $url;
 }