【问题标题】:Paypal says look at the next page, before paying - but then it is directly payedPaypal 说先看下一页,然后再付款 - 但随后是直接付款
【发布时间】:2013-07-08 19:14:23
【问题描述】:

我们已将 ExpressCheckout 集成到我们的网站中。现在我们有一个问题,在登录贝宝后的一个页面上说(翻译):请查看此信息。在下一页您可以发送付款。但是,如果您单击下一步按钮,则没有下一页。付款是直接发送的。这里出了什么问题?

lg手动

【问题讨论】:

    标签: paypal checkout


    【解决方案1】:

    您可能无法将真实字段发送到贝宝,以下变量为 ;

    $item_name      = $product->model;
    $item_number        = $order['id'];
    $item_amount        = str_replace(',','.', format_number($calculate['total_price']));
    
    # than account information of paypal
    
    $paypal_inf = $paypal_->row();                      $paypal_email   = $paypal_inf->paypal_key;
    $paypal_value   = $paypal_inf->paypal_value;
    
    # Url information
    $return_url = base_url().'tr/odeme/adim_5/paypalsuccess';
    $cancel_url = base_url().'tr/odeme/adim_5/paypalfailed';
    $notify_url = base_url().'tr/odeme/adim_5/paypal';
    
    # Firstly Append paypal account to querystring
    $querystring = "?business=".urlencode($paypal_email)."&";
    
    # adding information of following variables at top as you can see
    $querystring .= "item_number=".urlencode($item_number)."&";
    $querystring .= "item_name=".urlencode($item_name)."&";
    $querystring .= "amount=".urlencode($item_amount)."&";
    
    # loop for posted values and append to querystring (as address,phone or more detailed informaation)
    
    foreach($_POST as $key => $value){
    $value = urlencode(stripslashes($value));
    $querystring .= "$key=$value&";
    }
    
    // Append paypal return addresses
    $querystring .= "return=".urlencode(stripslashes($return_url))."&";
    $querystring .= "cancel_return=".urlencode(stripslashes($cancel_url))."&";
    $querystring .= "notify_url=".urlencode($notify_url);
    
    # And
    
    redirect('https://www.paypal.com/cgi-bin/webscr'. $querystring, 'location', 301);
    

    在表单侧添加一些字段,以下行将收到该字段

    echo form_hidden('cmd','_xclick');
    echo form_hidden('no_note','1');
    echo form_hidden('lc','TR');
    echo form_hidden('currency_code',$exchange);
    echo form_hidden('bn','PP-BuyNowBF:btn_buynow_LG.gif:NonHostedGuest');
    

    如果您使用自动重定向,这将有所帮助(添加您在贝宝上创建的按钮 ID)

    echo form_hidden('cmd','_s-xclick');
    echo form_hidden('hosted_button_id',$paypal_button_id); // for ex. FK5RYJS6WRJVL
    

    希望对你有帮助

    【讨论】:

      【解决方案2】:

      抱歉没有完全理解你的意思?!或者问题出在哪里...我的查询看起来像...

      // Build URL with all infos
              $nvpstr = '&AMT=' . $amt .
                        '&ITEMAMT=' . $amt .
                        '&CURRENCYCODE=' . $this->currencyCode .
                        '&LOCALECODE=' . $user->land .
                        '&PAYMENTACTION=' . $this->paymentAction .
                        '&RETURNURL=' . $returnUrl .
                        '&CANCELURL=' . $cancelUrl .
                        '&DESC=' . $this->getDesc() .
                        '&SHIPTONAME=' . $user->vorname . ' ' . $user->nachname .
                        '&SHIPTOSTREET=' . $user->strasse .
                        '&SHIPTOCITY=' . $user->ort .
                        '&SHIPTOZIP=' . $user->plz .
                        '&L_NAME0=www.detailpool.com' .
                        '&L_AMT0=' . $amt .
                        '&NOSHIPPING=1' .
                        '&USERACTION=commit';
              //echo $nvpstr; die();
      
              $this->callerService = new CallerService($this->type, $this->test);
              $resArray = $this->callerService->hash_call("SetExpressCheckout", $nvpstr);
      
      
                  header('Location: https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=' . $resArray['TOKEN']);
              }
      

      然后

      /**
           * Wird nach der Rückkehr von Paypal aufgerufen
           */
          public function getCheckoutDetails($amt) {
              $this->writeLog("Paypal Status-Update started...", 1);
      
              $token = JRequest::getVar('token', 0);
              $this->group = JRequest::getInt('group', -1);
              $this->type = JRequest::getInt('type', -1);
              $amt = round($amt, 2);
      
              // Build URL with all infos
              $nvpstr = '&TOKEN=' . urlencode($token) .
                        '&NOSHIPPING=1' .
                        '&USERACTION=commit';
      
              $this->callerService = new CallerService($this->type, $this->test);
              $resArray = $this->callerService->hash_call("GetExpressCheckoutDetails", $nvpstr);
      
              $this->completeSale($resArray['TOKEN'], $resArray['PAYERID'], $amt);
          }
      
          /**
           * Nach der Abwicklung auf der Paypalseite wird eine weitere Aktion erforderlich,
           * um die Kaufabwicklung zu bestätigen...
           */
          private function completeSale($token, $payerID, $amt) {
              require_once(JPATH_ROOT.'/components/com_detailpool/libraries/Zahlung.php');
      
              // Build URL with all infos
              $nvpstr = '&TOKEN=' . urlencode($token) .
                        '&PAYERID=' . urlencode($payerID) .
                        '&PAYMENTACTION=' . $this->paymentAction .
                        '&AMT=' . $amt .
                        '&CURRENCYCODE=' . $this->currencyCode .
                        '&DESC=' . $this->getDesc();
      
              $resArray = $this->callerService->hash_call("DoExpressCheckoutPayment", $nvpstr);
      
              $this->writeLog('DoExpressCheckoutPayment Amt: ' . $amt . ' Group: ' . $this->group);
      
              // Prüfen, ob alles geklappt hat
              if ($resArray['PAYMENTSTATUS'] == 'Completed') {
                  return $this->paymentSuccess();
              }
              else {
                  $this->paymentFail();
              }
          }
      

      【讨论】:

        【解决方案3】:

        好的,问题解决了。 Paypal 重定向到商店网站,目的是让用户可以在商店网站上确认付款。不在贝宝上。 lg

        【讨论】:

          【解决方案4】:

          我没有看到查询有任何问题,但是尝试添加 urlencode() 为,

          $querystring .= "item_number=".urlencode($item_number)."&";
          

          而不是

           '&CURRENCYCODE=' . $this->currencyCode .
          

          【讨论】:

          • 对不起,这没有用,和以前一样的问题!还有其他想法吗?
          猜你喜欢
          • 1970-01-01
          • 2015-12-31
          • 2015-10-02
          • 2011-11-21
          • 2015-08-03
          • 2016-08-30
          • 2012-07-22
          • 2013-12-21
          • 1970-01-01
          相关资源
          最近更新 更多