這是條紋的例子在Javascript中:
包括Stripe.js
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
設置您發佈的關鍵:
Stripe.setPublishableKey('YOUR_PUBLISHABLE_KEY');
發送數據:
Stripe.card.createToken({
number: $('.card-number').val(),
cvc: $('.card-cvc').val(),
exp_month: $('.card-expiry-month').val(),
exp_year: $('.card-expiry-year').val()
}, stripeResponseHandler);
RESP ONSE:
function stripeResponseHandler(status, response) {
var $form = $('#payment-form');
if (response.error) {
// Show the errors on the form
$form.find('.payment-errors').text(response.error.message);
$form.find('button').prop('disabled', false);
} else {
// response contains id and card, which contains additional card details
var token = response.id;
// Insert the token into the form so it gets submitted to the server
$form.append($('<input type="hidden" name="stripeToken" />').val(token));
// and submit
$form.get(0).submit();
}
}
的詳細檢查此鏈接 https://stripe.com/docs/stripe.js
感謝相關的,你是正確的,我沒有使用omnipay橋條紋實施 – Baig 2015-02-12 09:17:16