David Biga
David Biga

Reputation: 2801

Bank Recipient - Stripe API

I am currently trying to setup a user experience to enable the user to put down banking information to be stored as a recipient in order to transfer funds to account they set up.

Here is the issue:

When user sends in information, Stripe creates a token and that, using ajax is sent over to a .PHP file which handles the creation of the recipient account. But on the creation of the recipient I get a 500 Error:

POST /functions/stripeAcc/makeCustomer.php 500 (Internal Server Error) jquery-latest.min.js:2

send - jquery-latest.min.js:2
p.extend.ajax - jquery-latest.min.js:2
stripeResponseHandler
e.ajaxJSONP.success js.stripe.com/:1
window.(anonymous function) js.stripe.com/:1
(anonymous function) tokens:1

Here is the PHP file:

...
    $email = $_POST['email'];
    $name = $_POST['cardholderfullname'];
    $token = $_POST['token'];
    require_once('./stripe-php/lib/Stripe.php');

    Stripe::setApiKey("mykey");

    $recipient = Stripe_Recipient::create(array(
      "name" => $name,
      "type" => "individual",
      "bank_account" => $token,
      "email" => $email)
    );
... This is where the 500 happens

Now after I check my logs inside the logs on my Stripe Account I notice a call being placed with a 200 status (this mean everything worked) except a recipient did not get made, so that is confusing right there.

Log file:

Summary

Time:
2013/07/13 20:09:45
Method:
POST
URL:
/v1/tokens
Status:
200
IP address:
71.239.53.232

Parsed Request Query Parameters

bank_account:
country: "US"
routing_number: "110000000"
account_number: "********6789"
key: "myKey"
callback: "sjsonp1373746168110"
_method: "POST"

Response body

id: btok_2BxFI1xYXF8ECd
livemode: false
created: 1373746185
used: false
object: "token"
type: "bank_account"
bank_account:
object: "bank_account"
bank_name: "STRIPE TEST BANK"
last4: "6789"
country: "US"
validated: false
fingerprint: "wC1v8BWXZe7MyW3n"

I am using the test credentials for the Account number and Routing number:

Routing numbers

Number  Type
110000000   STRIPE TEST BANK US routing number
Account numbers

Number  Type
000123456789    Successful US account number

Upvotes: 1

Views: 2762

Answers (1)

David Biga
David Biga

Reputation: 2801

I am sure some of you were stumped but I figured it out:

The issue was that, they updated the version of the API and my version did not have the recipient file within the API on my server. Crazy right? You would think they would notify you or something.

Thanks for the help.

Upvotes: 1

Related Questions