Browse Source

Add CVV field to payment card update form

pull/5/head
L. Bradley LaBoon 6 months ago
parent
commit
1b0727722f
  1. 4
      account/creditcard/creditcard.js
  2. 5
      account/creditcard/index.shtml

4
account/creditcard/creditcard.js

@ -22,6 +22,7 @@ import { settings, elements, apiGet, apiPost, parseParams, setupHeader } from "/
// Element names specific to this page
elements.ccCurrent = "cc-current";
elements.ccNew = "cc-new";
elements.cvv = "cvv";
elements.expiryCurrent = "expiry-current";
elements.expiryMonth = "expiry-month";
elements.expiryYear = "expiry-year";
@ -34,6 +35,7 @@ import { settings, elements, apiGet, apiPost, parseParams, setupHeader } from "/
var ui = {};
ui.ccCurrent = {};
ui.ccNew = {};
ui.cvv = {};
ui.expiryCurrent = {};
ui.expiryMonth = {};
ui.expiryYear = {};
@ -57,6 +59,7 @@ import { settings, elements, apiGet, apiPost, parseParams, setupHeader } from "/
var req = {
"card_number": ui.ccNew.value,
"cvv": ui.cvv.value,
"expiry_month": parseInt(ui.expiryMonth.value),
"expiry_year": parseInt(ui.expiryYear.value)
};
@ -78,6 +81,7 @@ import { settings, elements, apiGet, apiPost, parseParams, setupHeader } from "/
// Get element references
ui.ccCurrent = document.getElementById(elements.ccCurrent);
ui.ccNew = document.getElementById(elements.ccNew);
ui.cvv = document.getElementById(elements.cvv);
ui.expiryCurrent = document.getElementById(elements.expiryCurrent);
ui.expiryMonth = document.getElementById(elements.expiryMonth);
ui.expiryYear = document.getElementById(elements.expiryYear);

5
account/creditcard/index.shtml

@ -58,6 +58,11 @@ along with Linode Manager Classic. If not, see <https://www.gnu.org/licenses/>.
<td><input id="cc-new" type="text" /></td>
<td class="info">Linode accepts Visa, MasterCard, American Express, and Discover</td>
</tr>
<tr class="lmc-tr3">
<td>CVV</td>
<td><input id="cvv" type="text" size="8" /></td>
<td></td>
</tr>
<tr class="lmc-tr3">
<td>Expires</td>
<td>

Loading…
Cancel
Save