wechatpay-apiv3/wechatpay-php

h5 wap example

nabeelzqadri opened this issue · 3 comments

@TheNorthMemory can you please share any example for h5 wap payment example.

@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.

参数名 变量 类型[长度限制] 必填 描述
商户端设备号 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