| 1 |
<?php |
| 2 |
|
| 3 |
defined( 'ABSPATH' ) || exit; |
| 4 |
|
| 5 |
class WC_Vipps_Checkout_Session_Transaction_Order_Summary extends WC_Vipps_Model { |
| 6 |
protected array $required_fields = [ |
| 7 |
"order_lines", |
| 8 |
"order_bottom_line" |
| 9 |
]; |
| 10 |
|
| 11 |
public ?array $order_lines = null; |
| 12 |
public ?WC_Vipps_Checkout_Session_Transaction_Order_Summary_Bottom_Line $order_bottom_line = null; |
| 13 |
|
| 14 |
public function set_order_lines( array $order_lines ): self { |
| 15 |
$this->order_lines = $order_lines; |
| 16 |
|
| 17 |
return $this; |
| 18 |
} |
| 19 |
|
| 20 |
public function set_order_bottom_line( $order_bottom_line ): self { |
| 21 |
return $this->_set_value( "order_bottom_line", $order_bottom_line, WC_Vipps_Checkout_Session_Transaction_Order_Summary_Bottom_Line::class ); |
| 22 |
} |
| 23 |
|
| 24 |
/** |
| 25 |
* @throws WC_Vipps_Recurring_Missing_Value_Exception |
| 26 |
*/ |
| 27 |
public function to_array( bool $check_required = false ): array { |
| 28 |
if ( $check_required ) { |
| 29 |
$this->check_required(); |
| 30 |
} |
| 31 |
|
| 32 |
return [ |
| 33 |
"orderLines" => $this->order_lines, |
| 34 |
"orderBottomLine" => $this->order_bottom_line, |
| 35 |
]; |
| 36 |
} |
| 37 |
} |
| 38 |
|