PluginProbe
Stripe Payment Forms by WP Simple Pay – Accept Credit Card Payments + Subscriptions with Stripe / trunk
Stripe Payment Forms by WP Simple Pay – Accept Credit Card Payments + Subscriptions with Stripe vtrunk
4.17.3 trunk 2.2.0 2.3.0 2.3.1 2.3.2 2.3.3 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.6.0 2.6.1 2.6.2 2.6.3 4.10.0 4.11.1 4.12.2 4.14.1 4.14.2 4.14.3 4.15.0 4.16.0 All 59 releases
stripe / src / Transaction / TransactionServiceProvider.php

TransactionServiceProvider.php in Stripe Payment Forms by WP Simple Pay – Accept Credit Card Payments + Subscriptions with Stripe trunk, at src/Transaction/TransactionServiceProvider.php

77 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Transactions: Service provider
4 *
5 * @package SimplePay
6 * @subpackage Core
7 * @copyright Copyright (c) 2022, Sandhills Development, LLC
8 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9 * @since 4.4.6
10 */
11
12 namespace SimplePay\Core\Transaction;
13
14 use SimplePay\Core\AbstractPluginServiceProvider;
15 use SimplePay\Vendor\League\Container\ServiceProvider\BootableServiceProviderInterface;
16
17 /**
18 * TransactionsServiceProvider class.
19 *
20 * @since 4.4.6
21 */
22 class TransactionServiceProvider extends AbstractPluginServiceProvider implements BootableServiceProviderInterface {
23
24 /**
25 * {@inheritdoc}
26 */
27 public function get_services() {
28 return array(
29 'transaction-repository',
30 );
31 }
32
33 /**
34 * {@inheritdoc}
35 */
36 public function get_subscribers() {
37 return array(
38 'transaction-observer',
39 );
40 }
41
42 /**
43 * {@inheritdoc}
44 */
45 public function boot() {
46 $container = $this->getContainer();
47
48 // Install repository table.
49 // Create the table with BerlinDB.
50 // Call maybe_upgrade() immediately instead of waiting for admin_init.
51 $table = new Database\Table;
52 $table->maybe_upgrade();
53
54 // Repository.
55 $container->share(
56 'transaction-repository',
57 TransactionRepository::class
58 );
59 }
60
61 /**
62 * {@inheritdoc}
63 */
64 public function register() {
65 $container = $this->getContainer();
66
67 // Observer.
68 $container->share(
69 'transaction-observer',
70 TransactionObserver::class
71 )
72 ->withArgument( $container->get( 'transaction-repository' ) )
73 ->withArgument( $container->get( 'stripe-connect-application-fee' ) );
74 }
75
76 }
77