Skip to content

Commit

Permalink
#9 add dispute
Browse files Browse the repository at this point in the history
  • Loading branch information
xxl4 committed Aug 15, 2024
1 parent 4836afa commit f36c7e6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Config/Apis.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@
*
*/
'enable_output_log' => env("APIS_ENABLE_OUTPUT_LOG", false), // Enable output log for all requests

'description' => 'Apis package is a package that contains all the apis for the application',

];
15 changes: 15 additions & 0 deletions src/Http/Controllers/Api/V1/Admin/Sales/OrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,21 @@ public function findByEmail(Request $request)
return $this->resource()::collection($results);
}

/**
* Get Order disputes
*
* @return \Illuminate\Http\Response
*/
public function disputes(Request $request, int $id) {
$order = $this->getRepositoryInstance()->findOrFail($id);

return response([
'data' => $order->disputes,
]);
}



/**
* Cancel action for the specified resource.
*
Expand Down
3 changes: 3 additions & 0 deletions src/Routes/V1/Admin/sales-routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

Route::get('{id}', 'getResource');

// Order dispute routes.
Route::get('{id}/dispute', 'dispute');

Route::post('{id}/cancel', 'cancel');

Route::post('{id}/comments', 'comment');
Expand Down

0 comments on commit f36c7e6

Please sign in to comment.