发生错误: 遇到PHP错误
严重性:注意
消息:未定义的索引:ACK
文件名:controllers / contest.php
行号:1191
有时会在沙盒帐户中成功传输错误和金额,但PayPal并没有返回任何响应数组
功能支付($ array) { // $这 - >会话而> set_userdata( 'contestArr',$阵列); $ DPFields = array( 'paymentaction'=> '促销',//您希望如何获得付款。授权表明支付是一个基本的授权,与Auth& amp;捕获。销售表明这是您要求付款的最终销售。默认为销售。 '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);
}
}
答案 0 :(得分:0)
您必须使用密钥Ack
代替ACK
来访问状态。
示例:$PayPalResult['Ack']