| @@ 691-693 (lines=3) @@ | ||
| 688 | $schema = $this->get_item_schema(); |
|
| 689 | ||
| 690 | // item title. |
|
| 691 | if ( ! empty( $schema['properties']['name'] ) && isset( $request['name'] ) ) { |
|
| 692 | $prepared_item->title = sanitize_text_field( $request['name'] ); |
|
| 693 | } |
|
| 694 | ||
| 695 | // item summary. |
|
| 696 | if ( ! empty( $schema['properties']['summary'] ) && isset( $request['summary'] ) ) { |
|
| @@ 701-703 (lines=3) @@ | ||
| 698 | } |
|
| 699 | ||
| 700 | // item price. |
|
| 701 | if ( ! empty( $schema['properties']['price'] ) && isset( $request['price'] ) ) { |
|
| 702 | $prepared_item->price = floatval( $request['price'] ); |
|
| 703 | } |
|
| 704 | ||
| 705 | // minimum price (for dynamc items). |
|
| 706 | if ( ! empty( $schema['properties']['minimum_price'] ) && isset( $request['minimum_price'] ) ) { |
|
| @@ 706-708 (lines=3) @@ | ||
| 703 | } |
|
| 704 | ||
| 705 | // minimum price (for dynamc items). |
|
| 706 | if ( ! empty( $schema['properties']['minimum_price'] ) && isset( $request['minimum_price'] ) ) { |
|
| 707 | $prepared_item->minimum_price = floatval( $request['minimum_price'] ); |
|
| 708 | } |
|
| 709 | ||
| 710 | // item status. |
|
| 711 | if ( ! empty( $schema['properties']['status'] ) && isset( $request['status'] ) ) { |
|
| @@ 689-691 (lines=3) @@ | ||
| 686 | // Payment details |
|
| 687 | $prepared_invoice->payment_details = array(); |
|
| 688 | ||
| 689 | if ( ! empty( $schema['properties']['gateway'] ) && isset( $request['gateway'] ) ) { |
|
| 690 | $prepared_invoice->payment_details['gateway'] = $request['gateway']; |
|
| 691 | } |
|
| 692 | ||
| 693 | if ( ! empty( $schema['properties']['gateway_title'] ) && isset( $request['gateway_title'] ) ) { |
|
| 694 | $prepared_invoice->payment_details['gateway_title'] = $request['gateway_title']; |
|
| @@ 693-695 (lines=3) @@ | ||
| 690 | $prepared_invoice->payment_details['gateway'] = $request['gateway']; |
|
| 691 | } |
|
| 692 | ||
| 693 | if ( ! empty( $schema['properties']['gateway_title'] ) && isset( $request['gateway_title'] ) ) { |
|
| 694 | $prepared_invoice->payment_details['gateway_title'] = $request['gateway_title']; |
|
| 695 | } |
|
| 696 | ||
| 697 | if ( ! empty( $schema['properties']['currency'] ) && isset( $request['currency'] ) ) { |
|
| 698 | $prepared_invoice->payment_details['currency'] = $request['currency']; |
|
| @@ 697-699 (lines=3) @@ | ||
| 694 | $prepared_invoice->payment_details['gateway_title'] = $request['gateway_title']; |
|
| 695 | } |
|
| 696 | ||
| 697 | if ( ! empty( $schema['properties']['currency'] ) && isset( $request['currency'] ) ) { |
|
| 698 | $prepared_invoice->payment_details['currency'] = $request['currency']; |
|
| 699 | } |
|
| 700 | ||
| 701 | if ( ! empty( $schema['properties']['transaction_id'] ) && isset( $request['transaction_id'] ) ) { |
|
| 702 | $prepared_invoice->payment_details['transaction_id'] = $request['transaction_id']; |
|
| @@ 701-703 (lines=3) @@ | ||
| 698 | $prepared_invoice->payment_details['currency'] = $request['currency']; |
|
| 699 | } |
|
| 700 | ||
| 701 | if ( ! empty( $schema['properties']['transaction_id'] ) && isset( $request['transaction_id'] ) ) { |
|
| 702 | $prepared_invoice->payment_details['transaction_id'] = $request['transaction_id']; |
|
| 703 | } |
|
| 704 | ||
| 705 | // Dates |
|
| 706 | if ( ! empty( $schema['properties']['date'] ) && isset( $request['date'] ) ) { |
|