|
- /**
- * 1,支付网关请找业务员索取,格式如:https://www.abc.com/api/order/create
- *
- * 2,支付提交示例数据如下(params),皆为必填项,其中secret_key和client_id(签名时使用,不直接提交)请找业务员或在商户后台获取
- *
- * 3,参数说明:
- * oid:商户订单号
- * total:订单总额,保留两位小数(无则补0)
- * products->attribute表示产品属性,若有多个属性以";"隔开,无的话请留空,不要用null
- * 其它参照字面意思应该能懂
- *
- * 4,签名方式(以php为例):
- * $hash = hash('sha256', $secret_key . $params['info']['email'] . $params['info']['currency'] . $params['info']['total'] . $params['info']['country']);
- * $sign = md5($hash . $client_id);
- *
- * 5,以curl post方式提交
- *
- * 6,返回说明(参考return_data数据):
- * code为1表示提交成功,data为支付跳转url,请获取后自行跳转
- * code为0表示提交失败,info为失败信息提示
- *
- * 7,异步通知:
- * 实际支付结果请以异步通知为准,收到通知请返回"ok"
- * 以post方式通知到notify_url(参考notify_data)
- * orderId:商户订单号
- * status:0=>'待支付',1=>'成功',2=>'失败'
- * 验签方式(以php为例):
- * $sign=md5($secret_key .$orderId . $client_id);
- *
- * 8,同步返回,直接返回到提交的return_url,请自行做好引导页面(如显示订单处理中)
- */
- params = {
- "billing": {
- "firstname": "jack",
- "lastname": "ma",
- "address1": "addr1 test",
- "address2": "addr2 test",
- "city": "new york",
- "state": "NY",
- "zip": "12345",
- "country": "US",
- "phone": "13900001111"
- },
- "delivery": {
- "firstname": "jack",
- "lastname": "ma",
- "address1": "addr1 test",
- "address2": "addr2 test",
- "city": "new york",
- "state": "NY",
- "zip": "12345",
- "country": "US",
- "phone": "13900001111"
- },
- "products": [
- {
- "name": "test product",
- "image": "http:\/\/www.wpc.com\/wp-content\/uploads\/2022\/10\/1525189943-38523.png",
- "attribute": "bule;42",
- "qty": "1",
- "price": "80.00",
- "link": "http:\/\/www.wpc.com\/?product=test-product",
- },
- {
- "name": "dafewwaf",
- "image": "http:\/\/www.wpc.com\/wp-content\/uploads\/2022\/10\/1525189943-38523.png",
- "attribute": "",
- "qty": "1",
- "price": "100.00",
- "link": "http:\/\/www.wpc.com\/?product=dafewwaf",
- }
- ],
- "info": {
- "oid": "32242341342",
- "total": "180.00",
- "currency": "USD",
- "country": "US",
- "email": "[email protected]",
- "secret_key": "NG1LPV345bsfd",
- "domain": "www.wpc.com",
- "return_url": "http:\/\/www.wpc.com\/?page_id=8",
- "cancel_url": "http:\/\/www.wpc.com\/?page_id=7",
- "notify_url": "http:\/\/www.wpc.com\/?wc-api=CMLZCC_NOTIFY",
- "customer_ip": "127.0.0.1",
- "card_number": "4226146578860117",
- "card_expire_month": "12",
- "card_expire_year": "2024",
- "card_cvv": "123",
- },
- "sign": "fb5ed62a3f4e5fdaa31705a2a387a3e7"
- }
- return_data = {
- "code": 1,
- "data": "https:\/\/www.abc.com",
- "info": ""
- }
- notify_data = {
- "sign": "fb5ed62a3f4e5fdaa31705a2a387a3e7",
- "orderId": "32242341342",
- "status": 1
- }
复制代码
|
|