{"id":6410,"date":"2020-07-02T18:27:48","date_gmt":"2020-07-02T09:27:48","guid":{"rendered":"https:\/\/arms-jp.com\/cambodia\/?p=6410"},"modified":"2020-07-02T19:11:18","modified_gmt":"2020-07-02T10:11:18","slug":"%e3%82%af%e3%83%ac%e3%82%b8%e3%83%83%e3%83%88%e3%82%ab%e3%83%bc%e3%83%89%e3%81%a7%e5%af%84%e4%bb%98%e3%81%a7%e3%81%8d%e3%82%8b%e3%82%88%e3%81%86pay-jp%e3%82%92%e5%ae%9f%e8%a3%85%e3%81%99%e3%82%8b-part","status":"publish","type":"post","link":"https:\/\/arms-jp.com\/cambodia\/2020\/07\/02\/%e3%82%af%e3%83%ac%e3%82%b8%e3%83%83%e3%83%88%e3%82%ab%e3%83%bc%e3%83%89%e3%81%a7%e5%af%84%e4%bb%98%e3%81%a7%e3%81%8d%e3%82%8b%e3%82%88%e3%81%86pay-jp%e3%82%92%e5%ae%9f%e8%a3%85%e3%81%99%e3%82%8b-part\/","title":{"rendered":"\u30af\u30ec\u30b8\u30c3\u30c8\u30ab\u30fc\u30c9\u3067\u5bc4\u4ed8\u3067\u304d\u308b\u3088\u3046PAY.JP\u3092\u5b9f\u88c5\u3059\u308b part.2"},"content":{"rendered":"\n<p>\u7d50\u69cb\u3001<a href=\"https:\/\/arms-jp.com\/cambodia\/2018\/11\/10\/%e3%82%af%e3%83%ac%e3%82%b8%e3%83%83%e3%83%88%e3%82%ab%e3%83%bc%e3%83%89%e3%81%a7%e5%af%84%e4%bb%98%e3%81%a7%e3%81%8d%e3%82%8b%e3%82%88%e3%81%86pay-jp%e3%82%92%e5%ae%9f%e8%a3%85%e3%81%99%e3%82%8b\/\">PAY.JP\u306e\u5b9f\u88c5<\/a>\u3067\u8a2a\u554f\u3055\u308c\u308b\u65b9\u304c\u591a\u3044\u3088\u3046\u306a\u306e\u3067\u3082\u3046\u3061\u3087\u3063\u3068\u8a73\u3057\u304f\u66f8\u3044\u3066\u304a\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u307e\u305a\u3001\u79c1\u304c\u6c42\u3081\u3066\u3044\u305f\u3053\u3068<\/p>\n\n\n\n<ul><li>\u5165\u529b\u3057\u305f\u4efb\u610f\u306e\u91d1\u984d\u3067\u5bc4\u4ed8\u3067\u304d\u308b<\/li><li>\u6570\u7a2e\u985e\u306e\u6708\u984d\u30fb\u5e74\u984d\u306e\u4f1a\u8cbb\u3001\u5b9a\u671f\u8ab2\u91d1<\/li><li>\u304a\u540d\u524d\u30fb\u4f4f\u6240\u30fb\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u7b49\u306e\u60c5\u5831\u53d6\u5f97<\/li><\/ul>\n\n\n\n<p>\u304f\u3089\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n\n\n\n<p>\u591a\u5206\u307f\u306a\u3055\u3093\u3001\u30c1\u30a7\u30c3\u30af\u30a2\u30a6\u30c8\u3092\u30a6\u30a7\u30d6\u30da\u30fc\u30b8\u306b\u8cbc\u308a\u4ed8\u3051\u308b\u3068\u304b\u306f\u3064\u307e\u3065\u304b\u306a\u3044\u3068\u601d\u3046\u306e\u3067\u3001PHP\u3067\u66f8\u3044\u305f\u30b3\u30fc\u30c9\u3092\u53c2\u8003\u307e\u3067\u306b\u306e\u305b\u3066\u304a\u304d\u307e\u3059\u3002<br>\u6642\u9593\u306b\u3086\u3068\u308a\u304c\u3067\u304d\u305f\u3089\u3082\u3046\u5c11\u3057\u8a73\u3057\u304f\u8ffd\u8a18\u3057\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\nadd_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );\nfunction theme_enqueue_styles() {\n  wp_enqueue_style( 'parent-style', get_template_directory_uri() . '\/style.css' );\n  wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '\/style.css', array('parent-style')\n);\n}\n\/**\n * @param MW_WP_Form_Data $Data\n *\/\nfunction my_mwform_after_send( $Data ) {\n\/\/ \u3054\u5bc4\u4ed8\u30d5\u30a9\u30fc\u30e0\u306e\u6c7a\u6e08\u51e6\u7406\nrequire_once 'init.php';\n \n\/\/\u25c6\u652f\u6255\u3044\u4ee5\u5916\u306e\u30a2\u30af\u30bb\u30b9\u306f\u5f3e\u304f\nif (!isset($_POST&#91;'payjp-token'])) {\n    echo \"\u30af\u30ec\u30b8\u30c3\u30c8\u30ab\u30fc\u30c9\u60c5\u5831\u304c\u672a\u5165\u529b\u3067\u3059\";\n    exit;\n}\n \n\/\/\u5931\u6557\u6642\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\n$err            = '';\n\/\/\u9001\u3089\u308c\u3066\u304d\u305f\u3001\u9867\u5ba2\u306e\u30ab\u30fc\u30c9\u60c5\u5831\u3092\u4f7f\u3063\u3066\u4f5c\u6210\u3055\u308c\u305f\u30c8\u30fc\u30af\u30f3\n$token          = $_POST&#91;'payjp-token'];\n\/\/\u3054\u5bc4\u4ed8\u91d1\u984d\n$amount = $_POST&#91;'donation'];\n\/\/\u540d\u524d\n$description = $_POST&#91;'your-name'];\n\/\/\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\n$email = $_POST&#91;'your-email'];\n\/\/\u79d8\u5bc6\u9375\n$secret = 'sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx';\n\/\/\u901a\u8ca8(\u901a\u5e38\u306f\u65e5\u672c\u5186\u3092\u8868\u3059'jpy'\u3092\u6307\u5b9a\u3059\u308b)\n$currency = 'jpy';\n\/\/\u5b9a\u671f\u8ab2\u91d1\u30d7\u30e9\u30f3\n$kaiin = $_POST&#91;'member'];\nswitch ($kaiin){\ncase 'A. \u8cdb\u52a9\u4f1a\u54e1\uff08\u5e74\u984d3000\u5186\uff09':\n$plan = 'pln_xxxxxxxxxxxxxxxxxxxxxxxxxxxx'; \/\/\u5e74\u984d3,000\u5186\nbreak;\ncase 'B. \u8cdb\u52a9\u4f1a\u54e1\uff08\u5e74\u984d6000\u5186\uff09':\n$plan = 'pln_xxxxxxxxxxxxxxxxxxxxxxxxxxxx';\t\/\/\u5e74\u984d6,000\u5186\nbreak;\ncase 'C. \u6b63\u4f1a\u54e1\uff08\u5e74\u984d10000\u5186\uff09':\n$plan = 'pln_xxxxxxxxxxxxxxxxxxxxxxxxxxxx';\t\/\/\u5e74\u984d10,000\u5186\nbreak;\ncase 'D. \u6cd5\u4eba\u4f1a\u54e1\uff08\u5e74\u984d30000\u5186\uff09':\n$plan = 'pln_xxxxxxxxxxxxxxxxxxxxxxxxxxxx';\t\/\/\u5e74\u984d30,000\u5186\nbreak;\ncase 'E. \u7279\u5225\u652f\u63f4\u4f1a\u54e1\uff08\u6708\u984d5000\u5186\uff09':\n$plan = 'pln_xxxxxxxxxxxxxxxxxxxxxxxxxxxx';\t\/\/\u6708\u984d5,000\u5186\nbreak;\ncase 'F. \u7279\u5225\u652f\u63f4\u4f1a\u54e1\uff08\u6708\u984d10000\u5186\uff09':\n$plan = 'pln_xxxxxxxxxxxxxxxxxxxxxxxxxxxx';\t\/\/\u6708\u984d10,000\u5186\nbreak;\ncase 'G. \u7279\u5225\u652f\u63f4\u4f1a\u54e1\uff08\u6708\u984d30000\u5186\uff09':\n$plan = 'pln_xxxxxxxxxxxxxxxxxxxxxxxxxxxx';\t\/\/\u6708\u984d30,000\u5186\nbreak;\n}\n\ntry {\n\/\/\u25c6\u65b0\u3057\u3044\u9867\u5ba2\u306e\u4f5c\u6210\n\\Payjp\\Payjp::setApiKey($secret);\n$customer = \\Payjp\\Customer::create(array(\n\t\t\"card\" => $token,\n        \"description\" => $description,\n        \"email\" => $email\n        ));\nif ( $Data->get_form_key() === 'mw-wp-form-1473' ) {\n\/\/\u25c6\u65b0\u3057\u3044\u5b9a\u671f\u8ab2\u91d1\u306e\u4f5c\u6210\u3000\u5165\u4f1a\u7533\u3057\u8fbc\u307f\u306e\u5834\u5408\n\\Payjp\\Payjp::setApiKey($secret);\n$result = \\Payjp\\Subscription::create(array(\n\t\t\"customer\" => $customer&#91;\"id\"],\n\t\t\"plan\" => $plan\n));\n} else {\n\/\/\u25c6\u65b0\u3057\u3044\u8ab2\u91d1\u306e\u4f5c\u6210\u3000\u3054\u5bc4\u4ed8\u306e\u5834\u5408\n\\Payjp\\Payjp::setApiKey($secret);\n$result = \\Payjp\\Charge::create(array(\n        \"customer\" => $customer&#91;\"id\"],\n        \"amount\" => $amount,\n        \"currency\" => $currency\n        ));\n}\n\n    if (isset($result&#91;'error'])) {\n        throw new Exception();\n    }\n} catch (Exception $e) {\n    \/\/ \u30ab\u30fc\u30c9\u304c\u62d2\u5426\u3055\u308c\u305f\u5834\u5408\n    $err = $result&#91;'error']&#91;'message'];\n    echo $err;\n    exit;\n}\n\nif ( $Data->get_form_key() === 'mw-wp-form-1473' ) {\nheader('Location: https:\/\/hiroshimahouse.com\/member-thanks\/');\nexit();\n} else {\nheader('Location: https:\/\/hiroshimahouse.com\/donation-thanks\/');\nexit();\n}\n}\nadd_action( 'mwform_after_send_mw-wp-form-1433', 'my_mwform_after_send' );\nadd_action( 'mwform_after_send_mw-wp-form-1463', 'my_mwform_after_send' );\nadd_action( 'mwform_after_send_mw-wp-form-1473', 'my_mwform_after_send' );\n?><\/code><\/pre>\n\n\n\n<p><a href=\"https:\/\/hiroshimahouse.com\/donation\/\">\u3053\u3053<\/a>\u3068<a href=\"https:\/\/hiroshimahouse.com\/member-fee\/\">\u3053\u3053<\/a>\u304b\u3089\u306e\u30d5\u30a9\u30fc\u30e0\u306e\u7d9a\u304d\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u30e1\u30fc\u30eb\u30d5\u30a9\u30fc\u30e0\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u306fMW WP Form\u3092\u4f7f\u3063\u3066\u307e\u3059\u3002<br>\u30a2\u30af\u30b7\u30e7\u30f3\u30d5\u30c3\u30af\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u3060\u3063\u305f\u306e\u3067\u3001function.php\u306b\u4e0a\u8a18\u306e\u3088\u3046\u306b\u66f8\u3044\u3066\u307e\u3059\u3002\u4e0a\u90e8\u306ecss\u7cfb\u306e\u8a18\u8ff0\u306f\u95a2\u4fc2\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u5148\u65e5\u6539\u3081\u3066\u30b0\u30b0\u3063\u3066\u307f\u308b\u3068\u3001<a href=\"https:\/\/ja.wordpress.org\/plugins\/simple-pay-jp-payment\/\" target=\"_blank\" rel=\"noreferrer noopener\">PAY.JP\u3082\u5b9a\u671f\u8ab2\u91d1\u3067\u304d\u308b\u30d7\u30e9\u30b0\u30a4\u30f3<\/a>\u3068\u304b\u3042\u308a\u307e\u3059\u306d\uff01\u305d\u308c\u4f7f\u3048\u3070PHP\u3068\u304b\u66f8\u304b\u306a\u304f\u3066\u3082\u3044\u3051\u305d\u3046\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7d50\u69cb\u3001PAY.JP\u306e\u5b9f\u88c5\u3067\u8a2a\u554f\u3055\u308c\u308b\u65b9\u304c\u591a\u3044\u3088\u3046\u306a\u306e\u3067\u3082\u3046\u3061\u3087\u3063\u3068\u8a73\u3057\u304f\u66f8\u3044\u3066\u304a\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002 \u307e\u305a\u3001\u79c1\u304c\u6c42\u3081\u3066\u3044\u305f\u3053\u3068 \u5165\u529b\u3057\u305f\u4efb\u610f\u306e\u91d1\u984d\u3067\u5bc4\u4ed8\u3067\u304d\u308b \u6570\u7a2e\u985e\u306e\u6708\u984d\u30fb\u5e74\u984d\u306e\u4f1a\u8cbb\u3001\u5b9a\u671f\u8ab2\u91d1 \u304a\u540d\u524d\u30fb\u4f4f\u6240\u30fb\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u7b49\u306e\u60c5\u5831\u53d6\u5f97 \u304f\u3089\u3044\u3067\u3057\u3087\u3046\u304b\u3002 \u591a\u5206\u307f\u306a\u3055\u3093\u3001\u30c1\u30a7\u30c3\u30af\u30a2\u30a6\u30c8\u3092\u30a6\u30a7\u30d6\u30da\u30fc\u30b8\u306b\u8cbc\u308a\u4ed8\u3051\u308b\u3068\u304b\u306f\u3064\u307e\u3065\u304b\u306a\u3044\u3068\u601d\u3046\u306e\u3067\u3001PHP\u3067\u66f8\u3044\u305f\u30b3\u30fc\u30c9\u3092\u53c2\u8003\u307e\u3067\u306b\u306e\u305b\u3066\u304a\u304d\u307e\u3059\u3002\u6642\u9593\u306b\u3086\u3068\u308a\u304c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5515,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[31,11],"tags":[],"_links":{"self":[{"href":"https:\/\/arms-jp.com\/cambodia\/wp-json\/wp\/v2\/posts\/6410"}],"collection":[{"href":"https:\/\/arms-jp.com\/cambodia\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arms-jp.com\/cambodia\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arms-jp.com\/cambodia\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/arms-jp.com\/cambodia\/wp-json\/wp\/v2\/comments?post=6410"}],"version-history":[{"count":2,"href":"https:\/\/arms-jp.com\/cambodia\/wp-json\/wp\/v2\/posts\/6410\/revisions"}],"predecessor-version":[{"id":6413,"href":"https:\/\/arms-jp.com\/cambodia\/wp-json\/wp\/v2\/posts\/6410\/revisions\/6413"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/arms-jp.com\/cambodia\/wp-json\/wp\/v2\/media\/5515"}],"wp:attachment":[{"href":"https:\/\/arms-jp.com\/cambodia\/wp-json\/wp\/v2\/media?parent=6410"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arms-jp.com\/cambodia\/wp-json\/wp\/v2\/categories?post=6410"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arms-jp.com\/cambodia\/wp-json\/wp\/v2\/tags?post=6410"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}