簡體   English   中英

Codeigniter CI商戶貝寶

[英]codeigniter CI merchant paypal

我需要Paypal集成才能支付訂單。 我已經做的是集成api http://ci-merchant.org/ 它的工作原理如需要。轉到Paypal網站,給我付款的選項,但是在我按“付款”按鈕后,它只是重新定位到我成功的已定義頁面,而offcourse則不付款。 這是我的Paypal php代碼:

$this->load->library('merchant');
        $this->merchant->load('paypal_express');
        $settings = $this->merchant->default_settings();

        $settings = array(
            'username' => '*',
            'password' => '*',
            'signature' => '*',
            'test_mode' => false,
            'solution_type' => array('type' => 'select', 'default' => 'Sole', 'options' => array(
            'Sole' => 'merchant_solution_type_sole',
            'Mark' => 'merchant_solution_type_mark')),
            'landing_page' => array('type' => 'select', 'default' => 'Billing', 'options' => array(
            'Billing'   => 'merchant_landing_page_billing',
            'Login'     => 'merchant_landing_page_login')));

        $this->merchant->initialize($settings);

        if(isset($_POST['pay'])){
            $params = array(
            'amount' => '0.20',
            'currency' => 'USD',
            'return_url' => 'pay/succesfull',
            'cancel_url' => 'pay/cancel');
            $response = $this->merchant->purchase($params);

            if ($response->success()){
                echo "paid sucesfuly";
            }
            else
            {
                $message = $response->message();
                echo('Error processing payment: ' . $message);
                exit;
            }

這是應該完成付款的打印屏幕,但是現在按“付款”后,它會轉到我成功的網站。 在此處輸入圖片說明

聽起來您尚未完成該過程。 Express Checkout的整個流程是...

  1. 致電SetExpress Checkout
  2. 使用令牌將用戶重定向到PayPal
  3. 用戶查看並單擊“繼續”或“立即付款”,具體取決於集成方式
  4. 將用戶發送回SEC中提供的返回URL
  5. 調用GetExpressCheckoutDetails以獲取有關購買者的詳細信息(根據集成方法,這實際上是可選的)
  6. 致電DoExpressCheckoutPayment以完成付款。

聽起來您已經得到了#1-4的照顧,甚至還有#5,但您卻錯過了#6。 在調用DECP之前,實際上沒有任何事務發生。 您一定想念那塊。

查找其他PayPal庫的解決方案並正常運行,如果有人需要它,這里是鏈接https://github.com/jersonandyworks/Paypal-Library-by-RomyBlack

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM