【问题标题】:ACK not returned by Paypal DODIRECT Payment and payment done successfully in CODEIGNITERPaypal DODIRECT 未返回 ACK 付款和付款在 CODEIGNITER 中成功完成
【发布时间】:2013-03-02 10:27:50
【问题描述】:

获取错误: 遇到 PHP 错误

严重性:通知

消息:未定义索引:ACK

文件名:controllers/contest.php

行号:1191

有时会在沙盒帐户中成功转移错误和金额,但paypal没有返回响应数组,我的代码是

函数支付($array) { //$this->session->set_userdata('contestArr',$array); $DPFields = 数组( 'paymentaction' => 'Sale', // 你想如何获得付款。授权表明付款是基本身份验证,需要通过 Auth & Capture 进行结算。销售表明这是您要求付款的最终销售。默认为销售。 'ipaddress' => $_SERVER['REMOTE_ADDR'], // 必需。付款人浏览器的 IP 地址。 'returnfmfdetails' => '1' // 判断是否要 FMF 返回的结果的标志。 1 或 0。默认值为 0。 );

    $CCDetails = array(
                        'creditcardtype' => $array['cardtype'],                      // Required. Type of credit card.  Visa, MasterCard, Discover, Amex, Maestro, Solo.  If Maestro or Solo, the currency code must be GBP.  In addition, either start date or issue number must be specified.
                        'acct' => $array['cardno'],                        // Required.  Credit card number.  No spaces or punctuation.  
                        'expdate' => $array['ccmnth'].$array['ccyear'],                         // Required.  Credit card expiration date.  Format is MMYYYY
                        'cvv2' => $array['cvv'],                        // Requirements determined by your PayPal account settings.  Security digits for credit card.
                        'startdate' => '',                          // Month and year that Maestro or Solo card was issued.  MMYYYY
                        'issuenumber' => ''                         // Issue number of Maestro or Solo card.  Two numeric digits max.
                    );

    $PayerInfo = array(
                        'email' => 'surend_1296637287_per@contentshoppe.com',                               // Email address of payer.
                        'payerid' => '',                            // Unique PayPal customer ID for payer.
                        'payerstatus' => '',                        // Status of payer.  Values are verified or unverified
                        'business' => 'NeedAJingle'                             // Payer's business name.
                    );

    $PayerName = array(
                        'salutation' => '',                     // Payer's salutation.  20 char max.
                        'firstname' => $array['payer_fname'],                   // Payer's first name.  25 char max.
                        'middlename' => '',                         // Payer's middle name.  25 char max.
                        'lastname' => $array['payer_lname'],                            // Payer's last name.  25 char max.
                        'suffix' => ''                              // Payer's suffix.  12 char max.
                    );

    $BillingAddress = array(
                            'street' => '123 Test Ave.',                        // Required.  First street address.
                            'street2' => '',                        // Second street address.
                            'city' => 'Kansas City',                            // Required.  Name of City.
                            'state' => 'MO',                            // Required. Name of State or Province.
                            'countrycode' => 'US',                  // Required.  Country code.
                            'zip' => '64111',                           // Required.  Postal code of payer.
                            'phonenum' => '555-555-5555'                        // Phone Number of payer.  20 char max.
                        );

    $ShippingAddress = array(
                            'shiptoname' => '',                     // Required if shipping is included.  Person's name associated with this address.  32 char max.
                            'shiptostreet' => '',                   // Required if shipping is included.  First street address.  100 char max.
                            'shiptostreet2' => '',                  // Second street address.  100 char max.
                            'shiptocity' => '',                     // Required if shipping is included.  Name of city.  40 char max.
                            'shiptostate' => '',                    // Required if shipping is included.  Name of state or province.  40 char max.
                            'shiptozip' => '',                      // Required if shipping is included.  Postal code of shipping address.  20 char max.
                            'shiptocountry' => '',                  // Required if shipping is included.  Country code of shipping address.  2 char max.
                            'shiptophonenum' => ''                  // Phone number for shipping address.  20 char max.
                            );

    $PaymentDetails = array(
                            'amt' => round($array['gross_total'],2),                            // Required.  Total amount of order, including shipping, handling, and tax.  
                            'currencycode' => 'USD',                    // Required.  Three-letter currency code.  Default is USD.
                            'itemamt' => round($array['gross_total'],2),    // Required if you include itemized cart details. (L_AMTn, etc.)  Subtotal of items not including S&H, or tax.
                            'shippingamt' => '',                    // Total shipping costs for the order.  If you specify shippingamt, you must also specify itemamt.
                            'shipdiscamt' => '',                    // Shipping discount for the order, specified as a negative number.  
                            'handlingamt' => '',                    // Total handling costs for the order.  If you specify handlingamt, you must also specify itemamt.
                            'taxamt' => '',                         // Required if you specify itemized cart tax details. Sum of tax for all items on the order.  Total sales tax. 
                            'desc' => 'Add contest payment',                            // Description of the order the customer is purchasing.  127 char max.
                            'custom' => '',                         // Free-form field for your own use.  256 char max.
                            'invnum' => '',                         // Your own invoice or tracking number
                            'notifyurl' => ''                       // URL for receiving Instant Payment Notifications.  This overrides what your profile is set to use.
                        );  

    $OrderItems = array();
    $Item    = array(
                        'l_name' => substr($array['title'],0,100),                      // Item Name.127 char max.
                        'l_desc' => substr($array['headline'],0,100),                       // Item description.  127 char max.
                        'l_amt' => round($array['gross_total'],2),                          // Cost of individual item.
                        'l_number' => rand(2,2).'@-@'.rand(1,2),                        // Item Number.  127 char max.
                        'l_qty' => 1,                           // Item quantity.  Must be any positive integer.  
                        'l_taxamt' => '',                       // Item's sales tax amount.
                        'l_ebayitemnumber' => '',               // eBay auction number of item.
                        'l_ebayitemauctiontxnid' => '',         // eBay transaction ID of purchased item.
                        'l_ebayitemorderid' => ''               // eBay order ID for the item.
                );
    array_push($OrderItems, $Item);

    $Secure3D = array(
                      'authstatus3d' => '', 
                      'mpivendor3ds' => '', 
                      'cavv' => '', 
                      'eci3ds' => '', 
                      'xid' => ''
                      );

    $PayPalRequestData = array(
                            'DPFields' => $DPFields, 
                            'CCDetails' => $CCDetails, 
                            'PayerInfo' => $PayerInfo, 
                            'PayerName' => $PayerName, 
                            'BillingAddress' => $BillingAddress, 
                            'ShippingAddress' => $ShippingAddress, 
                            'PaymentDetails' => $PaymentDetails, 
                            'OrderItems' => $OrderItems, 
                            'Secure3D' => $Secure3D
                        );

    $PayPalResult = $this->paypal_pro->DoDirectPayment($PayPalRequestData);

    //print_r($PayPalResult);



    if(!$this->paypal_pro->APICallSuccessful($PayPalResult['ACK']))
    {
        $errors = array('Errors'=>$PayPalResult['ERRORS']);
        $this->template->load('template','paypal_error',$errors);
        exit;
    }
    else
    {
        $data = array('PayPalResult'=>$PayPalResult);


    }

}

【问题讨论】:

  • 看起来你正在使用我的CodeIgniter Library for PayPal。如果您想将您正在使用的文件发送给我,我会看看能否帮助您解决问题。
  • 您必须使用密钥Ack 而不是ACK 才能访问状态。示例:$PayPalResult['Ack']

标签: php mysql paypal payment


【解决方案1】:

您必须使用密钥 Ack 而不是 ACK 才能访问状态。

例如:$PayPalResult['Ack']

【讨论】:

    猜你喜欢
    • 2014-07-30
    • 2012-03-11
    • 2011-08-20
    • 2016-12-31
    • 2013-06-10
    • 2023-03-31
    • 2014-07-11
    • 2016-07-06
    • 2011-11-21
    相关资源
    最近更新 更多