PluginProbe
Pay with Vipps and MobilePay for WooCommerce / 5.4.3
Pay with Vipps and MobilePay for WooCommerce v5.4.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 5.4.1 5.4.0 5.3.4 All 184 releases
woo-vipps / recurring / includes / models / WC_Vipps_Checkout_Session_Response.php

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

51 lines 1.1 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_Response extends WC_Vipps_Model {
6 protected array $required_fields = [
7 "token",
8 "checkout_frontend_url",
9 "polling_url"
10 ];
11
12 public ?string $token = null;
13 public ?string $checkout_frontend_url = null;
14 public ?string $polling_url = null;
15
16 public function set_token( string $token ): self {
17 $this->token = $token;
18
19 return $this;
20 }
21
22 public function set_checkout_frontend_url( string $checkout_frontend_url ): self {
23 $this->checkout_frontend_url = $checkout_frontend_url;
24
25 return $this;
26 }
27
28 public function set_polling_url( string $polling_url ): self {
29 $this->polling_url = $polling_url;
30
31 return $this;
32 }
33
34 /**
35 * @throws WC_Vipps_Recurring_Missing_Value_Exception
36 */
37 public function to_array( bool $check_required = false ): array {
38 if ( $check_required ) {
39 $this->check_required();
40 }
41
42 return array_merge(
43 [
44 "token" => $this->token,
45 "checkoutFrontendUrl" => $this->checkout_frontend_url,
46 "pollingUrl" => $this->polling_url,
47 ],
48 );
49 }
50 }
51