首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >codeigniter CI商家paypal

codeigniter CI商家paypal
EN

Stack Overflow用户
提问于 2014-05-17 00:01:53
回答 2查看 1.4K关注 0票数 0

我需要贝宝支付订单集成。我已经做的就是集成http://ci-merchant.org/接口。它工作起来就像它需要的那样..转到paypal网站,给我付款的选项,但在我按下支付按钮后,它只是重新定位到我的成功定义的页面,当然不付款。这是我为paypal编写的php代码:

代码语言:javascript
复制
$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;
            }

这里是打印屏幕,这里应该完成支付,但按下支付后,现在它只是去我的成功网站。

EN

回答 2

Stack Overflow用户

发布于 2014-05-17 11:22:25

听起来你并没有完成这个过程。快速结账的整个流程是...

  1. Call Checkout
  2. Redirect user to PayPal with token
  3. 用户查看并根据集成方式单击"Continue“或"Pay now”
  4. 用户将被发送回SEC
  5. Call GetExpressCheckoutDetails中提供的返回地址,以获取有关买家的详细信息(根据集成方法,这实际上是可选的)
  6. Call DoExpressCheckoutPayment以完成付款。

听起来你已经处理好了#1 -4,甚至可能是#5,但你错过了#6。在调用DECP之前,实际上不会发生任何事务。你一定是错过了那一段。

票数 2
EN

Stack Overflow用户

发布于 2014-05-17 13:13:40

找到解决方案与其他PayPal库和工程完美,这里是链接,如果其他人需要它https://github.com/jersonandyworks/Paypal-Library-by-RomyBlack

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23699787

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档