Skip to content
Snippets Groups Projects
Commit 163c1fd6 authored by Rich's avatar Rich Committed by mattwire
Browse files

Move listevents to using stripeClient and Civi\Payment\System to get processor singletons

parent 2382c8a8
No related branches found
No related tags found
1 merge request!1526.6 to master
......@@ -291,7 +291,7 @@ function civicrm_api3_stripe_Listevents($params) {
}
// Now query stripe directly to see if there are any that system log didn't record.
$processor = new CRM_Core_Payment_Stripe('', civicrm_api3('PaymentProcessor', 'getsingle', ['id' => $params['ppid']]));
$processor = \Civi\Payment\System::singleton()->getById($params['ppid']);
$processor->setAPIParams();
$invoices = $processor->stripeClient->invoices->all(['subscription' => $subscription]);
$seen_invoices = [];
......@@ -317,7 +317,7 @@ function civicrm_api3_stripe_Listevents($params) {
// Query the last month of Stripe events.
elseif ($source == 'stripe') {
// Here we need to get a singleton xxx
$processor = new CRM_Core_Payment_Stripe('', civicrm_api3('PaymentProcessor', 'getsingle', ['id' => $params['ppid']]));
$processor = \Civi\Payment\System::singleton()->getById($params['ppid']);
$processor->setAPIParams();
$args = [];
if ($type) {
......@@ -331,7 +331,7 @@ function civicrm_api3_stripe_Listevents($params) {
if ($starting_after) {
$args['starting_after'] = $starting_after;
}
$data_list = \Stripe\Event::all($args);
$data_list = $processor->stripeClient->events->all($args);
}
// Query the system log.
......
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