如何使用api在codeigniter中实现paypal定期付款

时间:2016-07-08 14:03:52

标签: codeigniter paypal recurring-billing

我是codeigniter的新手。我想用api实现paypal定期付款。这怎么可能 ? anybodody能详细告诉我还是一步一步?

1 个答案:

答案 0 :(得分:0)

首先,您需要下载paypal库,然后创建您的帐户 在您的控制器中使用它

        $config['business']             = 'username@domain.com';
        $config['cpp_header_image']     = ''; //Image header url [750 pixels wide by 90 pixels high]
        $config['return']               = 'sucess.php';
        $config['cancel_return']        = 'shopping.php';
        $config['notify_url']           = 'process_payment.php'; //IPN Post
        $config['production']           = TRUE; //Its false by default and will use sandbox
        //$config['discount_rate_cart']     = 20; //This means 20% discount
        $config["invoice"]              = 'xxxxxx'; //The invoice id
        $config["currency_code"]        = 'EUA';
        $config["cpp_cart_border_color"]= '7D88B6 ';

        $this->load->library('paypal',$config);

        #$this->paypal->add(<name>,<price>,<quantity>[Default 1],<code>[Optional]);

        $this->paypal->add('T-shirt',2.99,6); //First item
        $this->paypal->add('Pants',40);       //Second item
        $this->paypal->add('Blowse',10,10,'B-199-26'); //Third item with code

        $this->paypal->pay(); //Proccess the payment