Skip to content
Snippets Groups Projects
Commit 5fce6f1f authored by Joshua Walker's avatar Joshua Walker
Browse files

Merge pull request #21 from w3geekery/patch-2

No $charge->fee field returned by Stripe
parents 18482c73 b9c78da7
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.
Please register or to comment