Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Codeigniter-数字商品paypal库订阅响应为空_Php_Codeigniter_Paypal_Recurring Billing_Paypal Digital Goods - Fatal编程技术网

Php Codeigniter-数字商品paypal库订阅响应为空

Php Codeigniter-数字商品paypal库订阅响应为空,php,codeigniter,paypal,recurring-billing,paypal-digital-goods,Php,Codeigniter,Paypal,Recurring Billing,Paypal Digital Goods,我在一个订阅系统web上工作,我使用Paypal Digital Goods Classes(),并创建了一个名为paypal2的自定义库 if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Paypal2 { public function DatosPaypal($arreglo = array(), $produccion) { if (count($arreg

我在一个订阅系统web上工作,我使用Paypal Digital Goods Classes(),并创建了一个名为paypal2的自定义库

if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Paypal2
{
    public function DatosPaypal($arreglo = array(), $produccion)
    {
        if (count($arreglo)>0)
        {
            $idCliente      =   $arreglo['idcliente'];
            $descripcion    =   $arreglo['descripcion'];
            $precio         =   $arreglo['precio'];
            $pagado         =   $arreglo['pagado'];
            $cancelado      =   $arreglo['cancelado'];
            $notificar      =   $arreglo['notificar'];
            $moneda         =   $arreglo['moneda'];
            $usuario        =   $arreglo['usuario'];
            $clave          =   $arreglo['clave'];
            $llave          =   $arreglo['llave'];
            if (!class_exists('PayPal_Digital_Goods',false))
            {
                require_once APPPATH.'third_party/paypal/paypal-digital-goods.class.php';
                if ($produccion == true) {
                    PayPal_Digital_Goods_Configuration::environment( 'live' );
                }
                PayPal_Digital_Goods_Configuration::username( $usuario );
                PayPal_Digital_Goods_Configuration::password( $clave );
                PayPal_Digital_Goods_Configuration::signature( $llave );
                PayPal_Digital_Goods_Configuration::return_url( $pagado );
                PayPal_Digital_Goods_Configuration::cancel_url( $cancelado );
                PayPal_Digital_Goods_Configuration::notify_url( $notificar );
                PayPal_Digital_Goods_Configuration::currency( $moneda ); // 3 char character code, must be one of the values here: https://developer.paypal.com/docs/classic/api/currency_codes/
                if (!class_exists('PayPal_Subscription', false))
                {
                    require_once APPPATH.'third_party/paypal/paypal-subscription.class.php';
                    $subscription_details = array(
                        'description'        => $descripcion,
                        'initial_amount'     => $precio,
                        'amount'             => $precio,
                        'period'             => 'Month',
                        'frequency'          => '1',
                        'total_cycles'       => '0',
                        'user_id'            => $idCliente
                    );
                    $paypal_subscription = new PayPal_Subscription( $subscription_details );
                    $respuesta = $paypal_subscription;
                    return $respuesta;
                }
            }
        }
        else
        {
            return "ERROR";
        }
    }
}
这里是控制器的功能,使支付成为可能

function AjaxPagoSubscripcion($plan) //<-Works great
    {
        $this->load->library('paypal2');
        $this->load->model('Usuarios_model');
        $this->config->load('PayPal2');
        $arreglo = $this->Usuarios_model->DatosPagoSubscripcion($plan);
        $PaypalObject = $this->paypal2->DatosPaypal($arreglo, $this->config->config['PPproduction_mode']);
        $this->config->set_item('PayPalObject', $PaypalObject);
        $data['PayPal'] = $PaypalObject->print_buy_button();
        $this->load->view('usuarios/pruebas');
    }

    function pagos2() //<-Don't know how to get the paypal response or migrate Paypal object
    {
        $allvariables = get_defined_vars();
        $data["Variables"] = $allvariables;
        $this->load->view('paypal/pagado');
    }
这里是接受付款的控制器(其中erro触发明显:D)

公共功能pagado($plan)
{
$this->load->library('paypal2');
$this->load->model('Usuarios_model');
$this->config->load('PayPal2');
$arreglo=$this->Usuarios_model->datospagosubscription($plan);
//echo$arreglo->precio;
//回显“”,打印($arreglo),“”;退出();
$PaypalObject=$this->paypal2->datospaypaypal($arreglo,$this->config->config['PPproduction\u mode']);
$prueba=$PaypalObject->start_subscription();
回显“”,打印($prueba),“”;退出();
//$data['PayPal']=$prueba;
//$data['main_content']='paypal/pagado';
//$this->load->view('includes/'。$this->config->config[“tema”]./template',$data);
}

我最终做到了,使用视图中的代码,不是如何完成,而是最终完成了

使用它,最终完成了一些进展,但我现在得到了这个错误:配置文件描述无效
( ! ) Fatal error: Uncaught exception 'Exception' with message 'Calling PayPal with action CreateRecurringPaymentsProfile has Failed: Profile description is invalid' in G:\wamp\www\serviciosycomprasx\application\third_party\paypal\paypal-digital-goods.class.php on line 224
( ! ) Exception: Calling PayPal with action CreateRecurringPaymentsProfile has Failed: Profile description is invalid in G:\wamp\www\serviciosycomprasx\application\third_party\paypal\paypal-digital-goods.class.php on line 224
public function  pagado($plan)
    {
        $this->load->library('paypal2');
        $this->load->model('Usuarios_model');
        $this->config->load('PayPal2');
        $arreglo = $this->Usuarios_model->DatosPagoSubscripcion($plan);
        //echo $arreglo->precio;
        //echo "<pre>",print_r($arreglo),"</pre>"; exit();
        $PaypalObject = $this->paypal2->DatosPaypal($arreglo, $this->config->config['PPproduction_mode']);
        $prueba = $PaypalObject->start_subscription();
        echo "<pre>",print_r($prueba),"</pre>"; exit();
        //$data['PayPal'] = $prueba;
        //$data['main_content'] = 'paypal/pagado';
        //$this->load->view('includes/'.$this->config->config["tema"].'/template' , $data);
    }