Skip to content
Snippets Groups Projects
Commit b9c78da7 authored by Clark Stacer's avatar Clark Stacer
Browse files

No $charge->fee field returned by Stripe

Stripe was not returning the fee with recurring payments, so this was causing 500 error.
parent 18482c73
No related branches found
No related tags found
No related merge requests found
......@@ -85,7 +85,7 @@ class CRM_Stripe_Page_Webhook extends CRM_Core_Page {
$stripe_customer = Stripe_Customer::retrieve($customer_id);
$recieve_date = date("Y-m-d H:i:s", $charge->created);
$total_amount = $charge->amount / 100;
$fee_amount = $charge->fee / 100;
$fee_amount = isset($charge->fee) ? ($charge->fee / 100) : 0;
$net_amount = $total_amount - $fee_amount;
$transaction_id = $charge->id;
$new_invoice_id = $stripe_event_data->data->object->id;
......@@ -215,7 +215,7 @@ class CRM_Stripe_Page_Webhook extends CRM_Core_Page {
// Build some params.
$recieve_date = date("Y-m-d H:i:s", $charge->created);
$total_amount = $charge->amount / 100;
$fee_amount = $charge->fee / 100;
$fee_amount = isset($charge->fee) ? ($charge->fee / 100) : 0;
$net_amount = $total_amount - $fee_amount;
$transaction_id = $charge->id;
if (empty($recur_contrib_query->campaign_id)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment