RefundService.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. declare(strict_types=1);
  3. namespace SixShop\Wangdian\Services;
  4. use SixShop\Wangdian\Response\ApiResponse;
  5. /**
  6. * Refund service for refund processing, etc.
  7. */
  8. class RefundService extends BaseService
  9. {
  10. /**
  11. * Query refund information
  12. */
  13. public function query(array $params = []): ApiResponse
  14. {
  15. return $this->call('refund_query.php', $this->filterParams($params));
  16. }
  17. /**
  18. * Push sales refund
  19. */
  20. public function pushSalesRefund(array $refundData): ApiResponse
  21. {
  22. $this->validateRequired($refundData, ['refund_list']);
  23. return $this->call('sales_refund_push.php', [
  24. 'refund_list' => $this->encodeIfArray($refundData['refund_list']),
  25. ]);
  26. }
  27. /**
  28. * Push stockin refund
  29. */
  30. public function pushStockinRefund(array $refundData): ApiResponse
  31. {
  32. return $this->call(
  33. 'stockin_refund_push.php',
  34. $this->filterParams($refundData)
  35. );
  36. }
  37. /**
  38. * Query stockin refund
  39. */
  40. public function queryStockinRefund(array $params = []): ApiResponse
  41. {
  42. return $this->call('stockin_refund_query.php', $this->filterParams($params));
  43. }
  44. }