=== HT PAY.JP for kintone === Contributors: tkc49 Donate link: Tags: Contact Form 7, kintone, PAY.JP, form data to kintone Requires at least: 6.7 Tested up to: 7.1 Requires PHP: 7.4 Stable tag: 1.11.2 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html This plugin can payment using PAY.JP == Description == This plugin needs [Contact Form 7](https://ja.wordpress.org/plugins/contact-form-7/) and [Form data to kintone](https://ja.wordpress.org/plugins/kintone-form/). This plugin can payment using PAY.JP and post to kintone. [youtube https://www.youtube.com/watch?v=I_lXUYyYR0U] = Features = * Accept payments via PAY.JP on WordPress forms * Send payment data to kintone automatically * 3D Secure authentication support (required from February 2025) * Create PAY.JP Customer during payment (optional) * Test/Live mode switching per form * Multi-language support (Japanese/English) for payment dialog = Available Mail Tags = The following mail tags can be used in CF7 mail templates and kintone field mappings: * `[payjp-charged-id]` - PAY.JP Charge ID * `[payjp-charged-captured-at]` - Payment captured datetime * `[payjp-customer-id]` - PAY.JP Customer ID (when customer creation is enabled) = What is kintone? = It is a cloud service that can make the business applications with non-programming provided by Cybozu. Collaborate with team members and partners via apps and workspaces. * Information in Japanese : [https://kintone.cybozu.com/jp/](https://kintone.cybozu.com/jp/) * Information in English: [https://www.kintone.com/](https://www.kintone.com/) = What is PAY.JP? = PAY.JP is a suite of payment APIs in Japan. [https://pay.jp/](https://pay.jp/) == Installation == 1. Upload the entire `ht-payjp-for-kintone` folder to the `/wp-content/plugins/` directory. 2. Activate the plugin through the 'Plugins' menu in WordPress 3. Go to Contact > HT PAY.JP for kintone to set your PAY.JP API keys 4. Edit your Contact Form 7 form and go to the PAY.JP tab to configure settings 5. Add the shortcode `[ht_payjp_for_kintone]` to your form == Frequently Asked Questions == = What plugins are required? = This plugin requires [Contact Form 7](https://wordpress.org/plugins/contact-form-7/). If you want to send payment data to kintone, install [Form data to kintone](https://wordpress.org/plugins/kintone-form/) as well. = How do I get PAY.JP API keys? = Sign up at [https://pay.jp/](https://pay.jp/) and get your Test/Live API keys from the dashboard. = Is 3D Secure supported? = Yes, 3D Secure is supported and required from February 2025 by PAY.JP. = Can I create customers in PAY.JP? = Yes, you can enable customer creation in the PAY.JP tab settings. When enabled, a PAY.JP Customer will be created during payment, and you can use the `[payjp-customer-id]` mail tag. = How do I switch between Test and Live mode? = Each Contact Form 7 form has its own "Enable Live" checkbox in the PAY.JP tab. Uncheck it to use Test mode. == Screenshots == 1. screenshot-1.png 2. screenshot-2.png 3. screenshot-3.png 4. screenshot-4.png == Changelog == = 1.11.2( 2026-09-17 ) = * [Fixed] Submitting a Contact Form 7 form that had never had its PAY.JP settings saved ended in a PHP fatal error (`TypeError: Cannot access offset of type string on string`) on PHP 8. `get_post_meta()` returns an empty string for a form with no `_ht_payjpforkintone_setting_data` meta, and that string was accessed as an array. Because Contact Form 7 submits through the REST API, the broken response left the front-end spinner rotating forever and the form could not be submitted at all. The setting is now always read through the new `ht_payjp_for_kintone_get_setting_data()` helper, which guarantees an array, and every caller checks the key with `isset()` before comparing = 1.11.1( 2026-09-04 ) = * [Changed] Bumped "Tested up to" to 7.1. Verified on WordPress 7.1 / PHP 8.3 that the Japanese error messages, the per-form language setting (PAY.JP `Locale` header and checkout.js `data-lang`), the translated admin screens and a successful test-card charge all work, with no PHP notices = 1.11.0( 2026-09-04 ) = * [Added] Japanese translation files (`languages/ht-pay-jp-for-kintone-ja.po` / `.mo`). Error messages such as "Failed to get credit card information", shown when the form is submitted without entering card information, are now displayed in Japanese on Japanese-locale sites * [Added] PAY.JP API requests now send the `Locale` header, so PAY.JP-side error messages are returned in Japanese. The language follows the existing per-form "payment dialog language" setting (Japanese / English), so it is not hard-coded * [Added] New filter hook `ht_payjp_for_kintone_error_message` to customize the user-facing payment error message * Parameters: $message (string), $error_type (string: no_token / card_error / invalid_request / api_error), $exception (\Exception|null), $contact_form (WPCF7_ContactForm) * [Fixed] `Payjp\Error\Authentication`, `Payjp\Error\ApiConnection` and `Payjp\Error\Api` were not caught, so an invalid API key or a network failure ended the form submission with a PHP fatal error. They are now caught and shown to the visitor as a generic message, with the details sent to the admin by e-mail * [Fixed] The `Text Domain` plugin header did not match the text domain used in the code, so no translation could ever be loaded. Both are now unified to `ht-pay-jp-for-kintone` * [Fixed] Moved `load_plugin_textdomain()` to the `init` hook to avoid the "Translation loading triggered too early" notice on WordPress 6.7+ = 1.10.0( 2026-05-16 ) = * [Added] New action hook `ht_payjp_for_kintone_before_charge` fired just before PAY.JP charge. Allows site-specific validation (e.g., member matching, fraud check) and aborting the payment by reference parameters. * Parameters: $posted_data (array), $amount (int), $token (string), $abort_payment (bool, by-ref), $abort_reason (string, by-ref), $submission (WPCF7_Submission), $contact_form (WPCF7_ContactForm) * Set $abort_payment = true in your callback to cancel the charge; optionally set $abort_reason for the user-facing message = 1.9.0( 2026-04-27 ) = * [Security] Masked Test/Live Secret Keys on the settings page (input type=password with empty value; only the last 4 characters shown as a "Current" hint) * [Security] Suppressed browser password manager prompts (autocomplete=off plus data-1p-ignore / data-lpignore / data-bwignore) * [Security] Validated PAY.JP key format prefixes (sk_test_ / sk_live_ / pk_test_ / pk_live_) before saving; invalid values are rejected with an error message * [Security] Set autoload=no on stored API key options so secret keys are not loaded into memory on every request * [Fixed] Live Secret Key was not saved when Live Public Key was empty due to a field check looking at the wrong POST key = 1.8.1( 2026-02-01 ) = * Updated readme.txt with Features section and Available Mail Tags documentation * Improved FAQ section with actual questions and answers * Fixed changelog dates to match Git tag dates = 1.8.0( 2026-01-31 ) = * Added customer creation feature - optionally create PAY.JP Customer during payment * Added `[payjp-customer-id]` mail tag for CF7 mail and kintone * Added `ht_payjp_for_kintone_after_customer_create` action hook * Added `ht_payjp_for_kintone_after_charge` action hook = 1.7.1( 2025-03-30 ) = * Version up to 1.7.1 because plugin zip file for 1.7.0 was not created and plugin could not be updated = 1.7.0( 2025-03-30 ) = * Forced migration to 3D Secure = 1.6.1( 2024-11-24 ) = * Added setting guide link for 3D Secure = 1.6.0( 2024-11-23 ) = * Added 3D Secure switching functionality * Added support for 3D Secure with Prerelease (Available until April 30, 2025) * Added support for 3D Secure Enabled (Available from February 4, 2025) = 1.5.0( 2024-11-17 ) = * Updated payjp/payjp-php version from 1.0.5 to 1.7.0 * Added error handling for \Payjp\Error\Card = 1.4.1( 2023-11-05 ) = * [Fixed]Handle case where 'description' setting is not provided = 1.4.0( 2023-11-03 ) = * Support for adding description to payment data = 1.3.6( 2023-05-26 ) = * Fixed an issue with the incorrect configuration of the `wpcf7_add_form_tag` function. = 1.3.5 = Release Date: April 8th, 2022 * [Update] Update version number. = 1.3.4 = Release Date: April 8th, 2022 * [Fixed] Fixed text domain. = 1.3.3 = Release Date: March 30th, 2022 * [Fixed] Fixed a bug with payjp-charged-captured-at. = 1.3.2 = Release Date: March 24th, 2022 * [Update] Version up number. = 1.3.1 = Release Date: March 24th, 2022 * [Added] Support for saving Pay.jp payment datetime to kintone. = 1.3.0 = Release Date: February 26th, 2022 * [Added] Supported language settings for Pay.jp payment dialog. = 1.2.5 = Release Date: Jun 8th, 2021 * [Added] Added support for retrieving Pay.jp's settlement processing date. * [Added] Remove unwanted strings such as commas and yen from the payment amount. = 1.2.4 = * [Fixed] A problem with the radio button as an element in the amount form. = 1.2.3 = * [Remove] the webhook waiting process in Pro version = 1.2.2 = * [Remove] filter hook of "set_update_key_for_kintone" in Pro version = 1.2.1 = * Changed to be updated from release assets. = 1.2.0 = * Add auto update for PRO. = 1.1.0 = * Fixed a bug that caused payment to be made to Pay.jp even if there was a validation error in Contact form 7. = 1.0.8 = * Fix Undefined index: kintone-enabled. = 1.0.7 = * Change all of Class name. = 1.0.6 = * Change the order of displayeds tabs. = 1.0.5 = * Fix Validation check was executed even when HT PAY.JP for kintone was disabled. = 1.0.4 = * Add Youtube on readme.txt. = 1.0.3 = * Add banner and icon of Plugin. = 1.0.2 = * Change readme.txt. = 1.0.1 = * Fix typo. = 1.0.0 = * First Release