WordPress Integrated Alipay

How to integrate in the WordPress program Alipay is to achieve WordPress e-commerce must break through a bottleneck. WordPress has a lot of e-commerce class plugins, like the more famous WP e-Commerce and so on. But the only drawback of these plug-ins is not enough localized, do not support Alipay. Perhaps because WordPress Alipay integrated business application value is relatively high, few people are willing to share the relevant experience free of charge. There are generally WP master are relatively low-key, busy to make money to go. In the online collection of relevant information I have nothing, in addition to that was reprinted hundreds of times I do not know who wrote the so-called tutorial. Here is not to link, because it is not clear who is already original. First explain: This operation requires you to be familiar with the wordpress template and understand the WordPress custom domain related knowledge, understand a little HTML and CSS. Nonsense does not say, the following is a detailed step.
1, first of all if you want to pay a business contract, and apply for a secured transaction or immediately to the transaction, (I apply for immediate arrival) to apply for a general audit period, but Alipay staff efficiency is still very high.
2, after the application you will get an Alipay security check code (key) and a partner identity (Partner ID). This is the official help (graphic). These two numbers are very important, the following will be used.
3, landing Alipay account business service page download integrated technical documents. Or you can go to Alipay Forum download. (Note: download php + utf8).
4, followed by the parameter configuration, you only need to modify the alipay_config.php this file can be.
// partner ID, 16-bit pure number beginning with 2088
$ partner = “”;
// security check code, 32-bit characters consisting of numbers and letters
$ key = “”;
/ / Signed Alipay account or seller Alipay account
$ seller_email = “”;
/ / Transaction process server to notify the page to use http: // format full path, not allowed to add id = 123 such custom parameters
$ notify_url = “http: //www.yourdomain/alipay/notify_url.php”;
/ / Pay the page after the trip to use http: // format full path, not allowed to add id = 123 such a custom parameter
$ return_url = “http: //www.yourdomain/alipay/return_url.php”;
/ / Site products display address, not allowed to add id = 123 such a custom parameter
$ show_url = “”;
// Name of recipient, eg company name, website name, payee name, etc.
$ mainname = “”;
5, will modify the file upload to your site’s root directory, be careful not to change the original directory structure and file name. Quick payment entry template file (index.php), picture, CSS style folder (images) without upload. These two files can be integrated into your wordpress theme. For example I was at http://www.mydomain.com / alipay
6, in fact, where the Long March has been the first step, and then the treasure will be integrated into your theme in the desired location. Such as a single article page (single.php). Integration of the overall idea is to use WordPress custom domain, the value through the form hidden domain or URL parameters with POST way to pass to the interface, and assigned to the interface form to achieve. Here are three very important parameters: product name, description of goods and commodity prices.
Note: form a name is to pay the official file provided by the official treasure naming, generally do not change. If you have a high level of exception.
7, the following is a specific example of code, I integrated it into a single log file. Of course, your WP theme is best designed to change the door of the product page template, rather than the article page common to a template.
<div class = “alipay”>
<FORM name = alipayment action = / wordpress / alipay / alipayto.php method = post target = “_ blank”>
<INPUT type = “hidden” size = 30 name = aliorder value = “<? Php echo get_post_meta ($ post-> ID,” P_name “, true);?>” Maxlength = “200”
<INPUT type = “hidden” maxLength = 10 size = 30 name = alimoney value = “<? Php echo get_post_meta ($ post-> ID,” P_price “, true);?>”
<input type = “hidden” name = alibody value = “<? php echo get_post_meta ($ post-> ID,” P_description “, true);?>”>
<input type = “hidden” name = “pay_bank” value = “directPay”>
<input type = “submit” class = “btn” value = “buy” />
</ FORM>
</ div>
8, here in fact Alipay function has been used. Add a new article, add the appropriate custom field, and then publish. See if you can buy online already? The next step is to beautify the work, if you are proficient in CSS, proficient in HTML form design, proficient in JQURY, you can make payment more beautiful and more secure.
9, if you still have the energy, you can consider the integration of Alipay into plug-ins, improve the relevant configuration options to achieve WordPress background order query and tracking. This is achievable, WordPress has the potential to create a more than ECSHOP or SHOPEX also want to play online shop, and in the search engine optimization performance will be better than the latter two.