Until beta 4 the listener stubs had a list of methods we could use. In beta 5 you added a use statement for IPS\Db but removed all methods.
Any specific reason why you removed them? 🙄
This is InvoiceListenerType.txt from beta :
namespace IPS\{app}\listeners; /* To prevent PHP errors (extending class does not exist) revealing path */ use IPS\Db; use IPS\Events\ListenerType\InvoiceListenerType; use IPS\Member as MemberClass; use IPS\nexus\Invoice as InvoiceClass; use function defined; if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) ) { header(($_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0') . ' 403 Forbidden'); exit; } /** * Invoice Listener */ class {filename} extends InvoiceListenerType { }
This is the same file from beta 4:
namespace IPS\{app}\listeners; /* To prevent PHP errors (extending class does not exist) revealing path */ use IPS\Events\ListenerType\InvoiceListenerType; use IPS\Member as MemberClass; use IPS\nexus\Invoice as InvoiceClass; use function defined; if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) ) { header(($_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0') . ' 403 Forbidden'); exit; } /** * Invoice Listener */ class {filename} extends InvoiceListenerType { /** * Fired when the invoice status is changed (e.g. unpaid to paid) * * @param InvoiceClass $invoice * @param string $status The new status * @return void */ public function onStatusChange( InvoiceClass $invoice, string $status ) : void { } /** * Fired when a member is created by an invoice. * * @param InvoiceClass $invoice * @param MemberClass $member The new member * @param array $guestData The original values of InvoiceClass::$guest_data * @return void */ public function onCreateAccountForGuest( InvoiceClass $invoice, MemberClass $member, array $guestData ) : void { } /** * Fired at each checkout step (before submission) * * @param InvoiceClass $invoice * @param string $step The checkout step (customer|pay) * @return void */ public function onCheckout( InvoiceClass $invoice, string $step ) : void { } }
Recommended Comments