这是我的条带交易的 php 代码,用于使用我的平台从客户那里收取申请费:
$token = $_POST['stripeToken'];
// Create the charge on Stripe's servers - this will charge the user's card
$charge = \Stripe\Charge::create(
array(
"amount" => 1000, // amount in cents
"currency" => "usd",
"source" => $token,
"description" => "Event charge",
"application_fee" => 123 // amount in cents
),
array("stripe_account" => $sInfo->stripe_user_id)
);
echo '<pre>';
print_r($charge);
这是我的回复(部分)
Stripe\Charge Object
(
[_opts:protected] => Stripe\Util\RequestOptions Object
(
[headers] => Array
(
[Stripe-Account] => acct_16JkaUHzfYmjyH68
)
[apiKey] => sk_test_mHnhDuaVjnKmdkEApnYAKfGY
)
[_values:protected] => Array
(
[id] => ch_16K6q5HzfYmjyH786HG5a2gp
[object] => charge
[created] => 1435840249
[livemode] =>
[paid] => 1
[status] => succeeded
[amount] => 1000
[currency] => usd
[refunded] =>
[source] => Stripe\Card Object
我很难从 _values:protected array 中捕获值“id => ch_16K6q5HzfYmjyH786HG5a2gp”
我尝试了以下语法
$charge->_values:protected and $charge['_values:protected']
但无法获取响应,这里的任何人都可以帮助使用 php 在条带连接事务中捕获响应