??????????????
??????????????
??????????????
??????????????
Warning : Undefined variable $auth in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
Warning : Trying to access array offset on value of type null in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
??????????????
??????????????
??????????????
??????????????
File Manager
✏️ Edit File: /home/mklsvubc/renovaid.co.uk/wp-content/plugins/latepoint/lib/abilities/orders/create-order.php
⬅ Kembali
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class LatePointAbilityCreateOrder extends LatePointAbstractOrderAbility {
protected function configure(): void {
$this->id = 'latepoint/create-order';
$this->label = __( 'Create order', 'latepoint' );
$this->description = __( 'Creates a new order record. Orders group one or more bookings together for billing purposes.', 'latepoint' );
$this->permission = 'booking__create';
$this->read_only = false;
$this->destructive = false;
$this->idempotent = false;
}
public function get_input_schema(): array {
return [
'type' => 'object',
'properties' => [
'customer_id' => [
'type' => 'integer',
'description' => __( 'Customer ID.', 'latepoint' ),
],
'status' => [
'type' => 'string',
'enum' => [ 'open', 'cancelled', 'completed' ],
'default' => 'open',
],
'payment_status' => [ 'type' => 'string' ],
'notes' => [ 'type' => 'string' ],
],
'required' => [ 'customer_id' ],
];
}
public function get_output_schema(): array {
return $this->order_output_schema();
}
public function execute( array $args ) {
$order = new OsOrderModel();
$order->customer_id = (int) $args['customer_id'];
$order->status = isset( $args['status'] ) ? sanitize_text_field( $args['status'] ) : LATEPOINT_ORDER_STATUS_OPEN;
if ( ! empty( $args['payment_status'] ) ) {
$order->payment_status = sanitize_text_field( $args['payment_status'] );
}
if ( ! empty( $args['notes'] ) ) {
$order->customer_comment = sanitize_textarea_field( $args['notes'] );
}
if ( ! $order->save() ) {
return new WP_Error(
'save_failed',
__( 'Failed to create order.', 'latepoint' ),
WP_DEBUG ? [ 'errors' => $order->get_error_messages() ] : [ 'status' => 422 ]
);
}
return $this->serialize_order( new OsOrderModel( $order->id ) );
}
}
Nama
Tipe
Ukuran
Diubah
Aksi
🐘 abstract-order-ability.php
php
3.6 KB
2026-03-10 11:15
🐘 change-invoice-status.php
php
1.6 KB
2026-03-10 11:15
🐘 change-order-status.php
php
1.5 KB
2026-03-10 11:15
🐘 create-invoice.php
php
2 KB
2026-03-10 11:15
🐘 create-order.php
php
1.9 KB
2026-03-10 11:15
🐘 delete-order.php
php
1.4 KB
2026-03-10 11:15
🐘 get-invoice.php
php
1 KB
2026-03-10 11:15
🐘 get-order-price-breakdown.php
php
1.6 KB
2026-03-10 11:15
🐘 get-order.php
php
1 KB
2026-03-10 11:15
🐘 get-transaction.php
php
1.1 KB
2026-03-10 11:15
🐘 list-invoices.php
php
2.4 KB
2026-03-10 11:15
🐘 list-orders.php
php
2.5 KB
2026-03-10 11:15
🐘 list-transactions.php
php
1.9 KB
2026-03-10 11:15
🐘 refund-transaction.php
php
1.5 KB
2026-03-10 11:15
🐘 update-order.php
php
1.9 KB
2026-03-10 11:15