简体   繁体   English

Codeigniter CI商户贝宝

[英]codeigniter CI merchant paypal

I need paypal integration for paying order. 我需要Paypal集成才能支付订单。 What I already do is to integrate api http://ci-merchant.org/ . 我已经做的是集成api http://ci-merchant.org/ It works like it needs to.. go to paypal website, give me option to pay but after i press pay button it just relocate to my sucess definded page and offcourse doesnt make payment. 它的工作原理如需要。转到Paypal网站,给我付款的选项,但是在我按“付款”按钮后,它只是重新定位到我成功的已定义页面,而offcourse则不付款。 Here is my php code for paypal: 这是我的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;
            }

Here is print screen where should paying be completed, but after pressing Pay now it just goes to my sucessfull website. 这是应该完成付款的打印屏幕,但是现在按“付款”后,它会转到我成功的网站。 在此处输入图片说明

It sounds like you're not completing the process. 听起来您尚未完成该过程。 The entire flow of Express Checkout is... Express Checkout的整个流程是...

  1. Call SetExpress Checkout 致电SetExpress Checkout
  2. Redirect user to PayPal with token 使用令牌将用户重定向到PayPal
  3. User reviews and clicks "Continue" or "Pay now" depending on integration method 用户查看并单击“继续”或“立即付款”,具体取决于集成方式
  4. User is sent back to the Return URL provided in SEC 将用户发送回SEC中提供的返回URL
  5. Call GetExpressCheckoutDetails to obtain details about the buyer (this is actually optional based on integration method) 调用GetExpressCheckoutDetails以获取有关购买者的详细信息(根据集成方法,这实际上是可选的)
  6. Call DoExpressCheckoutPayment to finalize the payment. 致电DoExpressCheckoutPayment以完成付款。

Sounds like you've got #1 - 4 taken care of, and maybe even #5, but you're missing #6. 听起来您已经得到了#1-4的照顾,甚至还有#5,但您却错过了#6。 Until DECP is called, no transaction actually takes place. 在调用DECP之前,实际上没有任何事务发生。 You must be missing that piece. 您一定想念那块。

查找其他PayPal库的解决方案并正常运行,如果有人需要它,这里是链接https://github.com/jersonandyworks/Paypal-Library-by-RomyBlack

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM