PluginProbe
Pay with Vipps and MobilePay for WooCommerce / 6.2.5
Pay with Vipps and MobilePay for WooCommerce v6.2.5
6.2.5 6.2.4 6.2.3 6.2.2 6.2.1 6.2.0 6.1.10 6.1.9 6.1.8 6.1.7 6.1.6 6.1.5 6.1.4 6.1.3 6.1.2 6.1.1 6.1.0 6.0.5 6.0.4 6.0.3 6.0.2 6.0.1 6.0.0 5.4.3 5.4.2 All 187 releases
woo-vipps / recurring / includes / models / WC_Vipps_Checkout_Session_Merchant_Info.php

WC_Vipps_Checkout_Session_Merchant_Info.php in Pay with Vipps and MobilePay for WooCommerce 6.2.5, at recurring/includes/models/WC_Vipps_Checkout_Session_Merchant_Info.php

59 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 defined( 'ABSPATH' ) || exit;
4
5 class WC_Vipps_Checkout_Session_Merchant_Info extends WC_Vipps_Model {
6 protected array $required_fields = [
7 "callback_url",
8 "return_url",
9 "callback_authorization_token"
10 ];
11
12 public ?string $callback_url = null;
13 public ?string $return_url = null;
14 public ?string $callback_authorization_token = null;
15 public ?string $terms_and_conditions_url = null;
16
17 public function set_callback_url( string $callback_url ): self {
18 $this->callback_url = $callback_url;
19
20 return $this;
21 }
22
23 public function set_return_url( string $return_url ): self {
24 $this->return_url = $return_url;
25
26 return $this;
27 }
28
29 public function set_callback_authorization_token( string $callback_authorization_token ): self {
30 $this->callback_authorization_token = $callback_authorization_token;
31
32 return $this;
33 }
34
35 public function set_terms_and_conditions_url( string $terms_and_conditions_url ): self {
36 $this->terms_and_conditions_url = $terms_and_conditions_url;
37
38 return $this;
39 }
40
41 /**
42 * @throws WC_Vipps_Recurring_Missing_Value_Exception
43 */
44 public function to_array( bool $check_required = false ): array {
45 if ( $check_required ) {
46 $this->check_required();
47 }
48
49 return array_merge(
50 [
51 "callbackUrl" => $this->callback_url,
52 "returnUrl" => $this->return_url,
53 "callbackAuthorizationToken" => $this->callback_authorization_token,
54 ],
55 $this->conditional( "termsAndConditionsUrl", $this->terms_and_conditions_url ),
56 );
57 }
58 }
59