Order_Endpoint::fail_order_args()
Arguments used for the deleting order for PayPal.
Return
(array)
Source
File: src/Tickets/Commerce/Gateways/PayPal/REST/Order_Endpoint.php
public function fail_order_args() {
return [
'order_id' => [
'description' => __( 'Order ID in PayPal', 'event-tickets' ),
'required' => true,
'type' => 'string',
'validate_callback' => static function ( $value ) {
if ( ! is_string( $value ) ) {
return new WP_Error( 'rest_invalid_param', 'The order ID argument must be a string.', [ 'status' => 400 ] );
}
return $value;
},
'sanitize_callback' => [ $this, 'sanitize_callback' ],
],
'failed_status' => [
'description' => __( 'To which status the failing should change this order to', 'event-tickets' ),
'required' => false,
'type' => 'string',
'validate_callback' => static function ( $value ) {
if ( ! is_string( $value ) ) {
return new WP_Error( 'rest_invalid_param', 'The failed status argument must be a string.', [ 'status' => 400 ] );
}
return $value;
},
'sanitize_callback' => [ $this, 'sanitize_callback' ],
],
'failed_reason' => [
'description' => __( 'Why this particular order has failed.', 'event-tickets' ),
'required' => false,
'type' => 'string',
'validate_callback' => static function ( $value ) {
if ( ! is_string( $value ) ) {
return new WP_Error( 'rest_invalid_param', 'The failed reason argument must be a string.', [ 'status' => 400 ] );
}
return $value;
},
'sanitize_callback' => [ $this, 'sanitize_callback' ],
],
];
}
Changelog
| Version | Description |
|---|---|
| 5.2.0 | Introduced. |