if (\XF::config('enableLivePayments'))
{
$key = $paymentProfile->options['live_secret_key'];
}
else
{
$key = $paymentProfile->options['test_secret_key'];
}
\Stripe\Stripe::setApiKey($key);
$charge = \Stripe\Charge::retrieve([
'id' => $state->event['id'],
'expand' => ['balance_transaction']
]);
$fee = $charge->balance_transaction->fee;