Hi,
I have made a wechat payment plug-in based on official demo document, it includes 2 payment type, JSAPI and NATIVE.
The payment type, JSAPI, that can only be used inner wechat app.
And the type of Native (Scan a QR with wehcat app) can be used when a customer complete payment on PC.
You can test the demo of payment if you have installed wechat app on your mobile phone.
paysdk.weixin.qq.com
For JSAPI payment, you must open the link on wechat app with the MicroMessenger browser.
Now, it still have some issues when I tested it.
Native payment can be done successfully, but callback notification can not run correctly.
JSAPI payment can not run correctly, it can only obtain a redirect code, can not obtain the user's openID and submit the order data to WeChat server for unified order operation (see
admin.wechat.com/wiki/index.php?title=User_Profile_via_Web
).
OpenID is only needed for JSAPI payment but not for Native payment.
Callback notification process is the same for them.
When I test on PC with the NATIVE payment, I will not see a QR code to complete payment.
Because the function of GetPayUrl can't get parameter value of AppID and Key, unless use hard code in lib files.
I think that if wechat pay functions are written into the same class (plgHikashoppaymentWechatpay), it may be simple and running correctly.
But, maybe it's better to use the official demo libs.
So, can anyone give me some ideas?
I hope it's helpful to develop this plugin and add a new payment method for Hikashop, which is the best E-Commerce component with Joomla.
Here is the wechat official website (EN)
pay.weixin.qq.com/wechatpay_guide/help_docs.shtml
Attachment is my FULL wechat payment plug-in files.
This attachment is hidden for guests.
Please log in or register to see it.