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