The example of this article tells the Zen Cart implementation order to increase the number of PayPal reservation telephone method. Share to everyone for your reference, specific as follows:
In the IPN return value of the PayPal call is Contact_phone, the premise is that your account set up the buyer in the payment reservation telephone, if not required, the value defaults will not return.
But in the Zen Cart PayPal payment plug-in is not to obtain this information, need to manually modify the PayPal program. Here we will modify:
One, in the PayPal table to add Contact_phone field
ALTER TABLE ' paypal ' ADD ' contact_phone ' VARCHAR NULL COMMENT ' phone '
Ii. Modifying the Ipn_create_order_array function in paypal_functions.php file
This file is in the./includes/modules/payment/paypal Directory
Add
' contact_phone ' => $_post[' Contact_phone '],
After the modification as follows
/** * Create order record from IPN data */function Ipn_create_order_array ($new _order_id, $txn _type) {$sql _data_arr ay = Array (' order_id ' => $new _order_id, ' Txn_type ' => $txn _type, ' module_name ' => ' PayPal (Ipn-handler) ', ' Module_mode ' => ' IPN ', ' reason_code ' => $_post[' reason_code '], ' payment_type ' => $_post[' Payme
Nt_type '], ' payment_status ' => $_post[' payment_status ', ' Pending_reason ' => $_post[' Pending_reason '], ' Invoice ' => $_post[' invoice ', ' mc_currency ' => $_post[' mc_currency '], ' first_name ' => $_post['
_name '], ' last_name ' => $_post[' last_name ', ' payer_business_name ' => $_post[' payer_business_name '], ' Contact_phone ' => $_post[' contact_phone ', ' address_name ' => $_post[' address_name '], ' Address_street ' =&G T $_post[' Address_street ', ' address_city ' => $_post[' address_city '], ' address_state ' => $_POST[' Address_sta Te '], ' address_zIP ' => $_post[' address_zip ', ' address_country ' => $_post[' address_country '], ' address_status ' => $_POS t[' Address_status ', ' payer_email ' => $_post[' payer_email '], ' payer_id ' => $_post[' payer_id ', ' payer _status ' => $_post[' payer_status ', ' payment_date ' => datetime_to_sql_format ($_post[' payment_date ']), ' bus Iness ' => $_post[' business ', ' receiver_email ' => $_post[' receiver_email '], ' receiver_id ' => $_post[' re ceiver_id '], ' txn_id ' => $_post[' txn_id ', ' parent_txn_id ' => $_post[' parent_txn_id ', ' Num_cart_item S ' => $_post[' num_cart_items ', ' Mc_gross ' => $_post[' Mc_gross '], ' mc_fee ' => $_post[' mc_fee '], ' s Ettle_amount ' => $_post[' settle_amount ', ' settle_currency ' => $_post[' settle_currency '], ' exchange_rate ' => $_post[' exchange_rate ', ' notify_version ' => $_post[' notify_version '], ' verify_sign ' => $_POST[' Veri Fy_sign '], ' date_adDed ' => ' Now () ', ' Memo ' => $_post[' Memo ']);
return $sql _data_array;
}
Third, in order to be in the background management of the order content can see contact_phone need to modify paypal_admin_notification.php file
This file is in the./includes/modules/payment/paypal Directory
Add the following:
$output. = ' <tr><td class= ' main ' >contact phone:</td> ';
$output. = ' <td class= ' main ' > '. $IPN->fields[' contact_phone '. ' </td></tr> ';
More interested readers of the Zend framework have access to this site: The Zend framework Introduction tutorial, thinkphp Getting Started tutorial, thinkphp Common methods Summary, Smarty Template Basics Tutorial and A summary of PHP template technology.
I hope this article will help you with the PHP program design based on Zend Framework.