Core components for the WordPress payment processing library. This library is used in the WordPress plugin Pronamic Pay: https://www.pronamicpay.com/, but also allows other plugin developers to set up a payment plugin.
Within a WordPress environment it is sometimes important that instances of classes are only created once, for example to prevent double filter and action hooks. For example, there are several iDEAL Basic providers, but it is not necessary to register several pronamic-pay/ideal-basic/v1/notification REST API endpoints.
Within the Pronamic Pay plugins only 1 \Pronamic\WordPress\Pay\Gateways\IDealBasic\NotificationController instance needs to exist. The Pronamic\WordPress\Pay\Plugin is already a singleton class, we could use this object to keep track of other singletons (container).
Within a WordPress environment it is sometimes important that instances of classes are only created once, for example to prevent double filter and action hooks. For example, there are several iDEAL Basic providers, but it is not necessary to register several
pronamic-pay/ideal-basic/v1/notification
REST API endpoints.Within the Pronamic Pay plugins only 1
\Pronamic\WordPress\Pay\Gateways\IDealBasic\NotificationController
instance needs to exist. ThePronamic\WordPress\Pay\Plugin
is already a singleton class, we could use this object to keep track of other singletons (container).https://github.com/pronamic/wp-pay-core/blob/d2f591e9482272b62eda0dd1df9cfc669e7faec1/src/Plugin.php#L78-L91