Passed
Pull Request — master (#74)
by oleksandr
05:10
created

assets/Yves/js/modules/main.js   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 67
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 50
mnd 0
bc 0
fnc 1
dl 0
loc 67
bpm 0
cpm 1
noi 1
c 0
b 0
f 0
rs 10
1
/**
2
 * MIT License
3
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
4
 */
5
6
'use strict';
7
8
var $ = require('jquery');
9
var paymentMethod = require('./payment-method');
10
11
$(document).ready(function() {
12
    // Configuration for Hosted Iframe.
13
    // https://github.com/fjbender/simple-php-integration#build-the-form
14
    var config = {
15
        fields: {
16
            cardpan: {
17
                selector: "cardpan",
18
                type: "text",
19
            },
20
            cardcvc2: {
21
                selector: "cardcvc2",
22
                type: "password",
23
                size: "4",
24
                maxlength: "4",
25
            },
26
            cardexpiremonth: {
27
                selector: "cardexpiremonth",
28
                type: "select",
29
                size: "2",
30
                maxlength: "2",
31
                iframe: {
32
                    width: "50px",
33
                }
34
            },
35
            cardexpireyear: {
36
                selector: "cardexpireyear",
37
                type: "select",
38
                iframe: {
39
                    width: "80px",
40
                }
41
            }
42
        },
43
        defaultStyle: {
44
            input: "font-size: 1em;height: 2.4375rem;border-radius: 5px;border: 1px solid #cacaca;",
45
            select: "font-size: 1em;height: 2.4375rem;border-radius: 5px;border: 1px solid #cacaca; background-color: #fefefe;",
46
            iframe: {
47
                height: "50px",
48
                width: "180px"
49
            }
50
        },
51
        error: "errorOutput",
52
        language: Payone.ClientApi.Language.de
0 ignored issues
show
Bug introduced by
The variable Payone seems to be never declared. If this is a global, consider adding a /** global: Payone */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
53
    };
54
55
    paymentMethod.init({
56
        formSelector: '[name="paymentForm"]',
57
        formId: 'payment-form',
58
        paymentMethodSelector: 'input[type="radio"][name="paymentForm[paymentSelection]"]',
59
        currentPaymentMethodSelector: 'input[type="radio"][name="paymentForm[paymentSelection]"]:checked',
60
        cardholderInput: '#paymentForm_payoneCreditCard_cardholder',
61
        clientApiConfigInput: '#paymentForm_payoneCreditCard_payone_client_api_config',
62
        languageInput: '#Payone_credit_card_payone_client_lang_code',
63
        bankAccountModeBbanInput: '#paymentForm_payoneDirectDebit_bankaccountmode_0',
64
        bankAccountModeIbanBicInput: '#paymentForm_payoneDirectDebit_bankaccountmode_1',
65
        bankAccountInput: '#paymentForm_payoneDirectDebit_bankaccount',
66
        bankCodeInput: '#paymentForm_payoneDirectDebit_bankcode',
67
        ibanInput: '#paymentForm_payoneDirectDebit_iban',
68
        bicInput: '#paymentForm_payoneDirectDebit_bic',
69
        errorDivSelector: '#errorOutput',
70
        hostedIframeConfig: config
71
    });
72
});