PluginProbe
Gravity Forms Eway / 2.4.1
Gravity Forms Eway v2.4.1
2.7.0 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.7.0 1.8.0 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 All 56 releases
gravityforms-eway / views / admin-settings.php

admin-settings.php in Gravity Forms Eway 2.4.1, at views/admin-settings.php

254 lines 13.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6
7 <?php settings_errors(); ?>
8
9 <div class="gfeway-settings-promote">
10 <a rel="noopener" target="_blank" href="https://gfeway.webaware.net.au/"><?php esc_html_e('Go Pro for more flexibility!', 'gravityforms-eway'); ?></a>
11 </div>
12
13 <h3><span><i class="fa fa-credit-card"></i> <?= esc_html_x('Eway Payments', 'settings page', 'gravityforms-eway'); ?></span></h3>
14
15 <form action="<?= admin_url('options.php'); ?>" method="POST" id="eway-settings-form">
16 <?php settings_fields(GFEWAY_PLUGIN_OPTIONS); ?>
17
18 <h4 class="gf_settings_subgroup_title"><?php esc_html_e('Live settings', 'gravityforms-eway'); ?></h4>
19
20 <table class="form-table gforms_form_settings">
21
22 <tr>
23 <th scope="row">
24 <label for="gfeway_plugin_apiKey"><?= esc_html_x('API Key', 'settings field', 'gravityforms-eway'); ?></label>
25 <?php gform_tooltip(esc_html__('Eway Rapid API key, from your MyEway console.', 'gravityforms-eway')); ?>
26 </th>
27 <td>
28 <input type="text" class="large-text" name="gfeway_plugin[apiKey]" id="gfeway_plugin_apiKey"
29 autocorrect="off" autocapitalize="off" spellcheck="false"
30 value="<?= esc_attr($options['apiKey']); ?>" />
31 </td>
32 </tr>
33
34 <tr>
35 <th scope="row">
36 <label for="gfeway_plugin_apiPassword"><?= esc_html_x('API Password', 'settings field', 'gravityforms-eway'); ?></label>
37 <?php gform_tooltip(esc_html__('Eway Rapid API password, from your MyEway console.', 'gravityforms-eway')); ?>
38 </th>
39 <td>
40 <input type="password" class="regular-text" name="gfeway_plugin[apiPassword]" id="gfeway_plugin_apiPassword"
41 autocomplete="new-password" autocorrect="off" autocapitalize="off" spellcheck="false"
42 value="<?= esc_attr($options['apiPassword']); ?>" />
43 </td>
44 </tr>
45
46 <tr>
47 <th scope="row">
48 <label for="gfeway_plugin_ecryptKey"><?= esc_html_x('Client Side Encryption Key', 'settings field', 'gravityforms-eway'); ?></label>
49 <?php gform_tooltip(esc_html__("Securely encrypts sensitive credit card information in the customer's browser, so that you can accept credit cards on your website without full PCI certification.", 'gravityforms-eway')); ?>
50 </th>
51 <td>
52 <textarea name="gfeway_plugin[ecryptKey]" id="gfeway_plugin_ecryptKey" rows="5" class="large-text"
53 autocorrect="off" autocapitalize="off" spellcheck="false"><?= esc_attr($options['ecryptKey']); ?></textarea>
54 </td>
55 </tr>
56
57 <tr>
58 <th scope="row">
59 <label for="gfeway_plugin_customerID"><?= esc_html_x('Customer ID', 'settings field', 'gravityforms-eway'); ?></label>
60 <?php gform_tooltip(esc_html__('Eway customer ID, required for Recurring Payments and legacy XML API; from your MyEway console.', 'gravityforms-eway')); ?>
61 </th>
62 <td>
63 <input type="text" class="regular-text" name="gfeway_plugin[customerID]" id="gfeway_plugin_customerID" value="<?= esc_attr($options['customerID']); ?>" />
64 </td>
65 </tr>
66
67 </table>
68
69 <h4 class="gf_settings_subgroup_title"><?php esc_html_e('Sandbox settings', 'gravityforms-eway'); ?></h4>
70
71 <table class="form-table gforms_form_settings">
72
73 <tr>
74 <th scope="row">
75 <label for="gfeway_plugin_sandboxApiKey"><?= esc_html_x('API Key', 'settings field', 'gravityforms-eway'); ?></label>
76 <?php gform_tooltip(esc_html__('Eway Rapid API key, from your MyEway console.', 'gravityforms-eway')); ?>
77 </th>
78 <td>
79 <input type="text" class="large-text" name="gfeway_plugin[sandboxApiKey]" id="gfeway_plugin_sandboxApiKey"
80 autocorrect="off" autocapitalize="off" spellcheck="false"
81 value="<?= esc_attr($options['sandboxApiKey']); ?>" />
82 </td>
83 </tr>
84
85 <tr>
86 <th scope="row">
87 <label for="gfeway_plugin_sandboxPassword"><?= esc_html_x('API Password', 'settings field', 'gravityforms-eway'); ?></label>
88 <?php gform_tooltip(esc_html__('Eway Rapid API password, from your MyEway console.', 'gravityforms-eway')); ?>
89 </th>
90 <td>
91 <input type="password" class="regular-text" name="gfeway_plugin[sandboxPassword]" id="gfeway_plugin_sandboxPassword"
92 autocomplete="new-password" autocorrect="off" autocapitalize="off" spellcheck="false"
93 value="<?= esc_attr($options['sandboxPassword']); ?>" />
94 </td>
95 </tr>
96
97 <tr>
98 <th scope="row">
99 <label for="gfeway_plugin_sandboxEcryptKey"><?= esc_html_x('Client Side Encryption Key', 'settings field', 'gravityforms-eway'); ?></label>
100 <?php gform_tooltip(esc_html__("Securely encrypts sensitive credit card information in the customer's browser, so that you can accept credit cards on your website without full PCI certification.", 'gravityforms-eway')); ?>
101 </th>
102 <td>
103 <textarea name="gfeway_plugin[sandboxEcryptKey]" id="gfeway_plugin_sandboxEcryptKey" rows="5" class="large-text"
104 autocorrect="off" autocapitalize="off" spellcheck="false"><?= esc_attr($options['sandboxEcryptKey']); ?></textarea>
105 </td>
106 </tr>
107
108 <tr>
109 <th scope="row">
110 <label for="gfeway_plugin_sandboxCustomerID"><?= esc_html_x('Customer ID', 'settings field', 'gravityforms-eway'); ?></label>
111 <?php gform_tooltip(esc_html__('Eway customer ID, for the legacy XML API sandbox (not used for the Recurring Payments sandbox); from your MyEway console.', 'gravityforms-eway')); ?>
112 </th>
113 <td>
114 <input type="text" class="regular-text" name="gfeway_plugin[sandboxCustomerID]" id="gfeway_plugin_sandboxCustomerID" value="<?= esc_attr($options['sandboxCustomerID']); ?>" />
115 </td>
116 </tr>
117
118 </table>
119
120 <h4 class="gf_settings_subgroup_title"><?= esc_html_x('Options', 'settings page', 'gravityforms-eway'); ?></h4>
121
122 <table class="form-table gforms_form_settings">
123
124 <tr valign='top'>
125 <th>&nbsp;</th>
126 <td>
127
128 <fieldset>
129 <legend><?= esc_html_x('Payment Method', 'settings field', 'gravityforms-eway'); ?></legend>
130 <input type="radio" name="gfeway_plugin[useStored]" id="gfeway_plugin_useStored_no" value="" <?php checked($options['useStored'], ''); ?> />
131 <label for="gfeway_plugin_useStored_no"><?= esc_html_x('Capture', 'payment method', 'gravityforms-eway'); ?></label>
132 <input type="radio" name="gfeway_plugin[useStored]" id="gfeway_plugin_useStored_yes" value="1" <?php checked($options['useStored'], '1'); ?> />
133 <label for="gfeway_plugin_useStored_yes"><?= esc_html_x('Authorize', 'payment method', 'gravityforms-eway'); ?></label>
134 <p id="gfeway-opt-admin-stored-test"><em><?php esc_html_e('The Stored Payments legacy XML API has no sandbox, so transactions are simulated via the Direct Payments XML API sandbox. Add your API key and password to use Rapid API and see PreAuth transactions in your sandbox.', 'gravityforms-eway'); ?></em></p>
135 </fieldset>
136
137 <fieldset>
138 <legend><?php esc_html_e('Use Sandbox (testing environment)', 'gravityforms-eway'); ?></legend>
139 <input type="radio" name="gfeway_plugin[useTest]" id="gfeway_plugin_useTest_yes" value="1" <?php checked($options['useTest'], '1'); ?> />
140 <label for="gfeway_plugin_useTest_yes"><?= esc_html_x('Yes', 'settings', 'gravityforms-eway'); ?></label>
141 <input type="radio" name="gfeway_plugin[useTest]" id="gfeway_plugin_useTest_no" value="" <?php checked($options['useTest'], ''); ?> />
142 <label for="gfeway_plugin_useTest_no"><?= esc_html_x('No', 'settings', 'gravityforms-eway'); ?></label>
143 </fieldset>
144
145 <fieldset>
146 <legend><?php esc_html_e('Round Amounts for Sandbox', 'gravityforms-eway'); ?></legend>
147 <input type="radio" name="gfeway_plugin[roundTestAmounts]" id="gfeway_plugin_roundTestAmounts_yes" value="1" <?php checked($options['roundTestAmounts'], '1'); ?> />
148 <label for="gfeway_plugin_roundTestAmounts_yes"><?= esc_html_x('Yes', 'settings', 'gravityforms-eway'); ?></label>
149 <input type="radio" name="gfeway_plugin[roundTestAmounts]" id="gfeway_plugin_roundTestAmounts_no" value="" <?php checked($options['roundTestAmounts'], ''); ?> />
150 <label for="gfeway_plugin_roundTestAmounts_no"><?= esc_html_x('No', 'settings', 'gravityforms-eway'); ?></label>
151 <p><em><?php esc_html_e('Ensures successful transactions when the sandbox behavior is set to "Use Cents Value".', 'gravityforms-eway'); ?></em></p>
152 </fieldset>
153
154 <fieldset>
155 <legend><?php esc_html_e('Force Customer ID 87654321 in Sandbox', 'gravityforms-eway'); ?></legend>
156 <input type="radio" name="gfeway_plugin[forceTestAccount]" id="gfeway_plugin_forceTestAccount_yes" value="1" <?php checked($options['forceTestAccount'], '1'); ?> />
157 <label for="gfeway_plugin_forceTestAccount_yes"><?= esc_html_x('Yes', 'settings', 'gravityforms-eway'); ?></label>
158 <input type="radio" name="gfeway_plugin[forceTestAccount]" id="gfeway_plugin_forceTestAccount_no" value="" <?php checked($options['forceTestAccount'], ''); ?> />
159 <label for="gfeway_plugin_forceTestAccount_no"><?= esc_html_x('No', 'settings', 'gravityforms-eway'); ?></label>
160 </fieldset>
161
162 <fieldset id="gfeway-opt-admin-beagle">
163 <legend><?php printf(__('Use <a href="%s" rel="noopener" target="_blank">Beagle Lite</a> for legacy XML API', 'gravityforms-eway'), 'https://eway.io/features/antifraud-beagle-lite'); ?></legend>
164 <input type="radio" name="gfeway_plugin[useBeagle]" id="gfeway_plugin_useBeagle_yes" value="1" <?php checked($options['useBeagle'], '1'); ?> />
165 <label for="gfeway_plugin_useBeagle_yes"><?= esc_html_x('Yes', 'settings', 'gravityforms-eway'); ?></label>
166 <input type="radio" name="gfeway_plugin[useBeagle]" id="gfeway_plugin_useBeagle_no" value="" <?php checked($options['useBeagle'], ''); ?> />
167 <label for="gfeway_plugin_useBeagle_no"><?= esc_html_x('No', 'settings', 'gravityforms-eway'); ?></label>
168 <p id="gfeway-opt-admin-stored-beagle"><em><?php esc_html_e('Beagle Lite is not available for the Stored Payments legacy XML API.', 'gravityforms-eway'); ?></em></p>
169 <p id="gfeway-opt-admin-beagle-address"><em><?php esc_html_e('Beagle Lite fraud detection requires an address for each transaction. Be sure to add an Address field to your forms, and make it a required field.', 'gravityforms-eway'); ?></em></p>
170 </fieldset>
171
172 <fieldset>
173 <legend><?php esc_html_e('Verify remote SSL certificate', 'gravityforms-eway'); ?></legend>
174 <input type="radio" name="gfeway_plugin[sslVerifyPeer]" id="gfeway_plugin_sslVerifyPeer_yes" value="Y" <?php checked($options['sslVerifyPeer'], '1'); ?> />
175 <label for="gfeway_plugin_sslVerifyPeer_yes"><?= esc_html_x('Yes', 'settings', 'gravityforms-eway'); ?></label>
176 <input type="radio" name="gfeway_plugin[sslVerifyPeer]" id="gfeway_plugin_sslVerifyPeer_no" value="N" <?php checked($options['sslVerifyPeer'], ''); ?> />
177 <label for="gfeway_plugin_sslVerifyPeer_no"><?= esc_html_x('No', 'settings', 'gravityforms-eway'); ?></label>
178 <p><em><?php printf(__("Only choose 'no' if you can't <a rel='noopener' target='_blank' href='%s'>fix your website SSL configuration</a> due to a technical reason.", 'gravityforms-eway'),
179 'https://snippets.webaware.com.au/howto/stop-turning-off-curlopt_ssl_verifypeer-and-fix-your-php-config/'); ?></em></p>
180 </fieldset>
181
182 </td>
183 </tr>
184
185 </table>
186
187 <h4 class="gf_settings_subgroup_title"><?= esc_html_x('Error messages', 'settings', 'gravityforms-eway'); ?></h4>
188
189 <table class="form-table gforms_form_settings">
190
191 <tr>
192 <th colspan="2"><?php esc_html_e('You may customize the error messages below. Leave a message blank to use the default error message.', 'gravityforms-eway'); ?></th>
193 </tr>
194
195 <tr colspan="2">
196 <td colspan="2">
197 <?php
198 $errNames = [
199 GFEWAY_ERROR_ALREADY_SUBMITTED,
200 GFEWAY_ERROR_NO_AMOUNT,
201 GFEWAY_ERROR_REQ_CARD_HOLDER,
202 GFEWAY_ERROR_REQ_CARD_NAME,
203 GFEWAY_ERROR_EWAY_FAIL,
204 ];
205 foreach ($errNames as $errName) {
206 $defmsg = $this->plugin->getErrMsg($errName, true);
207 $msg = isset($options[$errName]) ? $options[$errName] : get_option($errName);
208 ?>
209
210 <label for="<?= esc_attr($errName); ?>"><?= esc_html($defmsg); ?></label>
211 <input type="text" class="large-text" id="<?= esc_attr($errName); ?>" name="gfeway_plugin[<?= esc_attr($errName); ?>]"
212 value="<?= esc_attr($msg); ?>" placeholder="<?= esc_attr($defmsg); ?>" />
213
214 <?php
215 }
216 ?>
217 </td>
218 </tr>
219
220 </table>
221
222 <?php submit_button(); ?>
223
224 </form>
225
226 <script>
227 (function($) {
228
229 function setVisibility() {
230 var useTest = ($("input[name='gfeway_plugin[useTest]']:checked").val() === "1"),
231 useBeagle = ($("input[name='gfeway_plugin[useBeagle]']:checked").val() === "1"),
232 useStored = ($("input[name='gfeway_plugin[useStored]']:checked").val() === "1"),
233 useAPI = ($("input[name='gfeway_plugin[apiKey]']").val() !== "" && $("input[name='gfeway_plugin[apiPassword]']").val() !== "");
234
235 function display(element, visible) {
236 if (visible)
237 element.show();
238 else
239 element.hide();
240 }
241
242 display($("#gfeway-opt-admin-stored-test"), (useTest && useStored && !useAPI));
243 display($("#gfeway-opt-admin-stored-beagle"), (useBeagle && useStored && !useAPI));
244 display($("#gfeway-opt-admin-beagle"), !useAPI);
245 display($("#gfeway-opt-admin-beagle-address"), useBeagle);
246 }
247
248 $("#eway-settings-form").on("change", "input[name='gfeway_plugin[apiKey]'],input[name='gfeway_plugin[apiPassword]'],input[name='gfeway_plugin[useTest]'],input[name='gfeway_plugin[useBeagle]'],input[name='gfeway_plugin[useStored]']", setVisibility);
249
250 setVisibility();
251
252 })(jQuery);
253 </script>
254