回复内容:下了官方的sdk后,我是实用native.php里面的方法返回url还是用native_notify.php里面的方法返回url,不知道该怎么往下走了,求大神赐教
native.php
打开看一下,你就知道
通过 code_url 生成二维码,微信一扫就出现支付页面了
//模式一 /** * 流程: * 1、组装包含支付信息的url,生成二维码 * 2、用户扫描二维码,进行支付 * 3、确定支付之后,微信服务器会回调预先配置的回调地址,在【微信开放平台-微信支付-支付配置】中进行配置 * 4、在接到回调通知之后,用户进行统一下单支付,并返回支付信息以完成支付(见:native_notify.php) * 5、支付完成之后,微信服务器会通知支付成功 * 6、在支付成功通知中需要查单确认是否真正支付成功(见:notify.php) */ $notify = new nativepay(); $url1 = $notify->getprepayurl(123456789); //模式二 /** * 流程: * 1、调用统一下单,取得code_url,生成二维码 * 2、用户扫描二维码,进行支付 * 3、支付完成之后,微信服务器会通知支付成功 * 4、在支付成功通知中需要查单确认是否真正支付成功(见:notify.php) */ $input = new wxpayunifiedorder(); $input->setbody(test); $input->setattach(test); $input->setout_trade_no(wxpayconfig::mchid.date(ymdhis)); $input->settotal_fee(1); $input->settime_start(date(ymdhis)); $input->settime_expire(date(ymdhis, time() + 600)); $input->setgoods_tag(test); $input->setnotify_url(http://paysdk.weixin.qq.com/example/notify.php); $input->settrade_type(native); $input->setproduct_id(123456789); $result = $notify->getpayurl($input); $url2 = $result[code_url];
以上就是关于php给ios提供模式二的微信扫码支付的内容。
