{"id":1242,"date":"2022-02-21T00:30:49","date_gmt":"2022-02-20T16:30:49","guid":{"rendered":"http:\/\/www.tra56.com\/?p=1242"},"modified":"2022-02-21T00:30:49","modified_gmt":"2022-02-20T16:30:49","slug":"1242","status":"publish","type":"post","link":"https:\/\/www.tra56.com\/1242.html","title":{"rendered":"easyswoole\u5bf9\u63a5\u652f\u4ed8\u5b9d,\u5fae\u4fe1\u652f\u4ed8"},"content":{"rendered":"

\u5728easyswoole\u4e2d,\u5df2\u7ecf\u5f00\u53d1\u597d\u4e86\u76f8\u5173\u7684\u652f\u4ed8\u7ec4\u4ef6,\u53ea\u9700\u8981\u5f15\u5165\u5373\u53ef:<\/p>\n

\n\n
\n
\n
1<\/div>\n<\/td>\n
\n
composer require easyswoole<\/code>\/pay<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

pay\u7ec4\u4ef6\u652f\u6301\u534f\u7a0b<\/p>\n

\u652f\u4ed8\u5b9d<\/h2>\n

\u652f\u4ed8\u65b9\u6cd5<\/h4>\n

\u652f\u4ed8\u5b9d\u652f\u4ed8\u76ee\u524d\u652f\u6301 7 \u79cd\u652f\u4ed8\u65b9\u6cd5\uff0c\u5bf9\u5e94\u7684\u652f\u4ed8 method \u5982\u4e0b\uff1a<\/p>\n

\n\n
\nmethod<\/th>\n\u8bf4\u660e<\/th>\n\u53c2\u6570<\/th>\n\u8fd4\u56de\u503c<\/th>\n<\/tr>\n<\/thead>\n\n
\n
web<\/td>\n
\u7535\u8111\u652f\u4ed8<\/td>\n
Request<\/td>\n
Response<\/td>\n<\/tr>\n
\n
wap<\/td>\n
\u624b\u673a\u7f51\u7ad9\u652f\u4ed8<\/td>\n
Request<\/td>\n
Response<\/td>\n<\/tr>\n
\n
app<\/td>\n
APP \u652f\u4ed8<\/td>\n
Request<\/td>\n
Response<\/td>\n<\/tr>\n
\n
pos<\/td>\n
\u5237\u5361\u652f\u4ed8<\/td>\n
Request<\/td>\n
Response<\/td>\n<\/tr>\n
\n
scan<\/td>\n
\u626b\u7801\u652f\u4ed8<\/td>\n
Request<\/td>\n
Response<\/td>\n<\/tr>\n
\n
transfer<\/td>\n
\u8d26\u6237\u8f6c\u8d26<\/td>\n
Request<\/td>\n
Response<\/td>\n<\/tr>\n
\n
mini<\/td>\n
\u5c0f\u7a0b\u5e8f\u652f\u4ed8<\/td>\n
Request<\/td>\n
Response<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u7535\u8111\u652f\u4ed8<\/h2>\n
\n

\u7edf\u4e00\u6536\u5355\u4e0b\u5355\u5e76\u652f\u4ed8\u9875\u9762\u63a5\u53e3<\/p>\n<\/blockquote>\n

\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n
8<\/div>\n
9<\/div>\n
10<\/div>\n
11<\/div>\n
12<\/div>\n
13<\/div>\n
14<\/div>\n
15<\/div>\n
16<\/div>\n
17<\/div>\n
18<\/div>\n
19<\/div>\n
20<\/div>\n
21<\/div>\n
22<\/div>\n
23<\/div>\n
24<\/div>\n
25<\/div>\n
26<\/div>\n
27<\/div>\n
28<\/div>\n<\/td>\n
\n
$aliConfig<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\Config();<\/code><\/div>\n
$aliConfig<\/code>->setGateWay(\\EasySwoole\\Pay\\AliPay\\GateWay::NORMAL);<\/code><\/div>\n
$aliConfig<\/code>->setAppId(<\/code>'2017082000295641'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPublicKey(<\/code>'\u963f\u91cc\u516c\u94a5'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPrivateKey(<\/code>'\u963f\u91cc\u79c1\u94a5'<\/code>);<\/code><\/div>\n
 <\/div>\n
$pay<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\Pay();<\/code><\/div>\n
 <\/div>\n
## \u5bf9\u8c61\u98ce\u683c<\/code><\/div>\n
$order<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\RequestBean\\Web();<\/code><\/div>\n
$order<\/code>->setSubject(<\/code>'\u6d4b\u8bd5'<\/code>);<\/code><\/div>\n
$order<\/code>->setOutTradeNo(time().<\/code>'123456'<\/code>);<\/code><\/div>\n
$order<\/code>->setTotalAmount(<\/code>'0.01'<\/code>);<\/code><\/div>\n
\/\/ \u672c\u5e93\u53ea\u9884\u7f6e\u4e86\u5e38\u7528\u7684\u8bf7\u6c42\u53c2\u6570\uff0c\u6ca1\u9884\u7f6e\u7684\u53c2\u6570\u4f7f\u7528\uff1a$order->addProperty('\u5176\u4ed6\u5b57\u6bb5','\u5176\u4ed6\u5b57\u6bb5\u503c');<\/code><\/div>\n
 <\/div>\n
## \u6570\u7ec4\u98ce\u683c<\/code><\/div>\n
$order<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\RequestBean\\App([<\/code><\/div>\n
'subject'<\/code>=><\/code>'\u6d4b\u8bd5'<\/code>,<\/code><\/div>\n
'out_trade_no'<\/code>=><\/code>'123456'<\/code>,<\/code><\/div>\n
'total_amount'<\/code>=><\/code>'0.01'<\/code>,<\/code><\/div>\n
'\u989d\u5916\u7684\u5b57\u6bb5\u952e\u503c'<\/code>=><\/code>'\u989d\u5916\u5b57\u6bb5\u503c'<\/code><\/div>\n
],true);<\/code><\/div>\n
 <\/div>\n
$res<\/code> = <\/code>$pay<\/code>->aliPay(<\/code>$aliConfig<\/code>)->web(<\/code>$order<\/code>);<\/code><\/div>\n
var_dump(<\/code>$res<\/code>->toArray());<\/code><\/div>\n
 <\/div>\n
$html<\/code> = buildPayHtml(\\EasySwoole\\Pay\\AliPay\\GateWay::NORMAL,<\/code>$res<\/code>->toArray());<\/code><\/div>\n
file_put_contents<\/code>(<\/code>'test.html'<\/code>,<\/code>$html<\/code>);<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n


<\/p>\n

\u8ba2\u5355\u914d\u7f6e\u53c2\u6570<\/h4>\n

\u6240\u6709\u8ba2\u5355\u914d\u7f6e\u4e2d\uff0c\u5ba2\u89c2\u53c2\u6570\u5747\u4e0d\u7528\u914d\u7f6e\uff0c\u6269\u5c55\u5305\u5df2\u7ecf\u4e3a\u5927\u5bb6\u81ea\u52a8\u5904\u7406\u4e86\uff0c\u6bd4\u5982\uff0c<\/span>product_code<\/code> \u7b49\u53c2\u6570\u3002<\/span><\/p>\n

\u6240\u6709\u8ba2\u5355\u914d\u7f6e\u53c2\u6570\u548c\u5b98\u65b9\u65e0\u4efb\u4f55\u5dee\u522b\uff0c\u517c\u5bb9\u6240\u6709\u529f\u80fd\uff0c\u6240\u6709\u53c2\u6570\u8bf7\u53c2\u8003\u8fd9\u91cc<\/a>\uff0c\u67e5\u770b\u300c\u8bf7\u6c42\u53c2\u6570\u300d\u4e00\u680f\u3002<\/p>\n

\u53c2\u6570\u67e5\u8be2\uff1ahttps:\/\/docs.open.alipay.com\/api_1\/alipay.trade.page.pay<\/a><\/p>\n

\u751f\u6210\u652f\u4ed8\u7684\u8df3\u8f6chtml\u793a\u4f8b<\/p>\n

\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n
8<\/div>\n
9<\/div>\n
10<\/div>\n
11<\/div>\n<\/td>\n
\n
function<\/code> buildPayHtml(<\/code>$endpoint<\/code>, <\/code>$payload<\/code>)<\/code><\/div>\n
{<\/code><\/div>\n
$sHtml<\/code> = <\/code>"<form id='alipaysubmit' name='alipaysubmit' action='"<\/code>.<\/code>$endpoint<\/code>.<\/code>"' method='POST'>"<\/code>;<\/code><\/div>\n
    <\/code>foreach<\/code> (<\/code>$payload<\/code> as<\/code> $key<\/code> => <\/code>$val<\/code>) {<\/code><\/div>\n
    <\/code>$val<\/code> = <\/code>str_replace<\/code>(<\/code>"'"<\/code>, '&apos;', <\/code>$val<\/code>);<\/code><\/div>\n
    <\/code>$sHtml<\/code> .= <\/code>"<input type='hidden' name='"<\/code>.<\/code>$key<\/code>.<\/code>"' value='"<\/code>.<\/code>$val<\/code>.<\/code>"'\/>"<\/code>;<\/code><\/div>\n
    <\/code>}<\/code><\/div>\n
    <\/code>$sHtml<\/code> .= <\/code>"<input type='submit' value='ok' style='display:none;'><\/form>"<\/code>;<\/code><\/div>\n
$sHtml<\/code> .= <\/code>"<script>document.forms['alipaysubmit'].submit();<\/script>"<\/code>;<\/code><\/div>\n
return<\/code> $sHtml<\/code>;<\/code><\/div>\n
}<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u624b\u673a\u7f51\u7ad9\u652f\u4ed8\u63a5\u53e32.0<\/h2>\n
\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n
8<\/div>\n
9<\/div>\n
10<\/div>\n
11<\/div>\n
12<\/div>\n
13<\/div>\n
14<\/div>\n
15<\/div>\n
16<\/div>\n
17<\/div>\n
18<\/div>\n<\/td>\n
\n
$aliConfig<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\Config();<\/code><\/div>\n
$aliConfig<\/code>->setGateWay(\\EasySwoole\\Pay\\AliPay\\GateWay::NORMAL);<\/code><\/div>\n
$aliConfig<\/code>->setAppId(<\/code>'2017082000295641'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPublicKey(<\/code>'\u963f\u91cc\u516c\u94a5'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPrivateKey(<\/code>'\u963f\u91cc\u79c1\u94a5'<\/code>);<\/code><\/div>\n
 <\/div>\n
$pay<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\Pay();<\/code><\/div>\n
 <\/div>\n
$order<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\RequestBean\\Wap();<\/code><\/div>\n
$order<\/code>->setSubject(<\/code>'\u6d4b\u8bd5'<\/code>);<\/code><\/div>\n
$order<\/code>->setOutTradeNo(time().<\/code>'123456'<\/code>);<\/code><\/div>\n
$order<\/code>->setTotalAmount(<\/code>'0.01'<\/code>);<\/code><\/div>\n
 <\/div>\n
$res<\/code> = <\/code>$pay<\/code>->aliPay(<\/code>$aliConfig<\/code>)->wap(<\/code>$order<\/code>);<\/code><\/div>\n
var_dump(<\/code>$res<\/code>->toArray());<\/code><\/div>\n
 <\/div>\n
$html<\/code> = buildPayHtml(\\EasySwoole\\Pay\\AliPay\\GateWay::NORMAL,<\/code>$res<\/code>->toArray());<\/code><\/div>\n
file_put_contents<\/code>(<\/code>'test.html'<\/code>,<\/code>$html<\/code>);<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n


<\/p>\n

\u8ba2\u5355\u914d\u7f6e\u53c2\u6570<\/h4>\n

\u6240\u6709\u8ba2\u5355\u914d\u7f6e\u4e2d\uff0c\u5ba2\u89c2\u53c2\u6570\u5747\u4e0d\u7528\u914d\u7f6e\uff0c\u6269\u5c55\u5305\u5df2\u7ecf\u4e3a\u5927\u5bb6\u81ea\u52a8\u5904\u7406\u4e86\uff0c\u6bd4\u5982\uff0cproduct_code<\/code> \u7b49\u53c2\u6570\u3002<\/span><\/p>\n

\u6240\u6709\u8ba2\u5355\u914d\u7f6e\u53c2\u6570\u548c\u5b98\u65b9\u65e0\u4efb\u4f55\u5dee\u522b\uff0c\u517c\u5bb9\u6240\u6709\u529f\u80fd\uff0c\u6240\u6709\u53c2\u6570\u8bf7\u53c2\u8003\u8fd9\u91cc<\/a>\uff0c\u67e5\u770b\u300c\u8bf7\u6c42\u53c2\u6570\u300d\u4e00\u680f\u3002<\/p>\n

\u53c2\u6570\u67e5\u8be2\uff1ahttps:\/\/docs.open.alipay.com\/api_1\/alipay.trade.wap.pay<\/a><\/p>\n

APP\u652f\u4ed8\u63a5\u53e32.0<\/h2>\n
\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n
8<\/div>\n
9<\/div>\n
10<\/div>\n
11<\/div>\n
12<\/div>\n
13<\/div>\n
14<\/div>\n<\/td>\n
\n
$aliConfig<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\Config();<\/code><\/div>\n
$aliConfig<\/code>->setGateWay(\\EasySwoole\\Pay\\AliPay\\GateWay::SANDBOX);<\/code><\/div>\n
$aliConfig<\/code>->setAppId(<\/code>'2016091800538339'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPublicKey(<\/code>'\u963f\u91cc\u516c\u94a5'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPrivateKey(<\/code>'\u963f\u91cc\u79c1\u94a5'<\/code>);<\/code><\/div>\n
 <\/div>\n
$pay<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\Pay();<\/code><\/div>\n
$order<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\RequestBean\\App();<\/code><\/div>\n
$order<\/code>->setSubject(<\/code>'\u6d4b\u8bd5'<\/code>);<\/code><\/div>\n
$order<\/code>->setOutTradeNo(time().<\/code>'123456'<\/code>);<\/code><\/div>\n
$order<\/code>->setTotalAmount(<\/code>'0.01'<\/code>);<\/code><\/div>\n
$aliPay<\/code> = <\/code>$pay<\/code>->aliPay(<\/code>$aliConfig<\/code>);<\/code><\/div>\n
 <\/div>\n
var_dump(<\/code>$aliPay<\/code>->app(<\/code>$order<\/code>)->toArray());<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u8ba2\u5355\u914d\u7f6e\u53c2\u6570<\/h4>\n

\u6240\u6709\u8ba2\u5355\u914d\u7f6e\u4e2d\uff0c\u5ba2\u89c2\u53c2\u6570\u5747\u4e0d\u7528\u914d\u7f6e\uff0c\u6269\u5c55\u5305\u5df2\u7ecf\u4e3a\u5927\u5bb6\u81ea\u52a8\u5904\u7406\u4e86\uff0c\u6bd4\u5982\uff0c product_code<\/code> \u7b49\u53c2\u6570\u3002<\/span><\/p>\n

\u6240\u6709\u8ba2\u5355\u914d\u7f6e\u53c2\u6570\u548c\u5b98\u65b9\u65e0\u4efb\u4f55\u5dee\u522b\uff0c\u517c\u5bb9\u6240\u6709\u529f\u80fd\uff0c\u6240\u6709\u53c2\u6570\u8bf7\u53c2\u8003\u8fd9\u91cc<\/a>\uff0c\u67e5\u770b\u300c\u8bf7\u6c42\u53c2\u6570\u300d\u4e00\u680f\u3002<\/p>\n

\u53c2\u6570\u67e5\u8be2\uff1ahttps:\/\/docs.open.alipay.com\/api_1\/alipay.trade.app.pay<\/a><\/p>\n

\u5237\u5361\u652f\u4ed8<\/h2>\n
\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n
8<\/div>\n
9<\/div>\n
10<\/div>\n
11<\/div>\n
12<\/div>\n
13<\/div>\n
14<\/div>\n<\/td>\n
\n
$aliConfig<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\Config();<\/code><\/div>\n
$aliConfig<\/code>->setGateWay(\\EasySwoole\\Pay\\AliPay\\GateWay::SANDBOX);<\/code><\/div>\n
$aliConfig<\/code>->setAppId(<\/code>'2016091800538339'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPublicKey(<\/code>'\u963f\u91cc\u516c\u94a5'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPrivateKey(<\/code>'\u963f\u91cc\u79c1\u94a5'<\/code>);<\/code><\/div>\n
$pay<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\Pay();<\/code><\/div>\n
$order<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\RequestBean\\Pos();<\/code><\/div>\n
$order<\/code>->setSubject(<\/code>'\u6d4b\u8bd5'<\/code>);<\/code><\/div>\n
$order<\/code>->setTotalAmount(<\/code>'0.01'<\/code>);<\/code><\/div>\n
$order<\/code>->setOutTradeNo(time());<\/code><\/div>\n
$order<\/code>->setAuthCode(<\/code>'289756915257123456'<\/code>);<\/code><\/div>\n
$aliPay<\/code> = <\/code>$pay<\/code>->aliPay(<\/code>$aliConfig<\/code>);<\/code><\/div>\n
$data<\/code> = <\/code>$aliPay<\/code>->pos(<\/code>$order<\/code>)->toArray();<\/code><\/div>\n
var_dump(<\/code>$data<\/code>);<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u8ba2\u5355\u914d\u7f6e\u53c2\u6570<\/h4>\n

\u6240\u6709\u8ba2\u5355\u914d\u7f6e\u4e2d\uff0c\u5ba2\u89c2\u53c2\u6570\u5747\u4e0d\u7528\u914d\u7f6e\uff0c\u6269\u5c55\u5305\u5df2\u7ecf\u4e3a\u5927\u5bb6\u81ea\u52a8\u5904\u7406\u4e86\uff0c\u6bd4\u5982\uff0cproduct_code<\/code> \u7b49\u53c2\u6570\u3002<\/span><\/p>\n

\u6240\u6709\u8ba2\u5355\u914d\u7f6e\u53c2\u6570\u548c\u5b98\u65b9\u65e0\u4efb\u4f55\u5dee\u522b\uff0c\u517c\u5bb9\u6240\u6709\u529f\u80fd\uff0c\u6240\u6709\u53c2\u6570\u8bf7\u53c2\u8003\u8fd9\u91cc<\/a>\uff0c\u67e5\u770b\u300c\u8bf7\u6c42\u53c2\u6570\u300d\u4e00\u680f\u3002<\/p>\n

\u53c2\u6570\u67e5\u8be2\uff1ahttps:\/\/docs.open.alipay.com\/api_1\/alipay.trade.page.pay<\/a><\/p>\n

\u626b\u7801\u652f\u4ed8<\/h2>\n
\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n
8<\/div>\n
9<\/div>\n
10<\/div>\n
11<\/div>\n
12<\/div>\n
13<\/div>\n
14<\/div>\n
15<\/div>\n
16<\/div>\n<\/td>\n
\n
$aliConfig<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\Config();<\/code><\/div>\n
$aliConfig<\/code>->setGateWay(\\EasySwoole\\Pay\\AliPay\\GateWay::SANDBOX);<\/code><\/div>\n
$aliConfig<\/code>->setAppId(<\/code>'2016091800538339'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPublicKey(<\/code>'\u963f\u91cc\u516c\u94a5'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPrivateKey(<\/code>'\u963f\u91cc\u79c1\u94a5'<\/code>);<\/code><\/div>\n
$pay<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\Pay();<\/code><\/div>\n
$pay<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\Pay();<\/code><\/div>\n
$order<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\RequestBean\\Scan();<\/code><\/div>\n
$order<\/code>->setSubject(<\/code>'\u6d4b\u8bd5'<\/code>);<\/code><\/div>\n
$order<\/code>->setTotalAmount(<\/code>'0.01'<\/code>);<\/code><\/div>\n
$order<\/code>->setOutTradeNo(time());<\/code><\/div>\n
$aliPay<\/code> = <\/code>$pay<\/code>->aliPay(<\/code>$aliConfig<\/code>);<\/code><\/div>\n
$data<\/code> = <\/code>$aliPay<\/code>->scan(<\/code>$order<\/code>)->toArray();<\/code><\/div>\n
$response<\/code> = <\/code>$aliPay<\/code>->preQuest(<\/code>$data<\/code>);<\/code><\/div>\n
var_dump(<\/code>$response<\/code>);<\/code><\/div>\n
\/\/ qr_code \u5f53\u524d\u9884\u4e0b\u5355\u8bf7\u6c42\u751f\u6210\u7684\u4e8c\u7ef4\u7801\u7801\u4e32\uff0c\u53ef\u4ee5\u7528\u4e8c\u7ef4\u7801\u751f\u6210\u5de5\u5177\u6839\u636e\u8be5\u7801\u4e32\u503c\u751f\u6210\u5bf9\u5e94\u7684\u4e8c\u7ef4\u7801  https:\/\/qr.alipay.com\/bavh4wjlxf12tper3a<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u8ba2\u5355\u914d\u7f6e\u53c2\u6570<\/h4>\n

\u6240\u6709\u8ba2\u5355\u914d\u7f6e\u4e2d\uff0c\u5ba2\u89c2\u53c2\u6570\u5747\u4e0d\u7528\u914d\u7f6e\uff0c\u6269\u5c55\u5305\u5df2\u7ecf\u4e3a\u5927\u5bb6\u81ea\u52a8\u5904\u7406\u4e86\uff0c\u6bd4\u5982\uff0cproduct_code<\/code> \u7b49\u53c2\u6570\u3002<\/span><\/p>\n

\u6240\u6709\u8ba2\u5355\u914d\u7f6e\u53c2\u6570\u548c\u5b98\u65b9\u65e0\u4efb\u4f55\u5dee\u522b\uff0c\u517c\u5bb9\u6240\u6709\u529f\u80fd\uff0c\u6240\u6709\u53c2\u6570\u8bf7\u53c2\u8003\u8fd9\u91cc<\/a>\uff0c\u67e5\u770b\u300c\u8bf7\u6c42\u53c2\u6570\u300d\u4e00\u680f\u3002<\/p>\n

\u53c2\u8003\u53c2\u6570\uff1ahttps:\/\/docs.open.alipay.com\/api_1\/alipay.trade.precreate<\/a><\/p>\n

\u5355\u7b14\u8f6c\u8d26\u5230\u652f\u4ed8\u5b9d\u8d26\u6237\u63a5\u53e3<\/h2>\n
\n\n
\n
\n
1<\/div>\n<\/td>\n
\n
<br><\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

$aliConfig = new \\EasySwoole\\Pay\\AliPay\\Config();
$aliConfig->setGateWay(\\EasySwoole\\Pay\\AliPay\\GateWay::SANDBOX);
$aliConfig->setAppId('2016091800538339');
$aliConfig->setPublicKey('\u963f\u91cc\u516c\u94a5');
$aliConfig->setPrivateKey('\u963f\u91cc\u79c1\u94a5');

$pay = new \\EasySwoole\\Pay\\Pay();

$order = new \\EasySwoole\\Pay\\AliPay\\RequestBean\\Transfer();
$order->setSubject('\u6d4b\u8bd5');
$order->setTotalAmount('0.01');
$order->setPayeeType('ALIPAY_LOGONID');
$order->setPayeeAccount('hcihsn8174@sandbox.com');

$aliPay = $pay->aliPay($aliConfig);
$data = $aliPay->transfer($order)->toArray();
$aliPay->preQuest($data);
var_dump($data);<\/p>\n

\u8ba2\u5355\u914d\u7f6e\u53c2\u6570
<\/h4>\n

\u6240\u6709\u8ba2\u5355\u914d\u7f6e\u4e2d\uff0c\u5ba2\u89c2\u53c2\u6570\u5747\u4e0d\u7528\u914d\u7f6e\uff0c\u6269\u5c55\u5305\u5df2\u7ecf\u4e3a\u5927\u5bb6\u81ea\u52a8\u5904\u7406\u4e86\uff0c\u6bd4\u5982\uff0cproduct_code<\/code> \u7b49\u53c2\u6570\u3002<\/span><\/p>\n

\u6240\u6709\u8ba2\u5355\u914d\u7f6e\u53c2\u6570\u548c\u5b98\u65b9\u65e0\u4efb\u4f55\u5dee\u522b\uff0c\u517c\u5bb9\u6240\u6709\u529f\u80fd\uff0c\u6240\u6709\u53c2\u6570\u8bf7\u53c2\u8003\u8fd9\u91cc<\/a>\uff0c\u67e5\u770b\u300c\u8bf7\u6c42\u53c2\u6570\u300d\u4e00\u680f\u3002<\/p>\n

\u53c2\u6570\u67e5\u8be2\uff1ahttps:\/\/docs.open.alipay.com\/api_28\/alipay.fund.trans.toaccount.transfer<\/a><\/p>\n

\u5c0f\u7a0b\u5e8f\u652f\u4ed8<\/h2>\n
\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n
8<\/div>\n
9<\/div>\n
10<\/div>\n
11<\/div>\n
12<\/div>\n
13<\/div>\n
14<\/div>\n<\/td>\n
\n
$aliConfig<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\Config();<\/code><\/div>\n
$aliConfig<\/code>->setGateWay(\\EasySwoole\\Pay\\AliPay\\GateWay::SANDBOX);<\/code><\/div>\n
$aliConfig<\/code>->setAppId(<\/code>'2016091800538339'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPublicKey(<\/code>'\u963f\u91cc\u516c\u94a5'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPrivateKey(<\/code>'\u963f\u91cc\u79c1\u94a5'<\/code>);<\/code><\/div>\n
$pay<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\Pay();<\/code><\/div>\n
$order<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\RequestBean\\MiniProgram();<\/code><\/div>\n
$order<\/code>->setSubject(<\/code>'\u6d4b\u8bd5'<\/code>);<\/code><\/div>\n
$order<\/code>->setOutTradeNo(time().<\/code>'123456'<\/code>);<\/code><\/div>\n
$order<\/code>->setTotalAmount(<\/code>'0.01'<\/code>);<\/code><\/div>\n
$order<\/code>->setBuyerId(<\/code>'hcihsn8174@sandbox.com'<\/code>);<\/code><\/div>\n
$aliPay<\/code> = <\/code>$pay<\/code>->aliPay(<\/code>$aliConfig<\/code>);<\/code><\/div>\n
$data<\/code> = <\/code>$aliPay<\/code>->miniProgram(<\/code>$order<\/code>)->toArray();<\/code><\/div>\n
var_dump(<\/code>$data<\/code>);<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u8ba2\u5355\u914d\u7f6e\u53c2\u6570
<\/h4>\n

\u6240\u6709\u8ba2\u5355\u914d\u7f6e\u4e2d\uff0c\u5ba2\u89c2\u53c2\u6570\u5747\u4e0d\u7528\u914d\u7f6e\uff0c\u6269\u5c55\u5305\u5df2\u7ecf\u4e3a\u5927\u5bb6\u81ea\u52a8\u5904\u7406\u4e86\uff0c\u6bd4\u5982\uff0cproduct_code<\/code> \u7b49\u53c2\u6570\u3002<\/span><\/p>\n

\u6240\u6709\u8ba2\u5355\u914d\u7f6e\u53c2\u6570\u548c\u5b98\u65b9\u65e0\u4efb\u4f55\u5dee\u522b\uff0c\u517c\u5bb9\u6240\u6709\u529f\u80fd\uff0c\u6240\u6709\u53c2\u6570\u8bf7\u53c2\u8003\u8fd9\u91cc<\/a>\uff0c\u67e5\u770b\u300c\u8bf7\u6c42\u53c2\u6570\u300d\u4e00\u680f\u3002<\/p>\n

\u5c0f\u7a0b\u5e8f\u652f\u4ed8\u63a5\u5165\u6587\u6863\uff1ahttps:\/\/docs.alipay.com\/mini\/introduce\/pay<\/a>\u3002<\/p>\n

\u53c2\u6570\u67e5\u8be2\uff1a<\/p>\n

\u8ba2\u5355\u67e5\u8be2<\/h2>\n
\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n
8<\/div>\n
9<\/div>\n
10<\/div>\n<\/td>\n
\n
$aliConfig<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\Config();<\/code><\/div>\n
$aliConfig<\/code>->setGateWay(\\EasySwoole\\Pay\\AliPay\\GateWay::SANDBOX);<\/code><\/div>\n
$aliConfig<\/code>->setAppId(<\/code>'2016091800538339'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPublicKey(<\/code>'\u963f\u91cc\u516c\u94a5'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPrivateKey(<\/code>'\u963f\u91cc\u79c1\u94a5'<\/code>);<\/code><\/div>\n
$pay<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\Pay();<\/code><\/div>\n
$order<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\RequestBean\\OrderFind();<\/code><\/div>\n
$order<\/code>->setOutTradeNo(time().<\/code>'123456'<\/code>);<\/code><\/div>\n
$aliPay<\/code> = <\/code>$pay<\/code>->aliPay(<\/code>$aliConfig<\/code>);<\/code><\/div>\n
var_dump(<\/code>$aliPay<\/code>->orderFind(<\/code>$order<\/code>)->toArray());<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5b98\u65b9\u53c2\u6570\u67e5\u8be2\uff1ahttps:\/\/docs.open.alipay.com\/api_1\/alipay.trade.fastpay.refund.query<\/a><\/p>\n

\u9000\u6b3e\u67e5\u8be2<\/h2>\n
\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n
8<\/div>\n
9<\/div>\n
10<\/div>\n
11<\/div>\n
12<\/div>\n<\/td>\n
\n
$aliConfig<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\Config();<\/code><\/div>\n
$aliConfig<\/code>->setGateWay(\\EasySwoole\\Pay\\AliPay\\GateWay::SANDBOX);<\/code><\/div>\n
$aliConfig<\/code>->setAppId(<\/code>'2016091800538339'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPublicKey(<\/code>'\u963f\u91cc\u516c\u94a5'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPrivateKey(<\/code>'\u963f\u91cc\u79c1\u94a5'<\/code>);<\/code><\/div>\n
$pay<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\Pay();<\/code><\/div>\n
$order<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\RequestBean\\RefundFind();<\/code><\/div>\n
$order<\/code>->setOutTradeNo(<\/code>'20150320010101001'<\/code>);<\/code><\/div>\n
$order<\/code>->setOutRequestNo(time().<\/code>'2014112611001004680073956707'<\/code>);<\/code><\/div>\n
$aliPay<\/code> = <\/code>$pay<\/code>->aliPay(<\/code>$aliConfig<\/code>);<\/code><\/div>\n
$data<\/code> = <\/code>$aliPay<\/code>->refundFind(<\/code>$order<\/code>)->toArray();<\/code><\/div>\n
var_dump(<\/code>$aliPay<\/code>->preQuest(<\/code>$data<\/code>));<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5b98\u65b9\u53c2\u6570\u67e5\u8be2\uff1ahttps:\/\/docs.open.alipay.com\/api_1\/alipay.trade.refund<\/a>
<\/p>\n

\u67e5\u8be2\u8f6c\u8d26\u8ba2\u5355\u63a5\u53e3<\/h2>\n
\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n
8<\/div>\n
9<\/div>\n
10<\/div>\n
11<\/div>\n
12<\/div>\n
13<\/div>\n<\/td>\n
\n
$aliConfig<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\Config();<\/code><\/div>\n
$aliConfig<\/code>->setGateWay(\\EasySwoole\\Pay\\AliPay\\GateWay::SANDBOX);<\/code><\/div>\n
$aliConfig<\/code>->setAppId(<\/code>'2016091800538339'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPublicKey(<\/code>'\u963f\u91cc\u516c\u94a5'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPrivateKey(<\/code>'\u963f\u91cc\u79c1\u94a5'<\/code>);<\/code><\/div>\n
$pay<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\Pay();<\/code><\/div>\n
$order<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\RequestBean\\TransferFind();<\/code><\/div>\n
$order<\/code>->setOutBizNo(<\/code>'3142321423432'<\/code>);<\/code><\/div>\n
\/\/ \u4e8c\u9009\u4e00<\/code><\/div>\n
\/\/  $order->setOrderId('20160627110070001502260006780837');<\/code><\/div>\n
$aliPay<\/code> = <\/code>$pay<\/code>->aliPay(<\/code>$aliConfig<\/code>);<\/code><\/div>\n
$data<\/code> = <\/code>$aliPay<\/code>->transferFind(<\/code>$order<\/code>)->toArray();<\/code><\/div>\n
var_dump(<\/code>$aliPay<\/code>->preQuest(<\/code>$data<\/code>));<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5b98\u65b9\u53c2\u6570\u67e5\u8be2\uff1ahttps:\/\/docs.open.alipay.com\/api_28\/alipay.fund.trans.order.query<\/a>
<\/p>\n

\u4ea4\u6613\u64a4\u9500\u63a5\u53e3<\/h2>\n
\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n
8<\/div>\n
9<\/div>\n
10<\/div>\n
11<\/div>\n<\/td>\n
\n
$aliConfig<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\Config();<\/code><\/div>\n
$aliConfig<\/code>->setGateWay(\\EasySwoole\\Pay\\AliPay\\GateWay::SANDBOX);<\/code><\/div>\n
$aliConfig<\/code>->setAppId(<\/code>'2016091800538339'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPublicKey(<\/code>'\u963f\u91cc\u516c\u94a5'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPrivateKey(<\/code>'\u963f\u91cc\u79c1\u94a5'<\/code>);<\/code><\/div>\n
$pay<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\Pay();<\/code><\/div>\n
$order<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\RequestBean\\Cancel();<\/code><\/div>\n
$order<\/code>->setOutTradeNo(<\/code>'20150320010101001'<\/code>);<\/code><\/div>\n
$aliPay<\/code> = <\/code>$pay<\/code>->aliPay(<\/code>$aliConfig<\/code>);<\/code><\/div>\n
$data<\/code> = <\/code>$aliPay<\/code>->cancel(<\/code>$order<\/code>)->toArray();<\/code><\/div>\n
var_dump(<\/code>$aliPay<\/code>->preQuest(<\/code>$data<\/code>));<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5b98\u65b9\u53c2\u6570\u67e5\u8be2\uff1ahttps:\/\/docs.open.alipay.com\/api_1\/alipay.trade.cancel<\/a>
<\/p>\n

\u4ea4\u6613\u5173\u95ed\u63a5\u53e3<\/h2>\n
\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n
8<\/div>\n
9<\/div>\n
10<\/div>\n
11<\/div>\n<\/td>\n
\n
$aliConfig<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\Config();<\/code><\/div>\n
$aliConfig<\/code>->setGateWay(\\EasySwoole\\Pay\\AliPay\\GateWay::SANDBOX);<\/code><\/div>\n
$aliConfig<\/code>->setAppId(<\/code>'2016091800538339'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPublicKey(<\/code>'\u963f\u91cc\u516c\u94a5'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPrivateKey(<\/code>'\u963f\u91cc\u79c1\u94a5'<\/code>);<\/code><\/div>\n
$pay<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\Pay();<\/code><\/div>\n
$order<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\RequestBean\\Close();<\/code><\/div>\n
$order<\/code>->setOutTradeNo(time().<\/code>'123456'<\/code>);<\/code><\/div>\n
$aliPay<\/code> = <\/code>$pay<\/code>->aliPay(<\/code>$aliConfig<\/code>);<\/code><\/div>\n
$data<\/code> = <\/code>$aliPay<\/code>->close(<\/code>$order<\/code>)->toArray();<\/code><\/div>\n
var_dump(<\/code>$aliPay<\/code>->preQuest(<\/code>$data<\/code>));<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5b98\u65b9\u53c2\u6570\u67e5\u8be2\uff1ahttps:\/\/docs.open.alipay.com\/api_1\/alipay.trade.close<\/a><\/p>\n

\u67e5\u8be2\u5bf9\u8d26\u5355\u4e0b\u8f7d\u5730\u5740<\/h2>\n
\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n
8<\/div>\n
9<\/div>\n
10<\/div>\n
11<\/div>\n
12<\/div>\n<\/td>\n
\n
$aliConfig<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\Config();<\/code><\/div>\n
$aliConfig<\/code>->setGateWay(\\EasySwoole\\Pay\\AliPay\\GateWay::SANDBOX);<\/code><\/div>\n
$aliConfig<\/code>->setAppId(<\/code>'2016091800538339'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPublicKey(<\/code>'\u963f\u91cc\u516c\u94a5'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPrivateKey(<\/code>'\u963f\u91cc\u79c1\u94a5'<\/code>);<\/code><\/div>\n
$pay<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\Pay();<\/code><\/div>\n
$order<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\RequestBean\\Download();<\/code><\/div>\n
$order<\/code>->setBillType(<\/code>'trade'<\/code>);<\/code><\/div>\n
$order<\/code>->setBillDate(<\/code>'2016-04-05'<\/code>);<\/code><\/div>\n
$aliPay<\/code> = <\/code>$pay<\/code>->aliPay(<\/code>$aliConfig<\/code>);<\/code><\/div>\n
$data<\/code> = <\/code>$aliPay<\/code>->download(<\/code>$order<\/code>)->toArray();<\/code><\/div>\n
var_dump(<\/code>$aliPay<\/code>->preQuest(<\/code>$data<\/code>));<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5b98\u65b9\u53c2\u6570\u67e5\u8be2\uff1ahttps:\/\/docs.open.alipay.com\/api_15\/alipay.data.dataservice.bill.downloadurl.query<\/a>
<\/p>\n

\u9a8c\u8bc1\u670d\u52a1\u5668\u6570\u636e<\/h2>\n
\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n
8<\/div>\n
9<\/div>\n
10<\/div>\n
11<\/div>\n
12<\/div>\n<\/td>\n
\n
$aliConfig<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\Config();<\/code><\/div>\n
$aliConfig<\/code>->setGateWay(\\EasySwoole\\Pay\\AliPay\\GateWay::SANDBOX);<\/code><\/div>\n
$aliConfig<\/code>->setAppId(<\/code>'2016091800538339'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPublicKey(<\/code>'\u963f\u91cc\u516c\u94a5'<\/code>);<\/code><\/div>\n
$aliConfig<\/code>->setPrivateKey(<\/code>'\u963f\u91cc\u79c1\u94a5'<\/code>);<\/code><\/div>\n
$pay<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\Pay();<\/code><\/div>\n
$param<\/code> = [];<\/code>\/\/\u4f2a\u4ee3\u7801,post\u6570\u636e<\/code><\/div>\n
unset(<\/code>$param<\/code>[<\/code>'sign_type'<\/code>]);<\/code>\/\/\u9700\u8981\u5ffd\u7565sign_type\u7ec4\u88c5<\/code><\/div>\n
$order<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\AliPay\\RequestBean\\NotifyRequest(<\/code>$param<\/code>,true);<\/code><\/div>\n
$aliPay<\/code> = <\/code>$pay<\/code>->aliPay(<\/code>$aliConfig<\/code>);<\/code><\/div>\n
$result<\/code> = <\/code>$aliPay<\/code>->verify(<\/code>$order<\/code>);<\/code><\/div>\n
var_dump(<\/code>$result<\/code>);<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u670d\u52a1\u5668\u786e\u8ba4\u6536\u5230\u5f02\u6b65\u901a\u77e5\u5b57\u7b26\u4e32\u83b7\u53d6
<\/h2>\n
\n\n
\n
\n
1<\/div>\n
2<\/div>\n<\/td>\n
\n
\\EasySwoole\\Pay\\AliPay::success();<\/code>\/\/\u6210\u529f\u54cd\u5e94<\/code><\/div>\n
\\EasySwoole\\Pay\\AliPay::fail();<\/code>\/\/\u5931\u8d25\u54cd\u5e94<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5fae\u4fe1\u652f\u4ed8
<\/h1>\n

\u5fae\u4fe1\u652f\u4ed8\u76ee\u524d\u652f\u6301 3 \u79cd\u652f\u4ed8\u65b9\u6cd5\uff0c\u5bf9\u5e94\u7684\u652f\u4ed8 method \u5982\u4e0b\uff1a<\/p>\n

\n\n
\nmethod<\/th>\n\u8bf4\u660e<\/th>\n\u53c2\u6570<\/th>\n\u8fd4\u56de\u503c<\/th>\n<\/tr>\n<\/thead>\n\n
\n
wap<\/td>\n
\u624b\u673a\u7f51\u7ad9\u652f\u4ed8<\/td>\n
Request<\/td>\n
Response<\/td>\n<\/tr>\n
\n
officialAccount<\/td>\n
\u516c\u4f17\u53f7\u652f\u4ed8<\/td>\n
Request<\/td>\n
Response<\/td>\n<\/tr>\n
\n
scan<\/td>\n
\u626b\u7801\u652f\u4ed8<\/td>\n
Request<\/td>\n
Response<\/td>\n<\/tr>\n
\n
miniProgram<\/td>\n
\u5c0f\u7a0b\u5e8f\u652f\u4ed8<\/td>\n
Request<\/td>\n
Response<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5fae\u4fe1\u53c2\u6570\u914d\u7f6e<\/h4>\n


<\/p>\n

\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n
8<\/div>\n<\/td>\n
\n
$wechatConfig<\/code> = <\/code>new<\/code> Config();<\/code><\/div>\n
$wechatConfig<\/code>->setAppId(<\/code>'xxxxxx'<\/code>);      <\/code>\/\/ \u9664\u4e86\u5c0f\u7a0b\u5e8f\u4ee5\u5916\u4f7f\u7528\u8be5APPID<\/code><\/div>\n
$wechatConfig<\/code>->setMiniAppId(<\/code>'xxxxxx'<\/code>);  <\/code>\/\/ \u5c0f\u7a0b\u5e8f\u4f7f\u7528\u8be5APPID<\/code><\/div>\n
$wechatConfig<\/code>->setMchId(<\/code>'xxxxxx'<\/code>);<\/code><\/div>\n
$wechatConfig<\/code>->setKey(<\/code>'xxxxxx'<\/code>);<\/code><\/div>\n
$wechatConfig<\/code>->setNotifyUrl(<\/code>'xxxxx'<\/code>);<\/code><\/div>\n
$wechatConfig<\/code>->setApiClientCert(<\/code>'xxxxxxx'<\/code>);<\/code>\/\/\u5ba2\u6237\u7aef\u8bc1\u4e66<\/code><\/div>\n
$wechatConfig<\/code>->setApiClientKey(<\/code>'xxxxxxx'<\/code>); <\/code>\/\/\u5ba2\u6237\u7aef\u8bc1\u4e66\u79d8\u94a5<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\n

\u7531\u4e8e\u5c0f\u7a0b\u5e8f\u62e5\u6709\u72ec\u7acb\u7684APPID\uff0c\u53ea\u9700\u8981\u5728\u914d\u7f6e\u91cc\u540c\u65f6\u914d\u7f6e\u4e0aAppId\u548cMiniAppId\u4e24\u4e2a\u914d\u7f6e\u9879\uff0c\u5728\u652f\u4ed8\u7684\u65f6\u5019\u4f1a\u81ea\u52a8\u9009\u62e9\u5bf9\u5e94\u7684APPID\u6765\u53d1\u8d77\u652f\u4ed8<\/p>\n<\/blockquote>\n

\u516c\u4f17\u53f7\u652f\u4ed8<\/h2>\n
\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n
8<\/div>\n<\/td>\n
\n
$officialAccount<\/code> = <\/code>new<\/code> OfficialAccount();<\/code><\/div>\n
$officialAccount<\/code>->setOpenid(<\/code>'xxxxxxx'<\/code>);<\/code><\/div>\n
$officialAccount<\/code>->setOutTradeNo(<\/code>'CN'<\/code> . <\/code>date<\/code>(<\/code>'YmdHis'<\/code>) . rand(1000, 9999));<\/code><\/div>\n
$officialAccount<\/code>->setBody(<\/code>'xxxxx-\u6d4b\u8bd5'<\/code> . <\/code>$outTradeNo<\/code>);<\/code><\/div>\n
$officialAccount<\/code>->setTotalFee(1);<\/code><\/div>\n
$officialAccount<\/code>->setSpbillCreateIp(<\/code>'xxxxx'<\/code>);<\/code><\/div>\n
$pay<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\Pay();<\/code><\/div>\n
$params<\/code> = <\/code>$pay<\/code>->weChat(<\/code>$wechatConfig<\/code>)->officialAccount(<\/code>$officialAccount<\/code>);<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u53ef\u4ee5\u53c2\u8003demo\/wechat\/index.php
<\/p>\n

H5\u652f\u4ed8<\/h2>\n
\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n<\/td>\n
\n
$wap<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\WeChat\\RequestBean\\Wap();<\/code><\/div>\n
$wap<\/code>->setOutTradeNo(<\/code>'CN'<\/code> . <\/code>date<\/code>(<\/code>'YmdHis'<\/code>) . rand(1000, 9999));<\/code><\/div>\n
$wap<\/code>->setBody(<\/code>'xxxxx-WAP\u6d4b\u8bd5'<\/code> . <\/code>$outTradeNo<\/code>);<\/code><\/div>\n
$wap<\/code>->setTotalFee(1);<\/code><\/div>\n
$wap<\/code>->setSpbillCreateIp(<\/code>'xxxxx'<\/code>);<\/code><\/div>\n
$pay<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\Pay();<\/code><\/div>\n
$params<\/code> = <\/code>$pay<\/code>->weChat(<\/code>$wechatConfig<\/code>)->wap(<\/code>$wap<\/code>);<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5c0f\u7a0b\u5e8f\u652f\u4ed8<\/h2>\n
\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n
8<\/div>\n<\/td>\n
\n
$bean<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\WeChat\\RequestBean\\MiniProgram();<\/code><\/div>\n
$bean<\/code>->setOpenid(<\/code>'xxxxxxxxx'<\/code>);<\/code><\/div>\n
$bean<\/code>->setOutTradeNo(<\/code>'CN'<\/code> . <\/code>date<\/code>(<\/code>'YmdHis'<\/code>) . rand(1000, 9999));<\/code><\/div>\n
$bean<\/code>->setBody(<\/code>'xxxx-\u6d4b\u8bd5'<\/code> . <\/code>$outTradeNo<\/code>);<\/code><\/div>\n
$bean<\/code>->setTotalFee(1);<\/code><\/div>\n
$bean<\/code>->setSpbillCreateIp(<\/code>$this<\/code>->request()->getHeader(<\/code>'x-real-ip'<\/code>)[0]);<\/code><\/div>\n
$pay<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\Pay();<\/code><\/div>\n
$params<\/code> = <\/code>$pay<\/code>->weChat(<\/code>$this<\/code>->wechatConfig)->miniProgram(<\/code>$bean<\/code>);<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u626b\u7801\u652f\u4ed8
<\/h2>\n

\u6a21\u5f0f\u4e00<\/h4>\n

\u751f\u6210\u626b\u7801\u94fe\u63a5 \u7136\u540e\u751f\u6210\u4e8c\u7ef4\u7801 \u5177\u4f53\u8bf7\u67e5\u770bdemo\/wechat\/index.php<\/p>\n

\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n
8<\/div>\n
9<\/div>\n
10<\/div>\n<\/td>\n
\n
$biz<\/code> = <\/code>new<\/code> Biz();<\/code><\/div>\n
$biz<\/code>->setProductId(<\/code>'123456789'<\/code>);<\/code><\/div>\n
$biz<\/code>->setTimeStamp(time());<\/code><\/div>\n
$biz<\/code>->setAppId(<\/code>$wechatConfig<\/code>->getAppId());<\/code><\/div>\n
$biz<\/code>->setMchId(<\/code>$wechatConfig<\/code>->getMchid());<\/code><\/div>\n
$data<\/code> = <\/code>$biz<\/code>->toArray();<\/code><\/div>\n
$u<\/code> = <\/code>new<\/code> Utility(<\/code>$wechatConfig<\/code>);<\/code><\/div>\n
$sign<\/code> = <\/code>$u<\/code>->generateSign(<\/code>$data<\/code>);<\/code><\/div>\n
$biz<\/code>->setSign(<\/code>$sign<\/code>);<\/code><\/div>\n
$url1<\/code> = <\/code>"weixin:\/\/wxpay\/bizpayurl?"<\/code> . <\/code>$this<\/code>->ToUrlParams(<\/code>$biz<\/code>->toArray());<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u626b\u7801\u56de\u8c03\u5730\u5740\uff08ps:\u516c\u4f17\u53f7\u5e73\u53f0\u8bbe\u7f6e\uff09<\/p>\n

\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n
8<\/div>\n
9<\/div>\n
10<\/div>\n
11<\/div>\n
12<\/div>\n
13<\/div>\n
14<\/div>\n
15<\/div>\n
16<\/div>\n
17<\/div>\n
18<\/div>\n
19<\/div>\n
20<\/div>\n<\/td>\n
\n
$xml<\/code> = <\/code>$this<\/code>->request()->getBody()->__toString();<\/code><\/div>\n
$pay<\/code> = <\/code>new<\/code> Pay();<\/code><\/div>\n
$data<\/code> = <\/code>$pay<\/code>->weChat(<\/code>$this<\/code>->wechatConfig)->verify(<\/code>$xml<\/code>);<\/code><\/div>\n
$bean<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\WeChat\\RequestBean\\Scan();<\/code><\/div>\n
$bean<\/code>->setOutTradeNo(<\/code>'CN'<\/code> . <\/code>date<\/code>(<\/code>'YmdHis'<\/code>) . rand(1000, 9999));<\/code><\/div>\n
$bean<\/code>->setOpenid(<\/code>'xxxxxx'<\/code>);<\/code><\/div>\n
$bean<\/code>->setProductId(<\/code>$data<\/code>[<\/code>'product_id'<\/code>]);<\/code><\/div>\n
$bean<\/code>->setBody(<\/code>'xxxxxx-SCAN\u6d4b\u8bd5'<\/code> . <\/code>$outTradeNo<\/code>);<\/code><\/div>\n
$bean<\/code>->setTotalFee(1);<\/code><\/div>\n
$bean<\/code>->setSpbillCreateIp(<\/code>$this<\/code>->request()->getHeader(<\/code>'x-real-ip'<\/code>)[0]);<\/code><\/div>\n
$response<\/code> = <\/code>$pay<\/code>->weChat(<\/code>$this<\/code>->wechatConfig)->scan(<\/code>$bean<\/code>);<\/code><\/div>\n
$nativeResponse<\/code> = <\/code>new<\/code> NativeResponse([<\/code><\/div>\n
'appid'<\/code> => <\/code>$this<\/code>->wechatConfig->getAppId(),<\/code><\/div>\n
'mch_id'<\/code> => <\/code>$this<\/code>->wechatConfig->getMchId(),<\/code><\/div>\n
'prepay_id'<\/code> => <\/code>$response<\/code>->getPrepayId(),<\/code><\/div>\n
'nonce_str'<\/code> => <\/code>$response<\/code>->getNonceStr()]);<\/code><\/div>\n
$u<\/code> = <\/code>new<\/code> Utility(<\/code>$this<\/code>->wechatConfig);<\/code><\/div>\n
$nativeResponse<\/code>->setSign(<\/code>$u<\/code>->generateSign(<\/code>$nativeResponse<\/code>->toArray()));<\/code><\/div>\n
$xml<\/code> = (<\/code>new<\/code> SplArray(<\/code>$nativeResponse<\/code>->toArray()))->toXML();<\/code><\/div>\n
$this<\/code>->response()->write(<\/code>$xml<\/code>);<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u6a21\u5f0f\u4e8c
<\/h4>\n
\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n
8<\/div>\n
9<\/div>\n<\/td>\n
\n
$bean<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\WeChat\\RequestBean\\Scan();<\/code><\/div>\n
$bean<\/code>->setOutTradeNo(<\/code>$outTradeNo<\/code>);<\/code><\/div>\n
$bean<\/code>->setProductId(<\/code>'123456789'<\/code>);<\/code><\/div>\n
$bean<\/code>->setBody(<\/code>'xxxx-SCAN2\u6d4b\u8bd5'<\/code> . <\/code>$outTradeNo<\/code>);<\/code><\/div>\n
$bean<\/code>->setTotalFee(1);<\/code><\/div>\n
$bean<\/code>->setSpbillCreateIp(<\/code>$this<\/code>->request()->getHeader(<\/code>'x-real-ip'<\/code>)[0]);<\/code><\/div>\n
$pay<\/code> = <\/code>new<\/code> Pay();<\/code><\/div>\n
$data<\/code> = <\/code>$pay<\/code>->weChat(<\/code>$this<\/code>->wechatConfig)->scan(<\/code>$bean<\/code>);<\/code><\/div>\n
$url2<\/code> = <\/code>$data<\/code>->getCodeUrl();<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u8ba2\u5355\u67e5\u8be2<\/h2>\n
\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n<\/td>\n
\n
go(<\/code>function<\/code> () <\/code>use<\/code> (<\/code>$wechatConfig<\/code>) {<\/code><\/div>\n
    <\/code>$orderFind<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\WeChat\\RequestBean\\OrderFind();<\/code><\/div>\n
    <\/code>$orderFind<\/code>->setOutTradeNo(<\/code>'CN201903181044383609'<\/code>);<\/code><\/div>\n
    <\/code>$pay<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\Pay();<\/code><\/div>\n
    <\/code>$info<\/code> = <\/code>$pay<\/code>->weChat(<\/code>$wechatConfig<\/code>)->orderFind(<\/code>$orderFind<\/code>);<\/code><\/div>\n
    <\/code>print_r((<\/code>array<\/code>)<\/code>$info<\/code>);<\/code><\/div>\n
});<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u7533\u8bf7\u9000\u6b3e<\/h2>\n


<\/p>\n

\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n
8<\/div>\n
9<\/div>\n
10<\/div>\n
11<\/div>\n<\/td>\n
\n
go(<\/code>function<\/code> () <\/code>use<\/code> (<\/code>$wechatConfig<\/code>) {<\/code><\/div>\n
    <\/code>$refund<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\WeChat\\RequestBean\\Refund();<\/code><\/div>\n
    <\/code>$refund<\/code>->setOutTradeNo(<\/code>'CN201903181111275823'<\/code>);<\/code><\/div>\n
    <\/code>$refund<\/code>->setOutRefundNo(<\/code>'TK'<\/code> . <\/code>date<\/code>(<\/code>'YmdHis'<\/code>) . rand(1000, 9999));<\/code><\/div>\n
    <\/code>$refund<\/code>->setTotalFee(1);<\/code><\/div>\n
    <\/code>$refund<\/code>->setRefundFee(1);<\/code><\/div>\n
    <\/code>$refund<\/code>->setNotifyUrl(<\/code>'xxxxx'<\/code>);<\/code><\/div>\n
    <\/code>$pay<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\Pay();<\/code><\/div>\n
    <\/code>$info<\/code> = <\/code>$pay<\/code>->weChat(<\/code>$wechatConfig<\/code>)->refund(<\/code>$refund<\/code>);<\/code><\/div>\n
    <\/code>print_r(<\/code>$info<\/code>);<\/code><\/div>\n
});<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u9000\u6b3e\u67e5\u8be2<\/h2>\n
\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n<\/td>\n
\n
go(<\/code>function<\/code> () <\/code>use<\/code> (<\/code>$wechatConfig<\/code>) {<\/code><\/div>\n
  <\/code>$refundFind<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\WeChat\\RequestBean\\RefundFind();<\/code><\/div>\n
  <\/code>$refundFind<\/code>->setOutTradeNo(<\/code>'CN201903181044383609'<\/code>);<\/code><\/div>\n
  <\/code>$pay<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\Pay();<\/code><\/div>\n
  <\/code>$info<\/code> = <\/code>$pay<\/code>->weChat(<\/code>$wechatConfig<\/code>)->refundFind(<\/code>$refundFind<\/code>);<\/code><\/div>\n
  <\/code>print_r((<\/code>array<\/code>)<\/code>$info<\/code>);<\/code><\/div>\n
});<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5173\u95ed\u8ba2\u5355<\/h2>\n
\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n<\/td>\n
\n
go(<\/code>function<\/code> () <\/code>use<\/code> (<\/code>$wechatConfig<\/code>) {<\/code><\/div>\n
    <\/code>$close<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\WeChat\\RequestBean\\Close();<\/code><\/div>\n
    <\/code>$close<\/code>->setOutTradeNo(<\/code>'CN201903151343107239'<\/code>);<\/code><\/div>\n
    <\/code>$pay<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\Pay();<\/code><\/div>\n
    <\/code>$info<\/code> = <\/code>$pay<\/code>->weChat(<\/code>$wechatConfig<\/code>)->close(<\/code>$close<\/code>);<\/code><\/div>\n
    <\/code>print_r((<\/code>array<\/code>)<\/code>$info<\/code>);<\/code><\/div>\n
});<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u4e0b\u8f7d\u5bf9\u8d26\u5355<\/h2>\n
go(function () use ($wechatConfig) {\r\n    $download = new \\EasySwoole\\Pay\\WeChat\\RequestBean\\Download();\r\n    $download->setBillDate('20190312');\r\n    $download->setBillType('ALL');\/\/\u8fd9\u4e2a\u53c2\u6570\u5fc5\u4f20\r\n    $pay = new \\EasySwoole\\Pay\\Pay();\r\n    $info = $pay->weChat($wechatConfig)->download($download);\r\n    echo htmlspecialchars($info, ENT_QUOTES);});<\/pre>\n

\u4e0b\u8f7d\u8d44\u91d1\u5bf9\u8d26\u5355<\/h2>\n
\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n
6<\/div>\n
7<\/div>\n
8<\/div>\n<\/td>\n
\n
go(<\/code>function<\/code> () <\/code>use<\/code> (<\/code>$wechatConfig<\/code>) {<\/code><\/div>\n
    <\/code>$download<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\WeChat\\RequestBean\\DownloadFundFlow();<\/code><\/div>\n
    <\/code>$download<\/code>->setBillDate(<\/code>'20190312'<\/code>);<\/code><\/div>\n
    <\/code>$download<\/code>->setAccountType(<\/code>'Basic'<\/code>);<\/code><\/div>\n
    <\/code>$pay<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\Pay();<\/code><\/div>\n
    <\/code>$info<\/code> = <\/code>$pay<\/code>->weChat(<\/code>$wechatConfig<\/code>)->downloadFundFlow(<\/code>$download<\/code>);<\/code><\/div>\n
    <\/code>echo<\/code> htmlspecialchars(<\/code>$info<\/code>, ENT_QUOTES);<\/code><\/div>\n
});<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u9a8c\u8bc1\u7b7e\u540d<\/h2>\n
\n\n
\n
\n
1<\/div>\n
2<\/div>\n
3<\/div>\n
4<\/div>\n<\/td>\n
\n
$pay<\/code> = <\/code>new<\/code> \\EasySwoole\\Pay\\Pay();<\/code><\/div>\n
$content<\/code> = <\/code>''<\/code>;<\/code><\/div>\n
\/\/content\u4e3axml\u539f\u59cb\u6570\u636e,\u5728easyswoole\u4e2d\u53ef\u901a\u8fc7$this->request()->getBody()->__toString()\u53d6\u51fa<\/code><\/div>\n
$data<\/code> = <\/code>$pay<\/code>->weChat(<\/code>$wechatConfig<\/code>)->verify(<\/code>$content<\/code>)<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u670d\u52a1\u5668\u786e\u8ba4\u6536\u5230\u5f02\u6b65\u901a\u77e5\u5b57\u7b26\u4e32\u83b7\u53d6<\/h2>\n
\n\n
\n
\n
1<\/div>\n
2<\/div>\n<\/td>\n
\n
\\EasySwoole\\Pay\\WeChat\\WeChat::success();<\/code>\/\/\u6210\u529f\u54cd\u5e94<\/code><\/div>\n
\\EasySwoole\\Pay\\WeChat\\WeChat::fail();<\/code>\/\/\u5931\u8d25\u54cd\u5e94<\/code><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n


<\/p>\n


<\/p>\n

\u672c\u6587\u8f6c\u81ea <\/span>www.easyswoole.com<\/a> \u5b98\u65b9\u6587\u6863<\/span><\/p>\n

<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5728easyswoole\u4e2d,\u5df2\u7ecf\u5f00\u53d1\u597d\u4e86\u76f8\u5173\u7684\u652f\u4ed8\u7ec4\u4ef6,\u53ea\u9700\u8981\u5f15\u5165\u5373\u53ef: 1 composer req […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,12,47],"tags":[],"class_list":["post-1242","post","type-post","status-publish","format-standard","hentry","category-php","category-12","category-weipay"],"_links":{"self":[{"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/posts\/1242"}],"collection":[{"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/comments?post=1242"}],"version-history":[{"count":1,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/posts\/1242\/revisions"}],"predecessor-version":[{"id":1243,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/posts\/1242\/revisions\/1243"}],"wp:attachment":[{"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/media?parent=1242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/categories?post=1242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/tags?post=1242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}