TransactionService.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service\TestHelpers\Issuing;
  4. /**
  5. * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
  6. * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
  7. */
  8. class TransactionService extends \Stripe\Service\AbstractService
  9. {
  10. /**
  11. * Allows the user to capture an arbitrary amount, also known as a forced capture.
  12. *
  13. * @param null|array $params
  14. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  15. *
  16. * @throws \Stripe\Exception\ApiErrorException if the request fails
  17. *
  18. * @return \Stripe\Issuing\Transaction
  19. */
  20. public function createForceCapture($params = null, $opts = null)
  21. {
  22. return $this->request('post', '/v1/test_helpers/issuing/transactions/create_force_capture', $params, $opts);
  23. }
  24. /**
  25. * Allows the user to refund an arbitrary amount, also known as a unlinked refund.
  26. *
  27. * @param null|array $params
  28. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  29. *
  30. * @throws \Stripe\Exception\ApiErrorException if the request fails
  31. *
  32. * @return \Stripe\Issuing\Transaction
  33. */
  34. public function createUnlinkedRefund($params = null, $opts = null)
  35. {
  36. return $this->request('post', '/v1/test_helpers/issuing/transactions/create_unlinked_refund', $params, $opts);
  37. }
  38. /**
  39. * Refund a test-mode Transaction.
  40. *
  41. * @param string $id
  42. * @param null|array $params
  43. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  44. *
  45. * @throws \Stripe\Exception\ApiErrorException if the request fails
  46. *
  47. * @return \Stripe\Issuing\Transaction
  48. */
  49. public function refund($id, $params = null, $opts = null)
  50. {
  51. return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/transactions/%s/refund', $id), $params, $opts);
  52. }
  53. }