我目前正在關注製作自定義付款表格的Stripe s教程,並且我想使用skeuocard作爲我的表單。不幸的是,它似乎添加data-stripe
屬性的基本形式不會將它們帶入窗體的skeuomorphic視圖。有沒有辦法讓skeuocard複製這些data-stripe
屬性,這樣我就可以使用它,或者在這一點上使用條紋可嵌入表單會更好嗎?使用Stripe.js和Skeuocard
具體形式我有如下:
<div class="credit-card-input no-js" skeuocard id="skeuocard">
<p class="no-support-warning alert alert-warning">
Since you have JavaScript disabled, you can't use the awesome credit card entry service. Oh well.
</p>
<label for="cc_type">Card Type</label>
<select name="cc_type" id="cc_type">
<option value="">...</option>
<option value="visa">Visa</option>
<option value="discover">Discover</option>
<option value="mastercard">MasterCard</option>
<option value="maestro">Maestro</option>
<option value="jcb">JCB</option>
<option value="unionpay">China UnionPay</option>
<option value="amex">American Express</option>
<option value="dinersclubintl">Diners Club</option>
</select>
<label for="cc_number">Card Number</label>
<input type="text" name="cc_number" id="cc_number" placeholder="XXXX XXXX XXXX XXXX" maxlength="19" size="19" data-stripe="number">
<label for="cc_exp_month">Expiration Month</label>
<input type="text" name="cc_exp_month" id="cc_exp_month" placeholder="00" data-stripe="exp-month">
<label for="cc_exp_year">Expiration Year</label>
<input type="text" name="cc_exp_year" id="cc_exp_year" placeholder="00" data-stripe="exp-year">
<label for="cc_name">Cardholder's Name</label>
<input type="text" name="cc_name" id="cc_name" placeholder="John Doe" data-stripe="name">
<label for="cc_cvc">Card Validation Code</label>
<input type="text" name="cc_cvc" id="cc_cvc" placeholder="123" maxlength="3" size="3" data-stripe="cvc">
</div>
謝謝。我最終沒有使用這個解決方案,但它看起來很穩固。 – Seiyria
向輸入添加名稱屬性並不是一個好主意,因爲這會將信用卡信息發送到您的服務器,從而否定了使用Stripe:PCI合規性的最大優勢之一。 –
感謝您的反饋啓。我已經修改了答案。 – adelphospro