2016-04-24 7 views
6

Sono uno sviluppatore iOS che desidera aggiungere il pagamento Stripe a una delle mie app. Ho creato una pagina sul mio sito SSL che ospita il codice suggerito dal link sottostante:Errore Forbidden (403) durante l'elaborazione dei pagamenti Stripe sul server di casa

https://stripe.com/docs/charges

Quando tento di elaborare un pagamento, ricevo un '(403) proibito' errore. Qualcuno può consigliare cosa potrei fare di sbagliato? Tutto il codice nel mio file di Ruby è la seguente:

stripe.api_key = "MySecretKeyGoesHere" 

token = request.POST['stripeToken'] 

try: 
    charge = stripe.Charge.create(
    amount=1000, # amount in cents, again 
    currency="gbp", 
    source=token, 
    description="Example charge" 
) 
except stripe.error.CardError, e: 
# The card has been declined 
pass 

ci sono esempi di questo in molte lingue principali, sono felice di utilizzare qualsiasi di loro, ma attualmente sto provando le versioni Ruby e Python.

+0

Posso sapere se si sta utilizzando la modalità live o la modalità Test per i pagamenti con stripe? – Jitendra

+0

Sto lavorando in modalità Live –

+0

Come si può importare con le virgolette attorno all'identificatore in python? Sei un mago? ^^ – CodenameLambda

risposta

0

importo int = 10000; // $ 100,00 int applicationFee = int (importo * 0,3); // 30 parti%

Map<String, Object> chargeParams = new HashMap<String, Object>(); 
chargeParams.put("amount", amount); 
chargeParams.put("currency", "usd"); 
chargeParams.put("description", "Example charge"); 
chargeParams.put("customer", customerId); // customerId is the ID of the customer object for the paying person  
chargeParams.put("destination", accountId); // accountId is the ID of the account object for the vendor that should be paid 
chargeParams.put("application_fee", applicationFee); 
Charge.create(chargeParams); 
  1. Controllare anche se si utilizza corretta vivo chiave segreta e live Pubblicabile chiave nella configurazione lato server.
  2. check account esegue per verificare qual è il problema esatto si trovano ad affrontare durante l'elaborazione di pagamenti a https://dashboard.stripe.com/logs?method=not_get
  3. Verifica il tuo Connected account sulla banda

    Dettagli account: Verificahttps://dashboard.stripe.com/account/details
    Identità: https://stripe.com/docs/connect/identity-verification

  4. Collegamenti alla documentazione: -
    [1] https://stripe.com/docs/api#create_charge
    [2] https://stripe.com/docs/api#create_transfer
    [3] https://stripe.com/docs/api#create_refund
    [4] https://stripe.com/docs/api#balance_object
    [5] https://stripe.com/docs/connect/payments-fees#charging-directly
    [6] https://stripe.com/docs/connect/authentication#authentication-via-the-stripe-account-header
    [7] https://stripe.com/docs/connect/payments-fees#charging-through-the-platform
+1

Puoi spiegare per favore cosa risolve e dove va? grazie –

+0

Pleas controllare il saldo del tuo account che ha sufficiente equilibrio per elaborare il processo di pagamento. Prova a stampare il saldo disponibile mentre crei addebiti. Verificare inoltre che se si utilizzano chiavi private e pubbliche corrette nella configurazione lato server. – Jitendra

+0

Ti capita di avere un server Stripe live? –

Problemi correlati