我目前正在尝试设置用户体验,以使用户能够将银行信息存储为收件人,以便将资金转移到他们设置的帐户。
这是问题:
当用户发送信息时,Stripe 创建一个令牌,并使用 ajax 将其发送到一个 .PHP 文件,该文件处理收件人帐户的创建。但是在创建收件人时,我得到一个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
这是PHP文件:
...
$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
现在,在我检查我的logs
Stripe 帐户中的日志后,我注意到一个呼叫被拨打200 status
(这意味着一切正常),除了没有接听者,所以这很令人困惑。
日志文件:
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"
我正在使用帐号和路由号码的测试凭据:
Routing numbers
Number Type
110000000 STRIPE TEST BANK US routing number
Account numbers
Number Type
000123456789 Successful US account number