# woo-vipps/6.2.5/recurring/includes/models/WC_Vipps_Checkout_Session_Amount.php

Pay with Vipps and MobilePay for WooCommerce, version 6.2.5. 40 lines.

- Page: https://pluginprobe.com/plugins/woo-vipps/6.2.5/code/recurring/includes/models/WC_Vipps_Checkout_Session_Amount.php
- Raw: https://pluginprobe.com/plugins/woo-vipps/6.2.5/raw/recurring/includes/models/WC_Vipps_Checkout_Session_Amount.php
- Modified: 2025-01-13T14:06:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/woo-vipps/6.2.5/code/recurring/includes/models/WC_Vipps_Checkout_Session_Amount.php#L10-L20`.

```php
<?php

defined( 'ABSPATH' ) || exit;

class WC_Vipps_Checkout_Session_Amount extends WC_Vipps_Model {
	protected array $required_fields = [
		"value",
		"currency",
	];

	public ?int $value = null;
	public ?string $currency = null;

	public function set_value( int $value ): self {
		$this->value = $value;

		return $this;
	}

	public function set_currency( string $currency ): self {
		$this->currency = $currency;

		return $this;
	}

	/**
	 * @throws WC_Vipps_Recurring_Missing_Value_Exception
	 */
	public function to_array( bool $check_required = false ): array {
		if ( $check_required ) {
			$this->check_required();
		}

		return [
			"value"    => $this->value,
			"currency" => $this->currency,
		];
	}
}

```
