app-context-trait.php
39 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace JFB_Modules\Gateways\Paypal\Api_Actions\Traits; |
| 5 | |
| 6 | // If this file is called directly, abort. |
| 7 | if ( ! defined( 'WPINC' ) ) { |
| 8 | die; |
| 9 | } |
| 10 | |
| 11 | /** |
| 12 | * Trait AppContextTrait |
| 13 | * |
| 14 | * @package Jet_FB_Paypal\ApiActions |
| 15 | */ |
| 16 | trait App_Context_Trait { |
| 17 | |
| 18 | private $app_context = array(); |
| 19 | |
| 20 | public function set_app_context( array $context ) { |
| 21 | $this->app_context = array_merge( |
| 22 | $this->app_context, |
| 23 | array( |
| 24 | 'landing_page' => 'BILLING', |
| 25 | 'user_action' => $this->action_slug(), |
| 26 | 'brand_name' => get_option( 'blogname' ), |
| 27 | ), |
| 28 | $context |
| 29 | ); |
| 30 | |
| 31 | return $this; |
| 32 | } |
| 33 | |
| 34 | public function get_app_context() { |
| 35 | return $this->app_context; |
| 36 | } |
| 37 | |
| 38 | } |
| 39 |