{"id":40506,"date":"2022-06-09T22:26:59","date_gmt":"2022-06-09T22:26:59","guid":{"rendered":"https:\/\/onyxgfx.com\/?page_id=40506"},"modified":"2025-12-18T12:13:46","modified_gmt":"2025-12-18T19:13:46","slug":"payment-center","status":"publish","type":"page","link":"https:\/\/onyxgfx.com\/ja\/payment-center\/","title":{"rendered":"\u652f\u6255\u30bb\u30f3\u30bf\u30fc"},"content":{"rendered":"<h1 style=\"text-align: center;\">Payment Center<\/h1>\n<p style=\"text-align: center;\"><strong>note<\/strong>: Payments may take 2-3 business days to post to your Onyx Graphics account.<\/p>\n<div class=\"payment-center\" style=\"text-align: center;\">\n<div style=\"text-align: left; max-width: 600px; margin: 0 auto;\">        <div class=\"payment-center-form\">\n            <form id=\"payment-center-demo-form\" method=\"post\" novalidate>\n                <input type=\"hidden\" id=\"pc_nonce\" name=\"pc_nonce\" value=\"56b95099b9\" \/><input type=\"hidden\" name=\"_wp_http_referer\" value=\"\/ja\/wp-json\/wp\/v2\/pages\/40506\" \/>                                <input type=\"hidden\" name=\"action\" value=\"pc_handle_payment_ajax\">\n                                <input type=\"hidden\" name=\"current_page_url\" value=\"https:\/\/onyxgfx.com\/ja\/wp-json\/wp\/v2\/pages\/40506\">\n                <h2>Make a Payment<\/h2>\n                                <div id=\"form-message\" class=\"form-error\" style=\"display:none;\" tabindex=\"-1\"><\/div>\n                <div class=\"form-group\" id=\"customer-id-holder\">\n                    <label for=\"pc-customer-id\">Customer ID<\/label>\n                    <input type=\"text\" id=\"pc-customer-id\" name=\"customer_id\" placeholder=\"Customer ID\" value=\"\" required>\n                                    <\/div>\n                <div class=\"form-group\" id=\"customer-id-selector\" style=\"\">\n                    <label>\n                        <input type=\"checkbox\" id=\"no-customer-id-checkbox\">\n                        I don't have a Customer ID                    <\/label>\n                <\/div>\n                <div class=\"form-group\">\n                    <label for=\"pc-name\">Name<\/label>\n                    <input type=\"text\" id=\"pc-name\" name=\"name\"\n                        placeholder=\"Name (optional)\"\n                        data-placeholder-optional=\"Name (optional)\"\n                        data-placeholder-required=\"Name\">\n                <\/div>\n                <div class=\"form-group\">\n                    <label for=\"pc-company\">Company<\/label>\n                    <input type=\"text\" id=\"pc-company\" name=\"company\"\n                        placeholder=\"Company (optional)\"\n                        data-placeholder-optional=\"Company (optional)\"\n                        data-placeholder-required=\"Company\">\n                <\/div>\n                <div class=\"form-group\">\n                    <label for=\"pc-reference-number\">Reference Number<\/label>\n                    <input type=\"text\" id=\"pc-reference-number\" name=\"reference_number\" placeholder=\"Reference Number (Invoice \/ PO \/ Quote Number)\" value=\"\" required>\n                                    <\/div>\n                                <div class=\"form-group\">\n                    <label for=\"pc-amount\">Amount<\/label>                    <input type=\"number\" id=\"pc-amount\" name=\"amount\" placeholder=\"Amount\" step=\"0.01\" min=\"0\" required value=\"\"\n                    >                <\/div>\n                <div class=\"form-group\" id=\"currency-selector\">\n                    <label for=\"pc-currency\">Currency<\/label>\n                    <select id=\"pc-currency\" name=\"currency\" >\n                        <option value=\"USD\" >$ USD<\/option>\n                        <option value=\"EUR\" >\u20ac EUR<\/option>\n                                            <\/select>\n                                    <\/div>\n                <div class=\"form-group\" id=\"pm-form-group\">\n                    <label>Payment Method<\/label>\n                    <div class=\"radio-options\" id=\"payment-method-options\">\n                        <label class=\"pm-option\" data-method=\"paypal\"><input type=\"radio\" name=\"payment_method\" value=\"paypal\"> <span class=\"pm-icon\"><\/span> PayPal<\/label>\n                        <label class=\"pm-option\" data-method=\"card\"><input type=\"radio\" name=\"payment_method\" value=\"card\"> <span class=\"pm-icon\"><\/span> Credit Card<\/label>\n                        <label class=\"pm-option\" data-method=\"ach\"><input type=\"radio\" name=\"payment_method\" value=\"ach\"> <span class=\"pm-icon\"><\/span> ACH Bank Transfer<\/label>\n                        <label class=\"pm-option\" data-method=\"alipay\"><input type=\"radio\" name=\"payment_method\" value=\"alipay\"> <span class=\"pm-icon\"><\/span> Alipay<\/label>\n                        <label class=\"pm-option\" data-method=\"wechatpay\"><input type=\"radio\" name=\"payment_method\" value=\"wechatpay\"> <span class=\"pm-icon\"><\/span> WeChat Pay<\/label>\n                    <\/div>\n                <\/div>\n\n                <div class=\"form-group\">\n                    <button type=\"submit\">Make Payment<\/button>\n                <\/div>\n            <\/form>\n        <\/div>\n\n        <script>\n        document.addEventListener('DOMContentLoaded', function () {\n            const form = document.getElementById('payment-center-demo-form');\n            const message = document.getElementById('form-message');\n            const customerIdInput = document.getElementById('pc-customer-id');\n            const noCustomerIdCheckbox = document.getElementById('no-customer-id-checkbox');\n            const nameInput = document.getElementById('pc-name');\n            const companyInput = document.getElementById('pc-company');\n            const currencySelect = document.getElementById('pc-currency');\n            const paymentOptions = document.querySelectorAll('.pm-option');\n\n            function toggleCustomerIdRequirement() {\n                if (noCustomerIdCheckbox.checked) {\n                    customerIdInput.value = '';\n                    customerIdInput.disabled = true;\n                    customerIdInput.removeAttribute('required');\n                    nameInput.setAttribute('required', 'required');\n                    nameInput.placeholder = nameInput.dataset.placeholderRequired;\n                    companyInput.setAttribute('required', 'required');\n                    companyInput.placeholder = companyInput.dataset.placeholderRequired;\n                } else {\n                    customerIdInput.disabled = false;\n                    customerIdInput.setAttribute('required', 'required');\n                    nameInput.removeAttribute('required');\n                    nameInput.placeholder = nameInput.dataset.placeholderOptional;\n                    companyInput.removeAttribute('required');\n                    companyInput.placeholder = companyInput.dataset.placeholderOptional;\n                }\n            }\n\n            function updatePaymentOptionsBasedOnCurrency() {\n                const selectedCurrency = currencySelect.value;\n                const paymentOptions = document.querySelectorAll('.pm-option');\n                let visibleOptions = [];\n\n                paymentOptions.forEach(label => {\n                    const method = label.getAttribute('data-method');\n                    const input = label.querySelector('input');\n                    let shouldShow = false;\n                    if (selectedCurrency === 'CNY') {\n                        shouldShow = (method === 'alipay' || method === 'wechatpay');\n                    } else if (selectedCurrency === 'EUR') {\n                        shouldShow = (method === 'card' || method == 'paypal'); \n                    } else if (selectedCurrency === 'USD') {\n                        shouldShow = true; \/\/ all methods allowed\n                    } else {\n                        shouldShow = (method === 'card'); \/\/ fallback for other currencies: only allow card\n                    }\n                    label.style.display = shouldShow ? 'block' : 'none';\n                    if (!shouldShow) {\n                        input.checked = false;\n                    } else {\n                        visibleOptions.push(input);\n                    }\n                });\n                if (visibleOptions.length > 0) {\n                    visibleOptions[0].checked = true;\n                }\n            }\n\n            updatePaymentOptionsBasedOnCurrency(); \/\/ Run on load\n            noCustomerIdCheckbox.addEventListener('change', toggleCustomerIdRequirement);\n            currencySelect.addEventListener('change', updatePaymentOptionsBasedOnCurrency);\n\n            document.querySelectorAll('#payment-center-demo-form input, #payment-center-demo-form select, #payment-center-demo-form textarea').forEach(el => {\n                el.addEventListener('input', pc_validatePaymentCenterForm);\n                el.addEventListener('change', pc_validatePaymentCenterForm);\n            });\n\n        });\n        <\/script>\n        <\/div>\n<\/div>\n<style> .payment-center label { display:block; } .payment-center button[type=submit] { color: #FFF; background: #343838; } .payment-center .payment-center-form input[type=\"radio\"] { vertical-align:-1px !important; } <\/style>\n","protected":false},"excerpt":{"rendered":"<p>Payment Center note: Payments may take 2-3 business days to post to your Onyx Graphics account.<\/p>","protected":false},"author":5518,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"class_list":{"0":"post-40506","1":"page","2":"type-page","3":"status-publish","5":"entry"},"acf":[],"_links":{"self":[{"href":"https:\/\/onyxgfx.com\/ja\/wp-json\/wp\/v2\/pages\/40506","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/onyxgfx.com\/ja\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/onyxgfx.com\/ja\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/onyxgfx.com\/ja\/wp-json\/wp\/v2\/users\/5518"}],"replies":[{"embeddable":true,"href":"https:\/\/onyxgfx.com\/ja\/wp-json\/wp\/v2\/comments?post=40506"}],"version-history":[{"count":0,"href":"https:\/\/onyxgfx.com\/ja\/wp-json\/wp\/v2\/pages\/40506\/revisions"}],"wp:attachment":[{"href":"https:\/\/onyxgfx.com\/ja\/wp-json\/wp\/v2\/media?parent=40506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}