{"id":966,"date":"2023-08-31T16:37:00","date_gmt":"2023-08-31T08:37:00","guid":{"rendered":"https:\/\/open-doc.jkos.com\/?docs=%e7%b7%9a%e4%b8%8a%e6%94%af%e4%bb%98onlinepay\/%e4%b8%b2%e6%8e%a5%e8%aa%aa%e6%98%8e\/app-%e4%b8%b2%e6%8e%a5-onlinepay"},"modified":"2023-08-31T16:39:00","modified_gmt":"2023-08-31T08:39:00","slug":"app-%e4%b8%b2%e6%8e%a5-onlinepay","status":"publish","type":"docs","link":"https:\/\/open-doc.jkos.com\/?docs=%e7%b7%9a%e4%b8%8a%e6%94%af%e4%bb%98onlinepay\/%e4%b8%b2%e6%8e%a5%e8%aa%aa%e6%98%8e\/app-%e4%b8%b2%e6%8e%a5-onlinepay","title":{"rendered":"App \u4e32\u63a5 OnlinePay"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>\u4ee5\u4e0b\u6703\u8aaa\u660e\u5728\u4e32\u8857\u65b9 APP \u958b\u767c\u4e32\u63a5 OnlinePay \uff0c\u6d41\u7a0b\u8207\u9700\u8981\u5728\u610f\u7684\u4e8b\u9805\uff0c\u8acb\u4e0d\u7528\u64d4\u5fc3\uff0c\u8a72\u9023\u7d50\u4e26\u4e0d\u6703\u8ffd\u8e64\u6216\u662f\u984d\u5916\u958b\u555f\u5ee3\u544a\uff0c\u8a72\u9023\u7d50\u6703\u5617\u8a66\u78ba\u8a8d\u4f7f\u7528\u8005\u624b\u6a5f\u662f\u5426\u64c1\u6709\u8857\u53e3\uff0c\u4e26\u524d\u5f80\u61c9\u524d\u5f80\u4e4b\u6d41\u7a0b\u3002<\/p>\n\n\n\n<p>\u6ce8\u610f\uff1a\u5982\u679c\u662f APP \u958b\u767c\u4eba\u54e1\uff0c\u8acb\u5118\u91cf\u4e0d\u8981\u8207 APP \u5167\u5d4c WebView \u53c3\u8207\u5230\u6d41\u7a0b\uff0c\u78ba\u4fdd Deeplink \u5916\u958b\u800c\u4e0d\u88ab APP \u5167\u5d4c\u7684 WebView \u5403\u8d70\u8a02\u55ae\u9023\u7d50 \uff0c\u7121\u6cd5\u958b\u555f\u8857\u53e3 APP \u7684\u72c0\u6cc1<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Android<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>\u7576\u4f7f\u7528\u8a02\u55ae\u5275\u5efa\u8fd4\u56de\u53c3\u6578 payment_url \u4f5c\u70ba\u8df3\u8f49\u9023\u7d50\u3002(<a href=\"https:\/\/open-doc.jkos.com\/?docs=%e7%b7%9a%e4%b8%8a%e6%94%af%e4%bb%98onlinepay\/api%e5%88%97%e8%a1%a8\/%e8%a8%82%e5%96%ae%e5%89%b5%e5%bb%ba-api#fan_hui_can_shu_Response_JSON_Body\">\u8a02\u55ae\u5275\u5efa API #\u8fd4\u56de\u53c3\u6578<\/a>)<\/li><li>\u53d6\u5f97\u8df3\u8f49\u9023\u7d50\u5f8c\uff0c\u5229\u7528 Intent \u76f4\u63a5\u5916\u958b\u3002<\/li><li>\u5916\u958b\u5f8c\u8a72 URL \u5c07\u6703\u81ea\u52d5\u5224\u65b7\u662f\u5426\u64c1\u6709\u8857\u53e3\u652f\u4ed8<ol><li>\u6709\u8857\u53e3\uff1a\u6703\u76f4\u63a5\u958b\u555f\u8857\u53e3\u652f\u4ed8<\/li><li>\u7121\u8857\u53e3\uff1a\u5c07\u6703\u524d\u5f80 Google Play \u4e26\u958b\u555f\u8857\u53e3 APP \u53ef\u4f9b\u4e0b\u8f09<\/li><\/ol><\/li><li>\u56e0(<a href=\"https:\/\/open-doc.jkos.com\/?docs=%e7%b7%9a%e4%b8%8a%e6%94%af%e4%bb%98onlinepay\/api%e5%88%97%e8%a1%a8\/%e8%a8%82%e5%96%ae%e5%89%b5%e5%bb%ba-api#fan_hui_can_shu_Response_JSON_Body\">\u8a02\u55ae\u5275\u5efa API #\u8fd4\u56de\u53c3\u6578<\/a>) \u5728\u5efa\u7acb\u8a02\u55ae API \u6642\u5c31\u5df2\u7d93\u9700\u8981\u63d0\u4f9b\u56de\u5230 APP \u7684 Deeplink URL \uff0c\u6240\u4ee5\u4e0d\u61c9\u5229\u7528 startActivityForResult \u4f86\u7b49\u5f85\u56de\u5230 APP \u4e2d\uff0c\u4f46\u53ef\u80fd\u56e0\u70ba\u958b\u767c\u9700\u6c42\uff0c\u60a8\u53ef\u4ee5\u5617\u8a66\u4f7f\u7528\uff0c\u4f46\u4e0d\u5efa\u8b70\u5982\u6b64\u4f7f\u7528\uff0c\u6709\u9ad8\u6a5f\u7387\u7121\u6cd5\u4f7f\u7528\u3002<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\"> \/\/ \u4f60\u60f3\u8981\u958b\u555f\u7684 URL\n val url = \"payment URL\"\n\n \/\/ \u5275\u5efa\u4e00\u500b Intent \u4f86\u958b\u555f\u7db2\u9801\n val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))\n startActivity(intent)<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">iOS<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>\u7576\u4f7f\u7528\u8a02\u55ae\u5275\u5efa\u8fd4\u56de\u53c3\u6578 payment_url \u4f5c\u70ba\u8df3\u8f49\u9023\u7d50\u3002(<a href=\"https:\/\/open-doc.jkos.com\/?docs=%e7%b7%9a%e4%b8%8a%e6%94%af%e4%bb%98onlinepay\/api%e5%88%97%e8%a1%a8\/%e8%a8%82%e5%96%ae%e5%89%b5%e5%bb%ba-api#fan_hui_can_shu_Response_JSON_Body\">\u8a02\u55ae\u5275\u5efa API #\u8fd4\u56de\u53c3\u6578<\/a>)<\/li><li>\u53d6\u5f97\u8df3\u8f49\u9023\u7d50\u5f8c\uff0c\u5229\u7528 open \u76f4\u63a5\u5916\u958b\u3002<\/li><li>\u5916\u958b\u5f8c\u8a72 URL \u5c07\u6703\u81ea\u52d5\u5224\u65b7\u662f\u5426\u64c1\u6709\u8857\u53e3\u652f\u4ed8<ol><li>\u6709\u8857\u53e3\uff1a\u6703\u76f4\u63a5\u958b\u555f\u8857\u53e3\u652f\u4ed8<\/li><li>\u7121\u8857\u53e3\uff1a\u5c07\u6703\u524d\u5f80 APP store \u4e26\u958b\u555f\u8857\u53e3 APP \u53ef\u4f9b\u4e0b\u8f09<\/li><\/ol><\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">if let url = URL(string: \"payment URL\") {\n            UIApplication.shared.open(url, options: [:],completionHandler: nil)\n        }<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u6700\u5f8c\u88dc\u5145<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u5982\u679c\u958b\u767c\u4eba\u54e1\u4e00\u5b9a\u8981\u4f7f\u7528 WebView \u958b\u767c\uff0c\u5efa\u8b70\u5728\u53d6\u5f97 URL \u5f8c\uff0c\u5728 URL \u8f49\u9801\u4e4b\u524d\u5c31\u5229\u7528\u4e0d\u540c\u65b9\u6848\u5c07 URL \u7576\u4f5c\u4e00\u500b\u5b57\u4e32\u62cb\u5411 APP \u539f\u751f\u7cfb\u7d71\uff0c\u8b93 APP \u539f\u751f\u7cfb\u7d71\u53ef\u76f4\u63a5\u4e0a\u8ff0\u65b9\u6848\u5916\u958b\u3002<\/li><li>\u7279\u6b8a\u4f8b\u5916\u72c0\u6cc1\uff1a\u5728\u4e0d\u540c\u7684\u7cfb\u7d71\u4e0b\uff0c\u53ef\u80fd\u6703\u56e0\u70ba\u700f\u89bd\u5668\u7684\u7cfb\u7d71\u8df3\u8f49\u554f\u984c\u5c0e\u81f4\u7121\u6cd5\u5373\u6642\u9032\u5165\u5230\u8857\u53e3\u652f\u4ed8\u4e2d\uff0c\u4f46\u700f\u89bd\u5668\u7db2\u9801\u5c07\u6703\u5448\u73fe\u9032\u5165\u8857\u53e3\u652f\u4ed8\u7684\u756b\u9762\uff0c\u4f7f\u7528\u8005\u5f97\u4ee5\u5728\u756b\u9762\u4e2d\u6309\u4e0b\u524d\u5f80\uff0c\u5373\u53ef\u6b63\u78ba\u9032\u5165\u8857\u53e3\u652f\u4ed8\u3002<\/li><\/ul>\n\n\n\n<p><\/p>\n","protected":false},"featured_media":0,"parent":43,"menu_order":3,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-966","docs","type-docs","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=\/wp\/v2\/docs\/966","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=966"}],"version-history":[{"count":2,"href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=\/wp\/v2\/docs\/966\/revisions"}],"predecessor-version":[{"id":969,"href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=\/wp\/v2\/docs\/966\/revisions\/969"}],"up":[{"embeddable":true,"href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=\/wp\/v2\/docs\/43"}],"next":[{"title":"Web \u4e32\u63a5 OnlinePay","link":"https:\/\/open-doc.jkos.com\/?docs=%e7%b7%9a%e4%b8%8a%e6%94%af%e4%bb%98onlinepay\/%e4%b8%b2%e6%8e%a5%e8%aa%aa%e6%98%8e\/web-%e9%96%8b%e7%99%bc-onlinepay","href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=\/wp\/v2\/docs\/958"}],"prev":[{"title":"\u5e38\u898b\u554f\u984c (Q&A)","link":"https:\/\/open-doc.jkos.com\/?docs=%e7%b7%9a%e4%b8%8a%e6%94%af%e4%bb%98onlinepay\/%e4%b8%b2%e6%8e%a5%e8%aa%aa%e6%98%8e\/%e5%b8%b8%e8%a6%8b%e5%95%8f%e9%a1%8c","href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=\/wp\/v2\/docs\/524"}],"wp:attachment":[{"href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=966"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/open-doc.jkos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=966"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}