Refund.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <?php
  2. namespace HitPay\Response;
  3. /**
  4. * Class Refund
  5. * @package HitPay\Response
  6. */
  7. class Refund
  8. {
  9. /**
  10. * @var string
  11. */
  12. public $id;
  13. /**
  14. * @var string
  15. */
  16. public $payment_id;
  17. /**
  18. * @var float
  19. */
  20. public $amount_refunded;
  21. /**
  22. * @var float
  23. */
  24. public $total_amount;
  25. /**
  26. * @var string
  27. */
  28. public $currency;
  29. /**
  30. * @var string
  31. */
  32. public $status;
  33. /**
  34. * @var string
  35. */
  36. public $payment_method;
  37. /**
  38. * @var string
  39. */
  40. public $created_at;
  41. /**
  42. * Refund constructor.
  43. * @param \stdClass $result
  44. */
  45. public function __construct(\stdClass $result)
  46. {
  47. $this->setId($result->id);
  48. $this->setPaymentId($result->payment_id);
  49. $this->setAmountRefunded($result->amount_refunded);
  50. $this->setTotalAmount($result->total_amount);
  51. $this->setCurrency($result->currency);
  52. $this->setStatus($result->status);
  53. $this->setPaymentMethod($result->payment_method);
  54. $this->setCreatedAt($result->created_at);
  55. }
  56. /**
  57. * @return string
  58. */
  59. public function getId()
  60. {
  61. return $this->id;
  62. }
  63. /**
  64. * @return string
  65. */
  66. public function getPaymentId()
  67. {
  68. return $this->payment_id;
  69. }
  70. /**
  71. * @return float
  72. */
  73. public function getAmountRefunded()
  74. {
  75. return $this->amount_refunded;
  76. }
  77. /**
  78. * @return float
  79. */
  80. public function getTotalAmount()
  81. {
  82. return $this->total_amount;
  83. }
  84. /**
  85. * @return string
  86. */
  87. public function getCurrency()
  88. {
  89. return $this->currency;
  90. }
  91. /**
  92. * @return string
  93. */
  94. public function getStatus()
  95. {
  96. return $this->status;
  97. }
  98. /**
  99. * @return string
  100. */
  101. public function getPaymentMethod()
  102. {
  103. return $this->payment_method;
  104. }
  105. /**
  106. * @return string
  107. */
  108. public function getCreatedAt()
  109. {
  110. return $this->created_at;
  111. }
  112. /**
  113. * @param string $id
  114. * @return Refund
  115. */
  116. public function setId($id)
  117. {
  118. $this->id = $id;
  119. return $this;
  120. }
  121. /**
  122. * @param string $name
  123. * @return Refund
  124. */
  125. public function setPaymentId($payment_id)
  126. {
  127. $this->payment_id = $payment_id;
  128. return $this;
  129. }
  130. /**
  131. * @param string $amount_refunded
  132. * @return Refund
  133. */
  134. public function setAmountRefunded($amount_refunded)
  135. {
  136. $this->amount_refunded = $amount_refunded;
  137. return $this;
  138. }
  139. /**
  140. * @param float $total_amount
  141. * @return Refund
  142. */
  143. public function setTotalAmount($total_amount)
  144. {
  145. $this->total_amount = $total_amount;
  146. return $this;
  147. }
  148. /**
  149. * @param string $currency
  150. * @return Refund
  151. */
  152. public function setCurrency($currency)
  153. {
  154. $this->currency = $currency;
  155. return $this;
  156. }
  157. /**
  158. * @param string $status
  159. * @return Refund
  160. */
  161. public function setStatus($status)
  162. {
  163. $this->status = $status;
  164. return $this;
  165. }
  166. /**
  167. * @param array $payment_methods
  168. * @return Refund
  169. */
  170. public function setPaymentMethod($payment_method)
  171. {
  172. $this->payment_method = $payment_method;
  173. return $this;
  174. }
  175. /**
  176. * @param string $created_at
  177. * @return Refund
  178. */
  179. public function setCreatedAt($created_at)
  180. {
  181. $this->created_at = $created_at;
  182. return $this;
  183. }
  184. }