在Codeigniter中缺少PayPal_Adaptive的参数1

时间:2017-06-22 18:16:38

标签: php codeigniter paypal

我正在使用Angell EYE PayPal自适应付款CodeIgniter库。它给我一个库paypal_adaptive错误

Missing argument 1 for PayPal_Adaptive::__construct()

Undefined variable: DataArray

我在配置文件详细信息中添加了所有数据

        $config['Sandbox'] = TRUE;
    $config['APIVersion'] = '123.0';
    $config['APIUsername'] = $config['Sandbox'] ? 'paypaltest-facilitator_api1.gmail.com' : 'PRODUCTION_USERNAME_GOES_HERE';
    $config['APIPassword'] = $config['Sandbox'] ? 'JRGZPXDNRRL6LJNQE' : 'PRODUCTION_PASSWORD_GOES_HERE';
    $config['APISignature'] = $config['Sandbox'] ? 'AFcWxV21C7fd0v3bYYYRCpSSRl31A7uQi7GAsii.0uB9g5iAxqvN9Fzm' : 'PRODUCTION_SIGNATURE_GOES_HERE';
    $config['PayFlowUsername'] = $config['Sandbox'] ? 'SANDBOX_USERNAME_GOES_HERE' : 'PRODUCTION_USERNAME_GOGES_HERE';
    $config['PayFlowPassword'] = $config['Sandbox'] ? 'SANDBOX_PASSWORD_GOES_HERE' : 'PRODUCTION_PASSWORD_GOES_HERE';
    $config['PayFlowVendor'] = $config['Sandbox'] ? 'SANDBOX_VENDOR_GOES_HERE' : 'PRODUCTION_VENDOR_GOES_HERE';
    $config['PayFlowPartner'] = $config['Sandbox'] ? 'SANDBOX_PARTNER_GOES_HERE' : 'PRODUCTION_PARTNER_GOES_HERE';

    $config['ApplicationID'] = $config['Sandbox'] ? 'APP-80W284485P519543T' : 'PRODUCTION_APP_ID_GOES_HERE';
    $config['DeveloperEmailAccount'] = 'paypaltest-facilitator@gmail.com';

现在下面是我的库启动代码,它给出了关于DataArray的错误我不知道这个变量来自哪个不是写在任何文件中......

    class PayPal_Adaptive extends PayPal_Pro
{
    var $DeveloperAccountEmail = '';
    var $XMLNamespace = '';
    var $ApplicationID = '';
    var $IPAddress = '';
    var $DetailLevel = '';
    var $ErrorLanguage = '';

    function __construct($DataArray)
    {
        parent::__construct($DataArray);
        $this->XMLNamespace = 'http://svcs.paypal.com/types/ap';
        $this->IPAddress = isset($DataArray['IPAddress']) ? $DataArray['IPAddress'] : $_SERVER['REMOTE_ADDR'];
        $this->DetailLevel = isset($DataArray['DetailLevel']) ? $DataArray['DetailLevel'] : 'ReturnAll';
        $this->ErrorLanguage = isset($DataArray['ErrorLanguage']) ? $DataArray['ErrorLanguage'] : 'en_US';
        $this->APISubject = isset($DataArray['APISubject']) ? $DataArray['APISubject'] : '';
        $this->DeveloperAccountEmail = isset($DataArray['DeveloperAccountEmail']) ? $DataArray['DeveloperAccountEmail'] : '';
        exit;

我的控制器代码在

之下
        class Adaptive_payments extends CI_Controller 
    {
        function __construct()
        {
            parent::__construct();

            // Load helpers
            $this->load->helper('url');

            // Load PayPal library
            $this->config->load('paypal');

            $this->load->library('paypal/Paypal_adaptive');
            $this->load->library('paypal/Paypal_payflow');
            $this->load->library('paypal/Paypal_pro');

            $config = array(
                'Sandbox' => $this->config->item('Sandbox'),            // Sandbox / testing mode option.
                'APIUsername' => $this->config->item('APIUsername'),    // PayPal API username of the API caller
                'APIPassword' => $this->config->item('APIPassword'),    // PayPal API password of the API caller
                'APISignature' => $this->config->item('APISignature'),  // PayPal API signature of the API caller
                'APISubject' => '',                                     // PayPal API subject (email address of 3rd party user that has granted API permission for your app)
                'APIVersion' => $this->config->item('APIVersion'),      // API version you'd like to use for your call.  You can set a default version in the class and leave this blank if you want.
                'ApplicationID' => $this->config->item('ApplicationID'), 
                'DeveloperEmailAccount' => $this->config->item('DeveloperEmailAccount')
            );

            if($config['Sandbox'])
            {
                error_reporting(E_ALL);
                ini_set('display_errors', '1'); 
            }

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


        function index()
        {
            $this->load->view('paypal/samples/adaptive_payments');
        }

告诉我如何解决这个问题...

0 个答案:

没有答案