PluginProbe
Gravity Forms Eway / 2.2.8
Gravity Forms Eway v2.2.8
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.2.8, at views/admin-settings.php

244 lines 12.8 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> <?php echo esc_html_x('eWAY Payments', 'settings page', 'gravityforms-eway'); ?></span></h3>
14
15 <form action="<?php echo 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"><?php echo 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" value="<?php echo esc_attr($options['apiKey']); ?>" />
29 </td>
30 </tr>
31
32 <tr>
33 <th scope="row">
34 <label for="gfeway_plugin_apiPassword"><?php echo esc_html_x('API Password', 'settings field', 'gravityforms-eway'); ?></label>
35 <?php gform_tooltip(esc_html__('eWAY Rapid API password, from your MYeWAY console.', 'gravityforms-eway')); ?>
36 </th>
37 <td>
38 <input type="text" class="regular-text" name="gfeway_plugin[apiPassword]" id="gfeway_plugin_apiPassword" value="<?php echo esc_attr($options['apiPassword']); ?>" />
39 </td>
40 </tr>
41
42 <tr>
43 <th scope="row">
44 <label for="gfeway_plugin_ecryptKey"><?php echo esc_html_x('Client Side Encryption Key', 'settings field', 'gravityforms-eway'); ?></label>
45 <?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')); ?>
46 </th>
47 <td>
48 <textarea name="gfeway_plugin[ecryptKey]" id="gfeway_plugin_ecryptKey" rows="5" class="large-text"><?php echo esc_attr($options['ecryptKey']); ?></textarea>
49 </td>
50 </tr>
51
52 <tr>
53 <th scope="row">
54 <label for="gfeway_plugin_customerID"><?php echo esc_html_x('Customer ID', 'settings field', 'gravityforms-eway'); ?></label>
55 <?php gform_tooltip(esc_html__('eWAY customer ID, required for Recurring Payments and legacy XML API; from your MYeWAY console.', 'gravityforms-eway')); ?>
56 </th>
57 <td>
58 <input type="text" class="regular-text" name="gfeway_plugin[customerID]" id="gfeway_plugin_customerID" value="<?php echo esc_attr($options['customerID']); ?>" />
59 </td>
60 </tr>
61
62 </table>
63
64 <h4 class="gf_settings_subgroup_title"><?php esc_html_e('Sandbox settings', 'gravityforms-eway'); ?></h4>
65
66 <table class="form-table gforms_form_settings">
67
68 <tr>
69 <th scope="row">
70 <label for="gfeway_plugin_sandboxApiKey"><?php echo esc_html_x('API Key', 'settings field', 'gravityforms-eway'); ?></label>
71 <?php gform_tooltip(esc_html__('eWAY Rapid API key, from your MYeWAY console.', 'gravityforms-eway')); ?>
72 </th>
73 <td>
74 <input type="text" class="large-text" name="gfeway_plugin[sandboxApiKey]" id="gfeway_plugin_sandboxApiKey" value="<?php echo esc_attr($options['sandboxApiKey']); ?>" />
75 </td>
76 </tr>
77
78 <tr>
79 <th scope="row">
80 <label for="gfeway_plugin_sandboxPassword"><?php echo esc_html_x('API Password', 'settings field', 'gravityforms-eway'); ?></label>
81 <?php gform_tooltip(esc_html__('eWAY Rapid API password, from your MYeWAY console.', 'gravityforms-eway')); ?>
82 </th>
83 <td>
84 <input type="text" class="regular-text" name="gfeway_plugin[sandboxPassword]" id="gfeway_plugin_sandboxPassword" value="<?php echo esc_attr($options['sandboxPassword']); ?>" />
85 </td>
86 </tr>
87
88 <tr>
89 <th scope="row">
90 <label for="gfeway_plugin_sandboxEcryptKey"><?php echo esc_html_x('Client Side Encryption Key', 'settings field', 'gravityforms-eway'); ?></label>
91 <?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')); ?>
92 </th>
93 <td>
94 <textarea name="gfeway_plugin[sandboxEcryptKey]" id="gfeway_plugin_sandboxEcryptKey" rows="5" class="large-text"><?php echo esc_attr($options['sandboxEcryptKey']); ?></textarea>
95 </td>
96 </tr>
97
98 <tr>
99 <th scope="row">
100 <label for="gfeway_plugin_sandboxCustomerID"><?php echo esc_html_x('Customer ID', 'settings field', 'gravityforms-eway'); ?></label>
101 <?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')); ?>
102 </th>
103 <td>
104 <input type="text" class="regular-text" name="gfeway_plugin[sandboxCustomerID]" id="gfeway_plugin_sandboxCustomerID" value="<?php echo esc_attr($options['sandboxCustomerID']); ?>" />
105 </td>
106 </tr>
107
108 </table>
109
110 <h4 class="gf_settings_subgroup_title"><?php echo esc_html_x('Options', 'settings page', 'gravityforms-eway'); ?></h4>
111
112 <table class="form-table gforms_form_settings">
113
114 <tr valign='top'>
115 <th>&nbsp;</th>
116 <td>
117
118 <fieldset>
119 <legend><?php echo esc_html_x('Payment Method', 'settings field', 'gravityforms-eway'); ?></legend>
120 <input type="radio" name="gfeway_plugin[useStored]" id="gfeway_plugin_useStored_no" value="" <?php checked($options['useStored'], ''); ?> />
121 <label for="gfeway_plugin_useStored_no"><?php echo esc_html_x('Capture', 'payment method', 'gravityforms-eway'); ?></label>
122 <input type="radio" name="gfeway_plugin[useStored]" id="gfeway_plugin_useStored_yes" value="1" <?php checked($options['useStored'], '1'); ?> />
123 <label for="gfeway_plugin_useStored_yes"><?php echo esc_html_x('Authorize', 'payment method', 'gravityforms-eway'); ?></label>
124 <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>
125 </fieldset>
126
127 <fieldset>
128 <legend><?php esc_html_e('Use Sandbox (testing environment)', 'gravityforms-eway'); ?></legend>
129 <input type="radio" name="gfeway_plugin[useTest]" id="gfeway_plugin_useTest_yes" value="1" <?php checked($options['useTest'], '1'); ?> />
130 <label for="gfeway_plugin_useTest_yes"><?php echo esc_html_x('Yes', 'settings', 'gravityforms-eway'); ?></label>
131 <input type="radio" name="gfeway_plugin[useTest]" id="gfeway_plugin_useTest_no" value="" <?php checked($options['useTest'], ''); ?> />
132 <label for="gfeway_plugin_useTest_no"><?php echo esc_html_x('No', 'settings', 'gravityforms-eway'); ?></label>
133 </fieldset>
134
135 <fieldset>
136 <legend><?php esc_html_e('Round Amounts for Sandbox', 'gravityforms-eway'); ?></legend>
137 <input type="radio" name="gfeway_plugin[roundTestAmounts]" id="gfeway_plugin_roundTestAmounts_yes" value="1" <?php checked($options['roundTestAmounts'], '1'); ?> />
138 <label for="gfeway_plugin_roundTestAmounts_yes"><?php echo esc_html_x('Yes', 'settings', 'gravityforms-eway'); ?></label>
139 <input type="radio" name="gfeway_plugin[roundTestAmounts]" id="gfeway_plugin_roundTestAmounts_no" value="" <?php checked($options['roundTestAmounts'], ''); ?> />
140 <label for="gfeway_plugin_roundTestAmounts_no"><?php echo esc_html_x('No', 'settings', 'gravityforms-eway'); ?></label>
141 <p><em><?php esc_html_e('Ensures successful transactions when the sandbox behavior is set to "Use Cents Value".', 'gravityforms-eway'); ?></em></p>
142 </fieldset>
143
144 <fieldset>
145 <legend><?php esc_html_e('Force Customer ID 87654321 in Sandbox', 'gravityforms-eway'); ?></legend>
146 <input type="radio" name="gfeway_plugin[forceTestAccount]" id="gfeway_plugin_forceTestAccount_yes" value="1" <?php checked($options['forceTestAccount'], '1'); ?> />
147 <label for="gfeway_plugin_forceTestAccount_yes"><?php echo esc_html_x('Yes', 'settings', 'gravityforms-eway'); ?></label>
148 <input type="radio" name="gfeway_plugin[forceTestAccount]" id="gfeway_plugin_forceTestAccount_no" value="" <?php checked($options['forceTestAccount'], ''); ?> />
149 <label for="gfeway_plugin_forceTestAccount_no"><?php echo esc_html_x('No', 'settings', 'gravityforms-eway'); ?></label>
150 </fieldset>
151
152 <fieldset id="gfeway-opt-admin-beagle">
153 <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>
154 <input type="radio" name="gfeway_plugin[useBeagle]" id="gfeway_plugin_useBeagle_yes" value="1" <?php checked($options['useBeagle'], '1'); ?> />
155 <label for="gfeway_plugin_useBeagle_yes"><?php echo esc_html_x('Yes', 'settings', 'gravityforms-eway'); ?></label>
156 <input type="radio" name="gfeway_plugin[useBeagle]" id="gfeway_plugin_useBeagle_no" value="" <?php checked($options['useBeagle'], ''); ?> />
157 <label for="gfeway_plugin_useBeagle_no"><?php echo esc_html_x('No', 'settings', 'gravityforms-eway'); ?></label>
158 <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>
159 <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>
160 </fieldset>
161
162 <fieldset>
163 <legend><?php esc_html_e('Verify remote SSL certificate', 'gravityforms-eway'); ?></legend>
164 <input type="radio" name="gfeway_plugin[sslVerifyPeer]" id="gfeway_plugin_sslVerifyPeer_yes" value="Y" <?php checked($options['sslVerifyPeer'], '1'); ?> />
165 <label for="gfeway_plugin_sslVerifyPeer_yes"><?php echo esc_html_x('Yes', 'settings', 'gravityforms-eway'); ?></label>
166 <input type="radio" name="gfeway_plugin[sslVerifyPeer]" id="gfeway_plugin_sslVerifyPeer_no" value="N" <?php checked($options['sslVerifyPeer'], ''); ?> />
167 <label for="gfeway_plugin_sslVerifyPeer_no"><?php echo esc_html_x('No', 'settings', 'gravityforms-eway'); ?></label>
168 <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'),
169 'https://snippets.webaware.com.au/howto/stop-turning-off-curlopt_ssl_verifypeer-and-fix-your-php-config/'); ?></em></p>
170 </fieldset>
171
172 </td>
173 </tr>
174
175 </table>
176
177 <h4 class="gf_settings_subgroup_title"><?php echo esc_html_x('Error messages', 'settings', 'gravityforms-eway'); ?></h4>
178
179 <table class="form-table gforms_form_settings">
180
181 <tr>
182 <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>
183 </tr>
184
185 <tr colspan="2">
186 <td colspan="2">
187 <?php
188 $errNames = array (
189 GFEWAY_ERROR_ALREADY_SUBMITTED,
190 GFEWAY_ERROR_NO_AMOUNT,
191 GFEWAY_ERROR_REQ_CARD_HOLDER,
192 GFEWAY_ERROR_REQ_CARD_NAME,
193 GFEWAY_ERROR_EWAY_FAIL,
194 );
195 foreach ($errNames as $errName) {
196 $defmsg = $this->plugin->getErrMsg($errName, true);
197 $msg = isset($options[$errName]) ? $options[$errName] : get_option($errName);
198 ?>
199
200 <label for="<?php echo esc_attr($errName); ?>"><?php echo esc_html($defmsg); ?></label>
201 <input type="text" class="large-text" id="<?php echo esc_attr($errName); ?>" name="gfeway_plugin[<?php echo esc_attr($errName); ?>]"
202 value="<?php echo esc_attr($msg); ?>" placeholder="<?php echo esc_attr($defmsg); ?>" />
203
204 <?php
205 }
206 ?>
207 </td>
208 </tr>
209
210 </table>
211
212 <?php submit_button(); ?>
213
214 </form>
215
216 <script>
217 (function($) {
218
219 function setVisibility() {
220 var useTest = ($("input[name='gfeway_plugin[useTest]']:checked").val() === "1"),
221 useBeagle = ($("input[name='gfeway_plugin[useBeagle]']:checked").val() === "1"),
222 useStored = ($("input[name='gfeway_plugin[useStored]']:checked").val() === "1"),
223 useAPI = ($("input[name='gfeway_plugin[apiKey]']").val() !== "" && $("input[name='gfeway_plugin[apiPassword]']").val() !== "");
224
225 function display(element, visible) {
226 if (visible)
227 element.show();
228 else
229 element.hide();
230 }
231
232 display($("#gfeway-opt-admin-stored-test"), (useTest && useStored && !useAPI));
233 display($("#gfeway-opt-admin-stored-beagle"), (useBeagle && useStored && !useAPI));
234 display($("#gfeway-opt-admin-beagle"), !useAPI);
235 display($("#gfeway-opt-admin-beagle-address"), useBeagle);
236 }
237
238 $("#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);
239
240 setVisibility();
241
242 })(jQuery);
243 </script>
244