PluginProbe
Pay with Vipps and MobilePay for WooCommerce / 6.0.4
Pay with Vipps and MobilePay for WooCommerce v6.0.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 5.4.1 5.4.0 All 185 releases
woo-vipps / recurring / includes / models / WC_Vipps_Checkout_Session_Amount.php

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

40 lines 716 B
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_Amount extends WC_Vipps_Model {
6 protected array $required_fields = [
7 "value",
8 "currency",
9 ];
10
11 public ?int $value = null;
12 public ?string $currency = null;
13
14 public function set_value( int $value ): self {
15 $this->value = $value;
16
17 return $this;
18 }
19
20 public function set_currency( string $currency ): self {
21 $this->currency = $currency;
22
23 return $this;
24 }
25
26 /**
27 * @throws WC_Vipps_Recurring_Missing_Value_Exception
28 */
29 public function to_array( bool $check_required = false ): array {
30 if ( $check_required ) {
31 $this->check_required();
32 }
33
34 return [
35 "value" => $this->value,
36 "currency" => $this->currency,
37 ];
38 }
39 }
40