{"id":4382,"date":"2017-01-01T19:27:57","date_gmt":"2017-01-01T11:27:57","guid":{"rendered":"http:\/\/blog.qdac.cc\/?p=4382"},"modified":"2017-01-05T21:40:07","modified_gmt":"2017-01-05T13:40:07","slug":"%e6%95%99%e7%a8%8bdelphi-%e4%b8%8b%e7%9a%84%e7%a7%bb%e5%8a%a8%e7%bc%96%e7%a8%8b%e4%b9%8b%e7%95%aa%e5%a4%96%e7%af%87%ef%bc%9a%e7%a7%bb%e5%8a%a8%e6%94%af%e4%bb%98%ef%bc%88%e5%be%ae%e4%bf%a1%e3%80%81","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=4382","title":{"rendered":"[\u6559\u7a0b]Delphi \u4e0b\u7684\u79fb\u52a8\u7f16\u7a0b\u4e4b\u756a\u5916\u7bc7\uff1a\u79fb\u52a8\u652f\u4ed8\uff08\u5fae\u4fe1\u3001\u652f\u4ed8\u5b9d\uff09\u96c6\u6210\u6559\u7a0b\u53ca\u5b9e\u4f8b"},"content":{"rendered":"<h4>\u3010\u4ef7\u683c\u3011<\/h4>\n<p>\u4ee5\u4eba\u6c11\u5e01\u8ba1\u4ef7\uff1a<\/p>\n<p>\u4e2a\u4eba\u7528\u6237\uff1a50\u5143<\/p>\n<p>\u4f01\u4e1a\u7528\u6237\uff1a300\u5143<\/p>\n<p>&nbsp;<\/p>\n<h4>\u3010\u89c6\u9891\u957f\u5ea6\u3011<\/h4>\n<p>29 \u5206\u949f<\/p>\n<h4>\u3010\u89c6\u9891\u8bed\u8a00\u3011<\/h4>\n<p>\u4e2d\u6587\uff0c\u666e\u901a\u8bdd<\/p>\n<h4>\u3010\u89c6\u9891\u7f16\u7801\u3011<\/h4>\n<p>\u683c\u5f0f\uff1aH.264 MP4<\/p>\n<p>\u5206\u8fa8\u7387:1920\u00d71080<\/p>\n<h4>\u3010\u6559\u7a0b\u6e90\u7801\u3011<\/h4>\n<p>\u5305\u542b\u5fae\u4fe1\u548c\u652f\u4ed8\u5b9d\u652f\u4ed8\u7684 Delphi \u793a\u4f8b\uff0c\u4ee5\u53ca\u79fb\u52a8\u652f\u4ed8\u96c6\u6210\u5411\u5bfc\u5de5\u5177\u6e90\u7801<\/p>\n<h4>\u3010\u4e0a\u67b6\u65f6\u95f4\u3011<\/h4>\n<p>2017 \u5e74 1\u00a0\u6708 1\u00a0\u65e5<\/p>\n<h4>\u3010\u4ed8\u6b3e\u65b9\u5f0f\u3011<\/h4>\n<ol>\n<li>\u7533\u8bf7\u52a0\u5165 QDAC \u89c6\u9891\u4ed8\u8d39\u6559\u7a0b\u7fa4 \uff1a201867767\uff1b<\/li>\n<li>\u627e\u5230\u4e0b\u9762\u89c6\u9891\u7684\u4ef7\u683c\uff0c\u7136\u540e\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u4ed8\u8d39\uff1a<br \/>\n<strong>[\u6dd8\u5b9d]<\/strong><br \/>\n<a href=\"https:\/\/item.taobao.com\/item.htm?spm=a1z10.5-c.w4002-1192446788.39.vkZxxL&amp;id=543924465228\" target=\"_blank\">\u8bbf\u95ee\u6dd8\u5b9d\u5e97\u94fa<\/a>\uff08\u8bf7\u5907\u6ce8QQ\u53f7\uff09<br \/>\n<strong>[\u652f\u4ed8\u5b9d]<\/strong><br \/>\nguansonghuan@sina.com \u59d3\u540d\uff1a\u7ba1\u8038\u5bf0\uff08\u8bf7\u6807\u660eQQ\u53f7\uff09<br \/>\n<strong>[QQ]<\/strong><br \/>\n\u76f4\u63a5\u7fa4\u652f\u4ed8\uff0c\u6216\u7ed9\u7fa4\u4e3b\u53d1\u7ea2\u5305<br \/>\n<strong>[\u5fae\u4fe1]<\/strong><br \/>\n\u53d1\u9001\u7ea2\u5305\u6216\u8f6c\u8d26\u81f3\uff1awangshengbo<br \/>\n<strong>[\u94f6\u884c\u5361]<\/strong><br \/>\n\u5149\u5927\u94f6\u884c\uff1a<br \/>\n\u6237\u540d\uff1a\u738b\u80dc\u6ce2<br \/>\n\u8d26\u53f7\uff1a6226\u00a06208\u00a00391\u00a05552<br \/>\n\u5f00\u6237\u884c\uff1a\u5149\u5927\u94f6\u884c\u957f\u6625\u4eba\u6c11\u5927\u8857\u652f\u884c<br \/>\n\u4ed8\u8d39\u540e\uff0c\u8bf7\u7528 QQ \u7ed9\u7fa4\u4e3b\u53d1\u9001\u6d88\u606f\uff0c\u7fa4\u4e3b\u4f1a\u5c06\u89c6\u9891\u7684\u901a\u8fc7 QQ \u79bb\u7ebf\u53d1\u9001\u7ed9\u4f60\u3002<\/li>\n<li>\u8bf7\u53ca\u65f6\u4e0b\u8f7d\u89c6\u9891\u5230\u60a8\u81ea\u5df1\u7684\u7f51\u76d8\u6216\u672c\u5730\uff0c\u7136\u540e\u4f7f\u7528\u666e\u901a\u7684\u89c6\u9891\u64ad\u653e\u5668\u64ad\u653e\u3002<\/li>\n<\/ol>\n<h4>\u3010\u7248\u6743\u63d0\u793a\u3011<\/h4>\n<p>\u89c6\u9891\u7248\u6743\u5f52\u89c6\u9891\u5236\u4f5c\u8005\u6240\u6709\uff0c\u4ec5\u9650\u4f60\u81ea\u5df1\u89c2\u770b\uff0c\u8bf7\u52ff\u8bf7\u89c6\u9891\u516c\u5f00\u53d1\u5e03\u5230\u7f51\u7edc\u3002\u4e00\u65e6\u53d1\u73b0\u4f20\u64ad\uff0c\u5c31\u4f1a\u53d6\u6d88\u60a8\u7684\u540e\u7eed\u8d2d\u4e70\u8d44\u683c\uff0c\u5e76\u4e0d\u4f1a\u9000\u8fd8\u5df2\u7ecf\u652f\u4ed8\u7684\u8d39\u7528\u3002<\/p>\n<h4>\u3010\u5185\u5bb9\u76ee\u5f55\u3011<\/h4>\n<p>\u4e00\u3001\u79fb\u52a8\u5f00\u53d1\u57fa\u672c\u6b65\u9aa4<\/p>\n<p>\u4e8c\u3001\u79fb\u52a8\u652f\u4ed8\u5f00\u53d1\u524d\u7684\u51c6\u5907\u5de5\u4f5c<\/p>\n<p>\u4e09\u3001\u914d\u7f6e\u4f60\u7684\u5e94\u7528\u4ee5\u652f\u6301\u79fb\u52a8\u652f\u4ed8<\/p>\n<p>\u56db\u3001\u79fb\u52a8\u652f\u4ed8\u793a\u4f8b\u8be6\u89e3<\/p>\n<ul>\n<li>\u6536\u94f6\u53f0\u5355\u5143\u5185\u5bb9\u8be6\u89e3\uff08weipay.pas\uff09<\/li>\n<li>\u5b9e\u73b0 IPaymentService \u4ee5\u751f\u6210\u8ba2\u5355\u548c\u901a\u77e5\u652f\u4ed8\u7ed3\u679c<\/li>\n<li>\u5fae\u4fe1\u652f\u4ed8\u5b9e\u9645\u6548\u679c\u5c55\u793a<\/li>\n<\/ul>\n<p>\u4e94\u3001\u603b\u7ed3<\/p>\n<h4>\u3010\u5fae\u4fe1\u652f\u4ed8\/\u652f\u4ed8\u5b9d\u652f\u4ed8\u670d\u52a1\u5668\u7aef\u4ee3\u7801\u8bf4\u660e\u3011<\/h4>\n<p>1\u3001\u9996\u5148\u4f60\u8981\u4e0b\u8f7d\u5b98\u65b9\u7684SDK\uff0c\u4ee5PHP\u7248\u4e3a\u4f8b\uff0c\u81f3\u4e8e\u5176\u5b83\u8bed\u8a00\u7684\u4ee3\u7801\uff0c\u8bf7\u81ea\u884c\u53c2\u8003\u5b98\u65b9\u7684 SDK \u7f16\u5199\uff1b<\/p>\n<p>2\u3001\u5fae\u4fe1<\/p>\n<p style=\"padding-left: 30px;\">2.1\u3001\u5f15\u5165 lib\/WxPay.Api.php \u6587\u4ef6\uff1b<\/p>\n<p style=\"padding-left: 30px;\">2.2\u3001\u521b\u5efa WxPayUnifiedOrder \u5bf9\u8c61\u5b9e\u4f8b\uff0c\u5e76\u8c03\u7528SetOut_trade_no \u8bbe\u7f6e\u81ea\u5df1\u7684\u8ba2\u5355ID\u3001SetBody \u8bbe\u7f6e\u4ea4\u6613\u63cf\u8ff0\u3001SetTotal_fee \u8bbe\u7f6e\u91d1\u989d\uff0cSetTrade_type \u4e3a APP\uff0cSetNotify_url \u8bbe\u7f6e\u7ed3\u679c\u901a\u77e5Url\uff08\u8fd9\u6b65\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u5c3d\u91cf\u8981\uff09\uff0c\u7136\u540e\u8c03\u7528 WxPayApi::unifiedOrder\u5c06\u521b\u5efa\u7684 WxPayUnifiedOrder \u5bf9\u8c61\u505a\u4e3a\u53c2\u6570\u4f20\u5165\uff0c\u53d6\u7ed3\u679c\u7684 &#8220;result_code&#8221;\u662f\u5426\u7b49\u4e8e&#8221;SUCCESS&#8221;\uff0c\u5982\u679c\u662f\uff0c\u53d6\u7ed3\u679c\u6570\u7ec4\u4e2d&#8221;prepay_id&#8221; \u7684\u503c\u505a\u4e3a\u8fd4\u56de\u503c\u7684\u4e00\u90e8\u5206\u3002<\/p>\n<p style=\"padding-left: 30px;\">2.3\u3001\u521b\u5efaWxPayResults \u5bf9\u8c61\u7684\u5b9e\u4f8b\uff0c\u5e76\u8c03\u7528 WxPayApi::getNonceStr \u751f\u6210\u4e00\u4e2anoncestr\uff0c\u7136\u540e\u83b7\u53d6Unix\u683c\u5f0f\u7684\u5f53\u524d\u65f6\u95f4\u6233\uff08PHP \u901a\u8fc7 date_create()-&gt;getTimestamp()\u53ef\u4ee5\u53d6\u5f97\uff09\uff0c\u7136\u540e\u5c06\u5fae\u4fe1appid\u3001\u5546\u6237partnerid\u3001\u524d\u4e00\u6b65\u7684\u9884\u652f\u4ed8prepayid\u3001\u968f\u673a\u5b57\u7b26\u4e32noncestr\u3001package\uff08\u56fa\u5b9a\u4e3aSign=WXPay\uff09\u548c\u65f6\u95f4\u6233 timestamp\u53c2\u6570\u901a\u8fc7SetData\u4f20\u5230WxPayResults\u5bf9\u8c61\u91cc\uff0c\u7136\u540e\u8c03\u7528\u5bf9\u8c61\u7684makeSign\u751f\u6210\u7b7e\u540d\uff0c\u5c06\u8fd9\u4e9b\u53c2\u6570\u4f20\u56de\u5ba2\u6237\u7aef\uff0c\u7528\u4e8e\u8c03\u8d77\u5fae\u4fe1\u652f\u4ed8\u3002<\/p>\n<p>3\u3001\u652f\u4ed8\u5b9d\u652f\u4ed8<\/p>\n<p style=\"padding-left: 30px;\">3.1\u3001\u5f15\u5165\u652f\u4ed8\u5b9dSDK \u7684AopSdk.php \u6587\u4ef6\uff1b<\/p>\n<p style=\"padding-left: 30px;\">3.2\u3001\u521b\u5efa AopClient\u5bf9\u8c61\u7684\u5b9e\u4f8b\uff0c\u5e76\u914d\u7f6e\u5b83\u7684gatewayUrl\u4e3a&#8221;https:\/\/openapi.alipay.com\/gateway.do&#8221;\uff08\u9ed8\u8ba4\u503c\u5c31\u662f\uff0c\u53ef\u4ee5\u4e0d\u7ba1\uff09\uff0cappId \u4e3a\u4f60\u7684\u652f\u4ed8\u5b9d\u5e94\u7528Id\uff0calipayrsaPublicKey\u8bbe\u7f6e\u4e3a\u4f60\u5e94\u7528\u7684\u652f\u4ed8\u5b9d\u516c\u94a5\uff08\u6ce8\u610f\u4e0d\u662f\u5e94\u7528\u516c\u94a5\uff09\uff0crasPrivateKey\u4e3a\u4f60\u7684\u79c1\u94a5\u3002<\/p>\n<p style=\"padding-left: 30px;\">3.3\u3001\u521b\u5efa AlipayTradeAppPayRequest \u5bf9\u8c61\uff0c\u8c03\u7528\u5b83\u7684setBizContent\u8bbe\u7f6e\u4ea4\u6613\u5185\u5bb9\uff0cJSON\u683c\u5f0f\uff0c\u5185\u5bb9\u8981\u81f3\u5c11\u5305\u542b subject(\u5bf9\u5e94\u5fae\u4fe1\u7684body)\u3001out_trade_no(\u5546\u6237\u8ba2\u5355ID\uff09\u3001total_amount\uff08\u91d1\u989d\uff09\u3001product_code\uff08\u56fa\u5b9a\u4e3aQUICK_MSECURITY_PAY\uff09\uff0c\u7136\u540e\u5f53\u505a\u53c2\u6570\u8c03\u75283.2\u4e2d\u521b\u5efa\u5bf9\u8c61\u7684sdkExecute\uff0c\u751f\u6210\u8c03\u8d77\u652f\u4ed8\u5b9d\u9700\u8981\u7684\u652f\u4ed8\u5b57\u7b26\u4e32\uff0c\u5c06\u8fd9\u4e2a\u5b57\u7b26\u4e32\u8fd4\u56de\u5ba2\u6237\u7aef\uff0c\u4f9bAlipayService.Pay\u8c03\u7528\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<p style=\"padding-left: 30px;\">3.4\u3001\u6ce8\u610f\u4e00\u5b9a\u8981\u4e0a\u7ebf\u5e94\u7528\u624d\u80fd\u6d4b\u8bd5\u3002<\/p>\n<p>\u5bf9\u4e8e\u751f\u6210\u8ba2\u5355\u53f7\u548c\u8c03\u7528\u8fd9\u4e9b\u63a5\u53e3\u540e\u5982\u4f55\u5904\u7406\u4f60\u81ea\u5df1\u7684\u6570\u636e\u5b58\u8d2e\uff0c\u4e0d\u5728\u672c\u6559\u7a0b\u7684\u8303\u56f4\uff0c\u5927\u5bb6\u8bf7\u81ea\u5df1\u5904\u7406\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3010\u4ef7\u683c\u3011 \u4ee5\u4eba\u6c11\u5e01\u8ba1\u4ef7\uff1a \u4e2a\u4eba\u7528\u6237\uff1a50 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[145,69,8,602,603],"tags":[650,695,697,501,696],"class_list":["post-4382","post","type-post","status-publish","format-standard","hentry","category-android","category-c-builder","category-delphi","category-ios","category-603","tag-650","tag-695","tag-697","tag-501","tag-696"],"views":6566,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/4382","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4382"}],"version-history":[{"count":8,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/4382\/revisions"}],"predecessor-version":[{"id":4405,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/4382\/revisions\/4405"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4382"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}