RecurlyPushListenerController doesn't pass client object when calling \Recurly_Account::get

Created on 8 March 2023, over 1 year ago
Updated 23 March 2023, over 1 year ago

Problem/Motivation

The RecurlyPushListenerController code calls \Recurly_Account::get but doesn't pass the client object 2nd argument to the get method. And, because in this code path the client hasn't been initialized globally, the get call fails and the code throws an Recurly_UnauthorizedError error because there's no API key. And no valid client object.

Proposed resolution

Change the call from \Recurly_Account::get($notification->account->account_code); to \Recurly_Account::get($notification->account->account_code, $this->recurlyClient);

Remaining tasks

This needs tests. Probably a Kernel test that makes an HTTP POST β†’ with the XML payload the recurly would normally send to the recurly webhook listener URL, which routes to RecurlyPushListenerController. Or something like that ... Given the way this reads from file_get_content('php://input') I'm not sure how to mock the payload from recurly otherwise.

πŸ› Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States eojthebrave Minneapolis, MN

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024