h5 wap example
nabeelzqadri opened this issue · 3 comments
nabeelzqadri commented
@TheNorthMemory can you please share any example for h5 wap payment example.
TheNorthMemory commented
@nabeelzqadri It was an IDE
helpers already there, named as iwechatpay/openapi. Most of the APIs were declared as normal PHP's codes. Eg:
APIv3:
->v3->pay->transactions->h5->post([
'json' => [
'appid' => 'wxd678efh567hg6787',
'mchid' => '1230000109',
'description' => 'Image形象店-深圳腾大-QQ公仔',
'attach' => '自定义数据',
'out_trade_no' => '1217752501201407033233368018',
'amount' => [
'total' => 100,
'currency' => 'CNY',
],
'time_expire' => '2018-06-08T10:34:56+08:00',
'notify_url' => 'https://www.weixin.qq.com/wxpay/pay.php',
'goods_tag' => 'WXG',
'detail' => [
'cost_price' => 608800,
'invoice_id' => '微信123',
'goods_detail' => [[
'merchant_goods_id' => '商品编码',
'wechatpay_goods_id' => '1001',
'goods_name' => 'iPhoneX 256G',
'quantity' => 1,
'unit_price' => 828800,
],],
],
'scene_info' => [
'payer_client_ip' => '14.23.150.211',
'device_id' => '013467007045764',
'store_info' => [
'id' => '0001',
'name' => '腾讯大厦分店',
'area_code' => '440305',
'address' => '广东省深圳市南山区科技中一道10000号',
],
'h5_info' => [
'type' => 'iOSAndroidWap',
'app_name' => '王者荣耀',
'app_url' => 'https://pay.qq.com',
'bundle_id' => 'com.tencent.wzryiOS',
'package_name' => 'com.tencent.tmgp.sgame',
],
],
]);
Because it was static, you may checking the official development documents for the optional parameters(may or may not). Hopes it can help you.
nabeelzqadri commented
Can you please let me know what will be the device id.
I am getting this error.
…On Wed, Dec 8, 2021, 5:45 PM James ZHANG ***@***.***> wrote:
@nabeelzqadri <https://github.com/nabeelzqadri> It was an IDE helpers
already there, named as iwechatpay/openapi
<https://packagist.org/packages/iwechatpay/openapi>. Most of the APIs
were declared as normal PHP's codes. Eg:
APIv3:
->v3->pay->transactions->h5->post([
'json' => [
'appid' => 'wxd678efh567hg6787',
'mchid' => '1230000109',
'description' => 'Image形象店-深圳腾大-QQ公仔',
'attach' => '自定义数据',
'out_trade_no' => '1217752501201407033233368018',
'amount' => [
'total' => 100,
'currency' => 'CNY',
],
'time_expire' => '2018-06-08T10:34:56+08:00',
'notify_url' => 'https://www.weixin.qq.com/wxpay/pay.php',
'goods_tag' => 'WXG',
'detail' => [
'cost_price' => 608800,
'invoice_id' => '微信123',
'goods_detail' => [[
'merchant_goods_id' => '商品编码',
'wechatpay_goods_id' => '1001',
'goods_name' => 'iPhoneX 256G',
'quantity' => 1,
'unit_price' => 828800,
],],
],
'scene_info' => [
'payer_client_ip' => '14.23.150.211',
'device_id' => '013467007045764',
'store_info' => [
'id' => '0001',
'name' => '腾讯大厦分店',
'area_code' => '440305',
'address' => '广东省深圳市南山区科技中一道10000号',
],
'h5_info' => [
'type' => 'iOSAndroidWap',
'app_name' => '王者荣耀',
'app_url' => 'https://pay.qq.com',
'bundle_id' => 'com.tencent.wzryiOS',
'package_name' => 'com.tencent.tmgp.sgame',
],
],
]);
Because it was static, you may checking the official development documents
for the optional parameters(may or may not). Hopes it can help you.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#73 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AL2XSDA3Q4JB46TE2PP2BA3UP5HOJANCNFSM5JTP65UA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
TheNorthMemory commented
参数名 | 变量 | 类型[长度限制] | 必填 | 描述 |
---|---|---|---|---|
商户端设备号 | device_id | string[1,32] | 否 | 商户端设备号(门店号或收银设备ID)。示例值:013467007045764 |
It's optional, it may ignored. For the international merchant, the endpoint
and data structure
may be different with the China mainland.
You may take a look at by this link
Name | Variable Name | Type | Required | Description |
---|---|---|---|---|
Merchant's device No. | device_id | string(32) | No | Terminal device No. (which is customized by the merchant, such as store No.)Example:013467007045764 |