Here is my php code for stripe transaction for taking the application fee from customer using my platform:
$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);
and here is my response (partial)
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
i am having difficulty for how i can catch the the value "id => ch_16K6q5HzfYmjyH786HG5a2gp" from _values:protected array
i have tried the following syntaxes
$charge->_values:protected and $charge['_values:protected']
but not able to grab the response, can any one here to help to catch the response in stripe connect transactions using php
try this instead of dumping the entire object
print $charge->id;