PaymentTokenInterface.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Vault\Api\Data;
  7. /**
  8. * Gateway vault payment token interface.
  9. *
  10. * @api
  11. * @since 100.1.0
  12. */
  13. interface PaymentTokenInterface
  14. {
  15. /**#@+
  16. * Constants for keys of data array. Identical to the name of the getter in snake case.
  17. */
  18. /*
  19. * Entity ID.
  20. */
  21. const ENTITY_ID = 'entity_id';
  22. /*
  23. * Customer ID.
  24. */
  25. const CUSTOMER_ID = 'customer_id';
  26. /*
  27. * Unique hash for frontend.
  28. */
  29. const PUBLIC_HASH = 'public_hash';
  30. /*
  31. * Payment method code.
  32. */
  33. const PAYMENT_METHOD_CODE = 'payment_method_code';
  34. /*
  35. * Token type.
  36. */
  37. const TYPE = 'type';
  38. /*
  39. * Token creation timestamp.
  40. */
  41. const CREATED_AT = 'created_at';
  42. /*
  43. * Token expiration timestamp.
  44. */
  45. const EXPIRES_AT = 'expires_at';
  46. /*
  47. * Gateway token ID.
  48. */
  49. const GATEWAY_TOKEN = 'gateway_token';
  50. /*
  51. * Additional details.
  52. */
  53. const DETAILS = 'details';
  54. /*
  55. * Is vault payment record active.
  56. */
  57. const IS_ACTIVE = 'is_active';
  58. /*
  59. * Is vault payment token visible.
  60. */
  61. const IS_VISIBLE = 'is_visible';
  62. /**
  63. * Gets the entity ID.
  64. *
  65. * @return int|null Entity ID.
  66. * @since 100.1.0
  67. */
  68. public function getEntityId();
  69. /**
  70. * Sets entity ID.
  71. *
  72. * @param int $entityId
  73. * @return $this
  74. * @since 100.1.0
  75. */
  76. public function setEntityId($entityId);
  77. /**
  78. * Gets the customer ID.
  79. *
  80. * @return int|null Customer ID.
  81. * @since 100.1.0
  82. */
  83. public function getCustomerId();
  84. /**
  85. * Sets customer ID.
  86. *
  87. * @param int $customerId
  88. * @return $this
  89. * @since 100.1.0
  90. */
  91. public function setCustomerId($customerId);
  92. /**
  93. * Get public hash
  94. *
  95. * @return string
  96. * @since 100.1.0
  97. */
  98. public function getPublicHash();
  99. /**
  100. * Set public hash
  101. *
  102. * @param string $hash
  103. * @return $this
  104. * @since 100.1.0
  105. */
  106. public function setPublicHash($hash);
  107. /**
  108. * Get payment method code
  109. *
  110. * @return string
  111. * @since 100.1.0
  112. */
  113. public function getPaymentMethodCode();
  114. /**
  115. * Set payment method code
  116. *
  117. * @param string $code
  118. * @return $this
  119. * @since 100.1.0
  120. */
  121. public function setPaymentMethodCode($code);
  122. /**
  123. * Get type
  124. *
  125. * @return string
  126. * @since 100.1.0
  127. */
  128. public function getType();
  129. /**
  130. * Set type
  131. *
  132. * @param string $type
  133. * @return $this
  134. * @since 100.1.0
  135. */
  136. public function setType($type);
  137. /**
  138. * Get token creation timestamp
  139. *
  140. * @return string|null
  141. * @since 100.1.0
  142. */
  143. public function getCreatedAt();
  144. /**
  145. * Set token creation timestamp
  146. *
  147. * @param string $timestamp
  148. * @return $this
  149. * @since 100.1.0
  150. */
  151. public function setCreatedAt($timestamp);
  152. /**
  153. * Get token expiration timestamp
  154. *
  155. * @return string|null
  156. * @since 100.1.0
  157. */
  158. public function getExpiresAt();
  159. /**
  160. * Set token expiration timestamp
  161. *
  162. * @param string $timestamp
  163. * @return $this
  164. * @since 100.1.0
  165. */
  166. public function setExpiresAt($timestamp);
  167. /**
  168. * Get gateway token ID
  169. *
  170. * @return string
  171. * @since 100.1.0
  172. */
  173. public function getGatewayToken();
  174. /**
  175. * Set gateway token ID
  176. *
  177. * @param string $token
  178. * @return $this
  179. * @since 100.1.0
  180. */
  181. public function setGatewayToken($token);
  182. /**
  183. * Get token details
  184. *
  185. * @return string
  186. * @since 100.1.0
  187. */
  188. public function getTokenDetails();
  189. /**
  190. * Set token details
  191. *
  192. * @param string $details
  193. * @return $this
  194. * @since 100.1.0
  195. */
  196. public function setTokenDetails($details);
  197. /**
  198. * Gets is vault payment record active.
  199. *
  200. * @return bool Is active.
  201. * @SuppressWarnings(PHPMD.BooleanGetMethodName)
  202. * @since 100.1.0
  203. */
  204. public function getIsActive();
  205. /**
  206. * Sets is vault payment record active.
  207. *
  208. * @param bool $isActive
  209. * @return $this
  210. * @since 100.1.0
  211. */
  212. public function setIsActive($isActive);
  213. /**
  214. * Gets is vault payment record visible.
  215. *
  216. * @return bool Is visible.
  217. * @SuppressWarnings(PHPMD.BooleanGetMethodName)
  218. * @since 100.1.0
  219. */
  220. public function getIsVisible();
  221. /**
  222. * Sets is vault payment record visible.
  223. *
  224. * @param bool $isVisible
  225. * @return $this
  226. * @since 100.1.0
  227. */
  228. public function setIsVisible($isVisible);
  229. }