Skip to content
Snippets Groups Projects
Commit f5b8e693 authored by mattwire's avatar mattwire
Browse files

Only try to update metadata at Stripe once!

parent 53f6f585
No related branches found
No related tags found
No related merge requests found
...@@ -118,18 +118,12 @@ class CRM_Stripe_BAO_StripeCustomer extends CRM_Stripe_DAO_StripeCustomer { ...@@ -118,18 +118,12 @@ class CRM_Stripe_BAO_StripeCustomer extends CRM_Stripe_DAO_StripeCustomer {
// Could be multiple customer_id's and/or stripe processors // Could be multiple customer_id's and/or stripe processors
foreach ($customers as $customer) { foreach ($customers as $customer) {
/** @var CRM_Core_Payment_Stripe $stripe */ /** @var CRM_Core_Payment_Stripe $stripe */
\Civi\Api4\StripeCustomer::updateStripe(FALSE) StripeCustomer::updateStripe(FALSE)
->setPaymentProcessorID($customer['processor_id']) ->setPaymentProcessorID($customer['processor_id'])
->setContactID($contactID) ->setContactID($contactID)
->setCustomerID($customer['customer_id']) ->setCustomerID($customer['customer_id'])
->execute() ->execute()
->first(); ->first();
$stripe = \Civi\Payment\System::singleton()->getById($customer['processor_id']);
CRM_Stripe_BAO_StripeCustomer::updateMetadata(
['contact_id' => $contactID, 'processor_id' => $customer['processor_id']],
$stripe,
$customer['customer_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