traits
3 years ago
base-action.php
3 years ago
capture-payment-action.php
3 years ago
get-token.php
3 years ago
pay-now-action.php
3 years ago
base-action.php
30 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Jet_Form_Builder\Gateways\Paypal\Api_Actions; |
| 5 | |
| 6 | use Jet_Form_Builder\Gateways\Base_Gateway_Action; |
| 7 | use Jet_Form_Builder\Gateways\Gateway_Manager; |
| 8 | |
| 9 | abstract class Base_Action extends Base_Gateway_Action { |
| 10 | |
| 11 | public function base_url(): string { |
| 12 | return Gateway_Manager::instance()->is_sandbox |
| 13 | ? 'https://api-m.sandbox.paypal.com/' |
| 14 | : 'https://api-m.paypal.com/'; |
| 15 | } |
| 16 | |
| 17 | public function get_request_args(): array { |
| 18 | $args = parent::get_request_args(); |
| 19 | |
| 20 | $args['user-agent'] = sprintf( |
| 21 | 'JetFormBuilder/%s; %s', |
| 22 | jet_form_builder()->get_version(), |
| 23 | get_bloginfo( 'name' ) |
| 24 | ); |
| 25 | |
| 26 | return $args; |
| 27 | } |
| 28 | |
| 29 | } |
| 30 |