如何在jquery.payment库

时间:2016-08-02 05:20:21

标签: jquery

我将此plugin用于信用卡。我想添加长度为19位的自定义卡。我不知道该怎么做,我在搜索时没有找到任何资源。请帮我如何使用$ .payment.cards。这是我的fiddle。我尝试使用那样的

$.payment.cards.push({
            // Card type, as returned by $.payment.cardType.
            type: 'mastercard',
            // Array of prefixes used to identify the card type.
            patterns: [
              51, 52, 53, 54, 55,
              22, 23, 24, 25, 26, 27
            ],
            // Array of valid card number lengths.
            length: [19],
            // Array of valid card CVC lengths.
            cvcLength: [3],
            // Boolean indicating whether a valid card number should satisfy the Luhn check.
            luhn: true,
            // Regex used to format the card number. Each match is joined with a space.
            format: /(\d{1,4})/g
    }
)

1 个答案:

答案 0 :(得分:1)

答案是我必须使用unshift方法而不是push

  

你好@SerikK。您可以使用19位数的自定义卡。您的模式被另一个模式掩盖(按顺序选择它们)。您希望使用更具体的模式并使用unshift而不是推送。

- 您可以看到作者here的原始答案。

相关问题