2016-03-20 10 views
0

私のeコマースウェブサイトにStripeを使用していますが、何らかの理由でエラーが発生していません。新しい顧客がストライプダッシュボードに登録されていません。ダッシュボードに新規顧客が登録されていないストライプ

ある時点では機能していましたが、もはや機能しませんでした。私はStripeウェブサイトのチュートリアルに従った。ここで

は、コードは次のとおりです。

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> 

    <script type="text/javascript"> 
Stripe.setPublishableKey('pk_test_Zr7oAROGNha5GcEdthCemM0a'); 

function stripeResponseHandler(status, response) { 

    var $form = $('#signupform'); 

    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(); 
    } 
}; 

jQuery(function($) { 
    $('#signupform').submit(function(event) { 
    var $form = $(this); 

    // Disable the submit button to prevent repeated clicks 
    $form.find('button').prop('disabled', true); 

    Stripe.card.createToken($form, stripeResponseHandler); 

    // Prevent the form from submitting with the default action 
    return false; 
    }); 
}); 

答えて

0

あなたのストライプのログには何を見ていますか?あまりに

https://dashboard.stripe.com/logs?method=not_get

成功のみ/ V1 /トークンへの呼び出し、または/ V1 /トークンおよび/ V1 /顧客?

通常、これはトークンを作成するときに発生しますが、顧客やバックエンドの料金も作成されません。 Stripeを使用して顧客に請求することは、常に2段階のプロセスになります。

ステップ1:CheckoutまたはStripe.jsフォームでお客様のクレジットカード情報を収集し、それをStripeに渡すと、Stripeはトークンを返します。

ステップ2:このトークンを取得してバックエンドに渡した後、Stripeに料金を請求するか、後で請求する顧客に保存します。これを処理し、POSTパラメーターからトークンを取得するには、サーバー上にスクリプトが必要です。ここにコードサンプルがありますhttps://stripe.com/docs/tutorials/charges

これはあなたのために起こっていないようですね---バックエンドスクリプトが既にある場合、情報がストライプに達する前に失敗する可能性があります。サーバーとエラーログを確認して、正確な内容をさらに詳しく調べることをおすすめします。