GatewayApplicationInterface.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. namespace Yansongda\Pay\Contracts;
  3. use Symfony\Component\HttpFoundation\Response;
  4. use Yansongda\Supports\Collection;
  5. interface GatewayApplicationInterface
  6. {
  7. /**
  8. * To pay.
  9. *
  10. * @author yansongda <me@yansonga.cn>
  11. *
  12. * @param string $gateway
  13. * @param array $params
  14. *
  15. * @return Collection|Response
  16. */
  17. public function pay($gateway, $params);
  18. /**
  19. * Query an order.
  20. *
  21. * @author yansongda <me@yansongda.cn>
  22. *
  23. * @param string|array $order
  24. *
  25. * @return Collection
  26. */
  27. public function find($order, string $type);
  28. /**
  29. * Refund an order.
  30. *
  31. * @author yansongda <me@yansongda.cn>
  32. *
  33. * @return Collection
  34. */
  35. public function refund(array $order);
  36. /**
  37. * Cancel an order.
  38. *
  39. * @author yansongda <me@yansongda.cn>
  40. *
  41. * @param string|array $order
  42. *
  43. * @return Collection
  44. */
  45. public function cancel($order);
  46. /**
  47. * Close an order.
  48. *
  49. * @author yansongda <me@yansongda.cn>
  50. *
  51. * @param string|array $order
  52. *
  53. * @return Collection
  54. */
  55. public function close($order);
  56. /**
  57. * Verify a request.
  58. *
  59. * @author yansongda <me@yansongda.cn>
  60. *
  61. * @param string|array|null $content
  62. *
  63. * @return Collection
  64. */
  65. public function verify($content, bool $refund);
  66. /**
  67. * Echo success to server.
  68. *
  69. * @author yansongda <me@yansongda.cn>
  70. *
  71. * @return Response
  72. */
  73. public function success();
  74. }