globalpayments-api 3.8.2 → 3.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/LICENSE.md +257 -257
  3. package/README.md +141 -141
  4. package/lib/src/Builders/AuthorizationBuilder.d.ts +23 -1
  5. package/lib/src/Builders/AuthorizationBuilder.js +94 -0
  6. package/lib/src/Builders/AuthorizationBuilder.js.map +1 -1
  7. package/lib/src/Builders/ManagementBuilder.d.ts +18 -1
  8. package/lib/src/Builders/ManagementBuilder.js +23 -0
  9. package/lib/src/Builders/ManagementBuilder.js.map +1 -1
  10. package/lib/src/Builders/RequestBuilder/GpApi/GpApiAuthorizationRequestBuilder.d.ts +3 -0
  11. package/lib/src/Builders/RequestBuilder/GpApi/GpApiAuthorizationRequestBuilder.js +163 -24
  12. package/lib/src/Builders/RequestBuilder/GpApi/GpApiAuthorizationRequestBuilder.js.map +1 -1
  13. package/lib/src/Builders/RequestBuilder/GpApi/GpApiManagementRequestBuilder.d.ts +4 -1
  14. package/lib/src/Builders/RequestBuilder/GpApi/GpApiManagementRequestBuilder.js +38 -2
  15. package/lib/src/Builders/RequestBuilder/GpApi/GpApiManagementRequestBuilder.js.map +1 -1
  16. package/lib/src/Builders/RequestBuilder/GpEcom/GpEcomRequestBuilder.js.map +1 -1
  17. package/lib/src/Builders/TransactionBuilder.d.ts +2 -3
  18. package/lib/src/Builders/TransactionBuilder.js +0 -6
  19. package/lib/src/Builders/TransactionBuilder.js.map +1 -1
  20. package/lib/src/Entities/AlternativePaymentResponse.d.ts +66 -0
  21. package/lib/src/Entities/AlternativePaymentResponse.js +72 -0
  22. package/lib/src/Entities/AlternativePaymentResponse.js.map +1 -0
  23. package/lib/src/Entities/Customer.d.ts +3 -3
  24. package/lib/src/Entities/Customer.js.map +1 -1
  25. package/lib/src/Entities/DccRateData.d.ts +61 -0
  26. package/lib/src/Entities/DccRateData.js +64 -0
  27. package/lib/src/Entities/DccRateData.js.map +1 -0
  28. package/lib/src/Entities/Enums/DccProcessor.d.ts +4 -0
  29. package/lib/src/Entities/Enums/DccProcessor.js +9 -0
  30. package/lib/src/Entities/Enums/DccProcessor.js.map +1 -0
  31. package/lib/src/Entities/Enums/DccRateType.d.ts +4 -0
  32. package/lib/src/Entities/Enums/DccRateType.js +9 -0
  33. package/lib/src/Entities/Enums/DccRateType.js.map +1 -0
  34. package/lib/src/Entities/Enums/MerchantCategory.d.ts +9 -0
  35. package/lib/src/Entities/Enums/MerchantCategory.js +14 -0
  36. package/lib/src/Entities/Enums/MerchantCategory.js.map +1 -0
  37. package/lib/src/Entities/Enums.d.ts +138 -1
  38. package/lib/src/Entities/Enums.js +138 -1
  39. package/lib/src/Entities/Enums.js.map +1 -1
  40. package/lib/src/Entities/OrderDetails.d.ts +6 -0
  41. package/lib/src/Entities/OrderDetails.js +11 -0
  42. package/lib/src/Entities/OrderDetails.js.map +1 -0
  43. package/lib/src/Entities/Transaction.d.ts +5 -1
  44. package/lib/src/Entities/Transaction.js +18 -0
  45. package/lib/src/Entities/Transaction.js.map +1 -1
  46. package/lib/src/Entities/TransactionSummary.d.ts +2 -1
  47. package/lib/src/Entities/TransactionSummary.js +1 -0
  48. package/lib/src/Entities/TransactionSummary.js.map +1 -1
  49. package/lib/src/Entities/index.d.ts +6 -0
  50. package/lib/src/Entities/index.js +6 -0
  51. package/lib/src/Entities/index.js.map +1 -1
  52. package/lib/src/Gateways/GpApiConnector.js +12 -2
  53. package/lib/src/Gateways/GpApiConnector.js.map +1 -1
  54. package/lib/src/Gateways/GpEcomConnector.js.map +1 -1
  55. package/lib/src/Mapping/GpApiMapping.d.ts +3 -1
  56. package/lib/src/Mapping/GpApiMapping.js +111 -3
  57. package/lib/src/Mapping/GpApiMapping.js.map +1 -1
  58. package/lib/src/PaymentMethods/Credit.d.ts +2 -1
  59. package/lib/src/PaymentMethods/Credit.js +12 -0
  60. package/lib/src/PaymentMethods/Credit.js.map +1 -1
  61. package/lib/src/PaymentMethods/ECheck.d.ts +10 -1
  62. package/lib/src/PaymentMethods/ECheck.js +11 -0
  63. package/lib/src/PaymentMethods/ECheck.js.map +1 -1
  64. package/lib/src/PaymentMethods/TransactionReference.d.ts +3 -2
  65. package/lib/src/PaymentMethods/TransactionReference.js +1 -1
  66. package/lib/src/PaymentMethods/TransactionReference.js.map +1 -1
  67. package/lib/src/Utils/CardUtils.js +4 -5
  68. package/lib/src/Utils/CardUtils.js.map +1 -1
  69. package/lib/src/Utils/StringUtils.js +3 -0
  70. package/lib/src/Utils/StringUtils.js.map +1 -1
  71. package/lib/test/Data/BaseGpApiTestConfig.js +2 -0
  72. package/lib/test/Data/BaseGpApiTestConfig.js.map +1 -1
  73. package/lib/test/Data/TestCards.js +1 -0
  74. package/lib/test/Data/TestCards.js.map +1 -1
  75. package/lib/test/Integration/Gateways/GpApiConnector/3DS2Test.d.ts +1 -0
  76. package/lib/test/Integration/Gateways/GpApiConnector/3DS2Test.js +1029 -0
  77. package/lib/test/Integration/Gateways/GpApiConnector/3DS2Test.js.map +1 -0
  78. package/lib/test/Integration/Gateways/GpApiConnector/3DSecureTest.d.ts +1 -0
  79. package/lib/test/Integration/Gateways/GpApiConnector/3DSecureTest.js +649 -0
  80. package/lib/test/Integration/Gateways/GpApiConnector/3DSecureTest.js.map +1 -0
  81. package/lib/test/Integration/Gateways/GpApiConnector/AccessTokenTest.d.ts +1 -0
  82. package/lib/test/Integration/Gateways/GpApiConnector/AccessTokenTest.js +109 -0
  83. package/lib/test/Integration/Gateways/GpApiConnector/AccessTokenTest.js.map +1 -0
  84. package/lib/test/Integration/Gateways/GpApiConnector/Ach.test.d.ts +1 -0
  85. package/lib/test/Integration/Gateways/GpApiConnector/Ach.test.js +120 -0
  86. package/lib/test/Integration/Gateways/GpApiConnector/Ach.test.js.map +1 -0
  87. package/lib/test/Integration/Gateways/GpApiConnector/Apm.test.d.ts +1 -0
  88. package/lib/test/Integration/Gateways/GpApiConnector/Apm.test.js +425 -0
  89. package/lib/test/Integration/Gateways/GpApiConnector/Apm.test.js.map +1 -0
  90. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.d.ts +1 -0
  91. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.js +1025 -0
  92. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.js.map +1 -0
  93. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardPresentTest.d.ts +1 -0
  94. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardPresentTest.js +439 -0
  95. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardPresentTest.js.map +1 -0
  96. package/lib/test/Integration/Gateways/GpApiConnector/DccCardNotPresent.test.d.ts +1 -0
  97. package/lib/test/Integration/Gateways/GpApiConnector/DccCardNotPresent.test.js +256 -0
  98. package/lib/test/Integration/Gateways/GpApiConnector/DccCardNotPresent.test.js.map +1 -0
  99. package/lib/test/Integration/Gateways/GpApiConnector/DebitCardTest.d.ts +1 -0
  100. package/lib/test/Integration/Gateways/GpApiConnector/DebitCardTest.js +143 -0
  101. package/lib/test/Integration/Gateways/GpApiConnector/DebitCardTest.js.map +1 -0
  102. package/lib/test/Integration/Gateways/GpApiConnector/EbtCard.test.d.ts +1 -0
  103. package/lib/test/Integration/Gateways/GpApiConnector/EbtCard.test.js +88 -0
  104. package/lib/test/Integration/Gateways/GpApiConnector/EbtCard.test.js.map +1 -0
  105. package/lib/test/Integration/Gateways/GpApiConnector/GpApiCertificationTest.d.ts +1 -0
  106. package/lib/test/Integration/Gateways/GpApiConnector/GpApiCertificationTest.js +639 -0
  107. package/lib/test/Integration/Gateways/GpApiConnector/GpApiCertificationTest.js.map +1 -0
  108. package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagementTest.d.ts +1 -0
  109. package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagementTest.js +149 -0
  110. package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagementTest.js.map +1 -0
  111. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDepositsTest.d.ts +1 -0
  112. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDepositsTest.js +226 -0
  113. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDepositsTest.js.map +1 -0
  114. package/lib/test/Integration/Gateways/GpApiConnector/ReportingSettlementTransactionsTest.d.ts +1 -0
  115. package/lib/test/Integration/Gateways/GpApiConnector/ReportingSettlementTransactionsTest.js +434 -0
  116. package/lib/test/Integration/Gateways/GpApiConnector/ReportingSettlementTransactionsTest.js.map +1 -0
  117. package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethodsTest.d.ts +1 -0
  118. package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethodsTest.js +217 -0
  119. package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethodsTest.js.map +1 -0
  120. package/lib/test/Integration/Gateways/GpApiConnector/ReportingTransactionsTest.d.ts +1 -0
  121. package/lib/test/Integration/Gateways/GpApiConnector/ReportingTransactionsTest.js +338 -0
  122. package/lib/test/Integration/Gateways/GpApiConnector/ReportingTransactionsTest.js.map +1 -0
  123. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AuthTest.d.ts +1 -0
  124. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AuthTest.js +2446 -0
  125. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AuthTest.js.map +1 -0
  126. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AvsTest.d.ts +1 -0
  127. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AvsTest.js +506 -0
  128. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AvsTest.js.map +1 -0
  129. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/CreditTest.d.ts +1 -0
  130. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/CreditTest.js +1296 -0
  131. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/CreditTest.js.map +1 -0
  132. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/HoldTest.d.ts +1 -0
  133. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/HoldTest.js +847 -0
  134. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/HoldTest.js.map +1 -0
  135. package/lib/test/Integration/Gateways/GpEcomConnector/CreditTest.d.ts +1 -0
  136. package/lib/test/Integration/Gateways/GpEcomConnector/CreditTest.js +215 -0
  137. package/lib/test/Integration/Gateways/GpEcomConnector/CreditTest.js.map +1 -0
  138. package/lib/test/Integration/Gateways/GpEcomConnector/HppTest.d.ts +1 -0
  139. package/lib/test/Integration/Gateways/GpEcomConnector/HppTest.js +99 -0
  140. package/lib/test/Integration/Gateways/GpEcomConnector/HppTest.js.map +1 -0
  141. package/lib/test/Integration/Gateways/GpEcomConnector/RecurringTest.d.ts +1 -0
  142. package/lib/test/Integration/Gateways/GpEcomConnector/RecurringTest.js +133 -0
  143. package/lib/test/Integration/Gateways/GpEcomConnector/RecurringTest.js.map +1 -0
  144. package/lib/test/Integration/Gateways/PorticoConnector/AchTest.d.ts +1 -0
  145. package/lib/test/Integration/Gateways/PorticoConnector/AchTest.js +59 -0
  146. package/lib/test/Integration/Gateways/PorticoConnector/AchTest.js.map +1 -0
  147. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.d.ts +1 -0
  148. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.js +378 -0
  149. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.js.map +1 -0
  150. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.d.ts +1 -0
  151. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.js +86 -0
  152. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.js.map +1 -0
  153. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.d.ts +1 -0
  154. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.js +1723 -0
  155. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.js.map +1 -0
  156. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.d.ts +1 -0
  157. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.js +86 -0
  158. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.js.map +1 -0
  159. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.d.ts +1 -0
  160. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.js +1760 -0
  161. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.js.map +1 -0
  162. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.d.ts +1 -0
  163. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.js +420 -0
  164. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.js.map +1 -0
  165. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.d.ts +1 -0
  166. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.js +2221 -0
  167. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.js.map +1 -0
  168. package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.d.ts +1 -0
  169. package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.js +392 -0
  170. package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.js.map +1 -0
  171. package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.d.ts +1 -0
  172. package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.js +88 -0
  173. package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.js.map +1 -0
  174. package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.d.ts +1 -0
  175. package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.js +72 -0
  176. package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.js.map +1 -0
  177. package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.d.ts +1 -0
  178. package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.js +143 -0
  179. package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.js.map +1 -0
  180. package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.d.ts +1 -0
  181. package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.js +147 -0
  182. package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.js.map +1 -0
  183. package/lib/test/Integration/Gateways/PorticoConnector/PorticoManagementTokenTest.d.ts +1 -0
  184. package/lib/test/Integration/Gateways/PorticoConnector/PorticoManagementTokenTest.js +48 -0
  185. package/lib/test/Integration/Gateways/PorticoConnector/PorticoManagementTokenTest.js.map +1 -0
  186. package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.d.ts +1 -0
  187. package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.js +101 -0
  188. package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.js.map +1 -0
  189. package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.d.ts +1 -0
  190. package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.js +50 -0
  191. package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.js.map +1 -0
  192. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTest.d.ts +1 -0
  193. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTest.js +44 -0
  194. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTest.js.map +1 -0
  195. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTest.d.ts +1 -0
  196. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTest.js +221 -0
  197. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTest.js.map +1 -0
  198. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTest.d.ts +1 -0
  199. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTest.js +60 -0
  200. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTest.js.map +1 -0
  201. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTest.d.ts +1 -0
  202. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTest.js +80 -0
  203. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTest.js.map +1 -0
  204. package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTest.d.ts +1 -0
  205. package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTest.js +44 -0
  206. package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTest.js.map +1 -0
  207. package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTest.d.ts +1 -0
  208. package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTest.js +330 -0
  209. package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTest.js.map +1 -0
  210. package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTest.d.ts +1 -0
  211. package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTest.js +60 -0
  212. package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTest.js.map +1 -0
  213. package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTest.d.ts +1 -0
  214. package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTest.js +80 -0
  215. package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTest.js.map +1 -0
  216. package/lib/test/Integration/Gateways/Terminals/UPA/UpaMicTest.d.ts +1 -0
  217. package/lib/test/Integration/Gateways/Terminals/UPA/UpaMicTest.js +149 -0
  218. package/lib/test/Integration/Gateways/Terminals/UPA/UpaMicTest.js.map +1 -0
  219. package/lib/test/Integration/Services/CheckServiceTest.d.ts +1 -0
  220. package/lib/test/Integration/Services/CheckServiceTest.js +45 -0
  221. package/lib/test/Integration/Services/CheckServiceTest.js.map +1 -0
  222. package/lib/test/Integration/Services/CreditServiceTest.d.ts +1 -0
  223. package/lib/test/Integration/Services/CreditServiceTest.js +174 -0
  224. package/lib/test/Integration/Services/CreditServiceTest.js.map +1 -0
  225. package/lib/test/Integration/Services/DebitServiceTest.d.ts +1 -0
  226. package/lib/test/Integration/Services/DebitServiceTest.js +81 -0
  227. package/lib/test/Integration/Services/DebitServiceTest.js.map +1 -0
  228. package/lib/test/Integration/Services/EBTServiceTest.d.ts +1 -0
  229. package/lib/test/Integration/Services/EBTServiceTest.js +64 -0
  230. package/lib/test/Integration/Services/EBTServiceTest.js.map +1 -0
  231. package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.d.ts +1 -0
  232. package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.js +111 -0
  233. package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.js.map +1 -0
  234. package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.d.ts +1 -0
  235. package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.js +62 -0
  236. package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.js.map +1 -0
  237. package/lib/test/Unit/Gateways/GpEcomConnector/CreditTest.d.ts +1 -0
  238. package/lib/test/Unit/Gateways/GpEcomConnector/CreditTest.js +34 -0
  239. package/lib/test/Unit/Gateways/GpEcomConnector/CreditTest.js.map +1 -0
  240. package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.d.ts +1 -0
  241. package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.js +125 -0
  242. package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.js.map +1 -0
  243. package/package.json +1 -1
@@ -0,0 +1,1296 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const ava_1 = __importDefault(require("ava"));
7
+ const src_1 = require("../../../../../src/");
8
+ const ServiceConfigs_1 = require("../../../../../src/ServiceConfigs");
9
+ const config = new ServiceConfigs_1.GpEcomConfig();
10
+ config.merchantId = "heartlandgpsandbox";
11
+ config.accountId = "api";
12
+ config.sharedSecret = "secret";
13
+ config.refundPassword = "refund";
14
+ config.rebatePassword = "rebate";
15
+ config.timeout = 5000;
16
+ config.channel = "ECOM";
17
+ ava_1.default.before(() => {
18
+ src_1.ServicesContainer.configureService(config);
19
+ });
20
+ const throttle = () => new Promise((resolve) => setTimeout(resolve, 1500));
21
+ ava_1.default.beforeEach(async () => {
22
+ await throttle();
23
+ });
24
+ (0, ava_1.default)("JAVA_Credit_Sample", async (t) => {
25
+ t.plan(2);
26
+ // create card
27
+ const card = new src_1.CreditCardData();
28
+ card.number = "4263970000005262";
29
+ card.expMonth = "12";
30
+ card.expYear = "2018";
31
+ card.cvn = "123";
32
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
33
+ card.cardHolderName = "Peter Watermelon";
34
+ // request
35
+ const response = await card
36
+ .refund(1)
37
+ .withCurrency("EUR")
38
+ .withDescription("JAVA-Credit")
39
+ .execute();
40
+ t.truthy(response);
41
+ t.is("00", response.responseCode);
42
+ });
43
+ (0, ava_1.default)("JAVA_Credit_006a", async (t) => {
44
+ t.plan(2);
45
+ // create card
46
+ const card = new src_1.CreditCardData();
47
+ card.number = "4263970000005262";
48
+ card.expMonth = "12";
49
+ card.expYear = "2018";
50
+ card.cvn = "123";
51
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
52
+ card.cardHolderName = "Peter Watermelon";
53
+ // request
54
+ const response = await card
55
+ .refund(1)
56
+ .withCurrency("EUR")
57
+ .withDescription("JAVA-Credit")
58
+ .execute();
59
+ t.truthy(response);
60
+ t.is("00", response.responseCode);
61
+ });
62
+ (0, ava_1.default)("JAVA_Credit_006b", async (t) => {
63
+ t.plan(2);
64
+ // create card
65
+ const card = new src_1.CreditCardData();
66
+ card.number = "4263970000005262";
67
+ card.expMonth = "12";
68
+ card.expYear = "2018";
69
+ card.cvn = "123";
70
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
71
+ card.cardHolderName = "Peter Watermelon";
72
+ // request
73
+ const response = await card
74
+ .refund(1)
75
+ .withCurrency("EUR")
76
+ .withDescription("JAVA-Credit")
77
+ .execute();
78
+ t.truthy(response);
79
+ t.is("00", response.responseCode);
80
+ });
81
+ (0, ava_1.default)("JAVA_Credit_006c", async (t) => {
82
+ t.plan(2);
83
+ // create card
84
+ const card = new src_1.CreditCardData();
85
+ card.number = "4263970000005262";
86
+ card.expMonth = "12";
87
+ card.expYear = "2018";
88
+ card.cvn = "123";
89
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
90
+ card.cardHolderName = "Peter Watermelon";
91
+ // request
92
+ const response = await card
93
+ .refund(1)
94
+ .withCurrency("EUR")
95
+ .withDescription("JAVA-Credit")
96
+ .execute();
97
+ t.truthy(response);
98
+ t.is("00", response.responseCode);
99
+ });
100
+ (0, ava_1.default)("JAVA_Credit_006d", async (t) => {
101
+ t.plan(2);
102
+ // create card
103
+ const card = new src_1.CreditCardData();
104
+ card.number = "4263970000005262";
105
+ card.expMonth = "12";
106
+ card.expYear = "2018";
107
+ card.cvn = "123";
108
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
109
+ card.cardHolderName = "Peter Watermelon";
110
+ // request
111
+ const response = await card
112
+ .refund(1)
113
+ .withCurrency("EUR")
114
+ .withDescription("JAVA-Credit")
115
+ .execute();
116
+ t.truthy(response);
117
+ t.is("00", response.responseCode);
118
+ });
119
+ (0, ava_1.default)("JAVA_Credit_006e", async (t) => {
120
+ t.plan(2);
121
+ // create card
122
+ const card = new src_1.CreditCardData();
123
+ card.number = "4263970000005262";
124
+ card.expMonth = "12";
125
+ card.expYear = "2018";
126
+ card.cvn = "123";
127
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
128
+ card.cardHolderName = "Peter Watermelon";
129
+ // request
130
+ const response = await card
131
+ .refund(1)
132
+ .withCurrency("EUR")
133
+ .withDescription("JAVA-Credit")
134
+ .execute();
135
+ t.truthy(response);
136
+ t.is("00", response.responseCode);
137
+ });
138
+ (0, ava_1.default)("JAVA_Credit_006f", async (t) => {
139
+ t.plan(2);
140
+ // create card
141
+ const card = new src_1.CreditCardData();
142
+ card.number = "4263970000005262";
143
+ card.expMonth = "12";
144
+ card.expYear = "2018";
145
+ card.cvn = "123";
146
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
147
+ card.cardHolderName = "Peter Watermelon";
148
+ // request
149
+ const response = await card
150
+ .refund(1)
151
+ .withCurrency("EUR")
152
+ .withDescription("JAVA-Credit")
153
+ .execute();
154
+ t.truthy(response);
155
+ t.is("00", response.responseCode);
156
+ });
157
+ (0, ava_1.default)("JAVA_Credit_006g", async (t) => {
158
+ t.plan(2);
159
+ // create card
160
+ const card = new src_1.CreditCardData();
161
+ card.number = "4263970000005262";
162
+ card.expMonth = "12";
163
+ card.expYear = "2018";
164
+ card.cvn = "123";
165
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
166
+ card.cardHolderName = "Peter Watermelon";
167
+ // request
168
+ const response = await card
169
+ .refund(1)
170
+ .withCurrency("EUR")
171
+ .withDescription("JAVA-Credit")
172
+ .execute();
173
+ t.truthy(response);
174
+ t.is("00", response.responseCode);
175
+ });
176
+ (0, ava_1.default)("JAVA_Credit_006h", async (t) => {
177
+ t.plan(2);
178
+ // create card
179
+ const card = new src_1.CreditCardData();
180
+ card.number = "4263970000005262";
181
+ card.expMonth = "12";
182
+ card.expYear = "2018";
183
+ card.cvn = "123";
184
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
185
+ card.cardHolderName = "Peter Watermelon";
186
+ // request
187
+ const response = await card
188
+ .refund(1)
189
+ .withCurrency("EUR")
190
+ .withDescription("JAVA-Credit")
191
+ .execute();
192
+ t.truthy(response);
193
+ t.is("00", response.responseCode);
194
+ });
195
+ (0, ava_1.default)("JAVA_Credit_007a", async (t) => {
196
+ t.plan(2);
197
+ // create card
198
+ const card = new src_1.CreditCardData();
199
+ card.number = "4263970000005262";
200
+ card.expMonth = "12";
201
+ card.expYear = "2018";
202
+ card.cvn = "123";
203
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
204
+ card.cardHolderName = "Peter Watermelon";
205
+ // request
206
+ const response = await card
207
+ .refund(1)
208
+ .withCurrency("EUR")
209
+ .withDescription("JAVA-Credit")
210
+ .execute();
211
+ t.truthy(response);
212
+ t.is("00", response.responseCode);
213
+ });
214
+ (0, ava_1.default)("JAVA_Credit_007b", async (t) => {
215
+ t.plan(2);
216
+ // create card
217
+ const card = new src_1.CreditCardData();
218
+ card.number = "4263970000005262";
219
+ card.expMonth = "12";
220
+ card.expYear = "2018";
221
+ card.cvn = "123";
222
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
223
+ card.cardHolderName = "Peter Watermelon";
224
+ // request
225
+ const response = await card
226
+ .refund(1)
227
+ .withCurrency("EUR")
228
+ .withDescription("JAVA-Credit")
229
+ .execute();
230
+ t.truthy(response);
231
+ t.is("00", response.responseCode);
232
+ });
233
+ (0, ava_1.default)("JAVA_Credit_007c", async (t) => {
234
+ t.plan(2);
235
+ // create card
236
+ const card = new src_1.CreditCardData();
237
+ card.number = "4263970000005262";
238
+ card.expMonth = "12";
239
+ card.expYear = "2018";
240
+ card.cvn = "123";
241
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
242
+ card.cardHolderName = "Peter Watermelon";
243
+ // request
244
+ const response = await card
245
+ .refund(1)
246
+ .withCurrency("EUR")
247
+ .withDescription("JAVA-Credit")
248
+ .execute();
249
+ t.truthy(response);
250
+ t.is("00", response.responseCode);
251
+ });
252
+ (0, ava_1.default)("JAVA_Credit_007d", async (t) => {
253
+ t.plan(2);
254
+ // create card
255
+ const card = new src_1.CreditCardData();
256
+ card.number = "4263970000005262";
257
+ card.expMonth = "12";
258
+ card.expYear = "2018";
259
+ card.cvn = "123";
260
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
261
+ card.cardHolderName = "Peter Watermelon";
262
+ // request
263
+ const response = await card
264
+ .refund(1)
265
+ .withCurrency("EUR")
266
+ .withDescription("JAVA-Credit")
267
+ .execute();
268
+ t.truthy(response);
269
+ t.is("00", response.responseCode);
270
+ });
271
+ (0, ava_1.default)("JAVA_Credit_007e", async (t) => {
272
+ t.plan(2);
273
+ // create card
274
+ const card = new src_1.CreditCardData();
275
+ card.number = "4263970000005262";
276
+ card.expMonth = "12";
277
+ card.expYear = "2018";
278
+ card.cvn = "123";
279
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
280
+ card.cardHolderName = "Peter Watermelon";
281
+ // request
282
+ const response = await card
283
+ .refund(1)
284
+ .withCurrency("EUR")
285
+ .withDescription("JAVA-Credit")
286
+ .execute();
287
+ t.truthy(response);
288
+ t.is("00", response.responseCode);
289
+ });
290
+ (0, ava_1.default)("JAVA_Credit_008a", async (t) => {
291
+ t.plan(2);
292
+ // create card
293
+ const card = new src_1.CreditCardData();
294
+ card.number = "4263970000005262";
295
+ card.expMonth = "12";
296
+ card.expYear = "2018";
297
+ card.cvn = "123";
298
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
299
+ card.cardHolderName = "Peter Watermelon";
300
+ // request
301
+ const response = await card
302
+ .refund(1)
303
+ .withCurrency("EUR")
304
+ .withDescription("JAVA-Credit")
305
+ .execute();
306
+ t.truthy(response);
307
+ t.is("00", response.responseCode);
308
+ });
309
+ (0, ava_1.default)("JAVA_Credit_008b", async (t) => {
310
+ t.plan(2);
311
+ // create card
312
+ const card = new src_1.CreditCardData();
313
+ card.number = "4263970000005262";
314
+ card.expMonth = "12";
315
+ card.expYear = "2018";
316
+ card.cvn = "123";
317
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
318
+ card.cardHolderName = "Peter Watermelon";
319
+ // request
320
+ const response = await card
321
+ .refund(1)
322
+ .withCurrency("EUR")
323
+ .withDescription("JAVA-Credit")
324
+ .execute();
325
+ t.truthy(response);
326
+ t.is("00", response.responseCode);
327
+ });
328
+ (0, ava_1.default)("JAVA_Credit_008c", async (t) => {
329
+ t.plan(2);
330
+ // create card
331
+ const card = new src_1.CreditCardData();
332
+ card.number = "4263970000005262";
333
+ card.expMonth = "12";
334
+ card.expYear = "2018";
335
+ card.cvn = "123";
336
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
337
+ card.cardHolderName = "Peter Watermelon";
338
+ // request
339
+ const response = await card
340
+ .refund(1)
341
+ .withCurrency("EUR")
342
+ .withDescription("JAVA-Credit")
343
+ .execute();
344
+ t.truthy(response);
345
+ t.is("00", response.responseCode);
346
+ });
347
+ (0, ava_1.default)("JAVA_Credit_008d", async (t) => {
348
+ t.plan(2);
349
+ // create card
350
+ const card = new src_1.CreditCardData();
351
+ card.number = "4263970000005262";
352
+ card.expMonth = "12";
353
+ card.expYear = "2018";
354
+ card.cvn = "123";
355
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
356
+ card.cardHolderName = "Peter Watermelon";
357
+ // request
358
+ const response = await card
359
+ .refund(1)
360
+ .withCurrency("EUR")
361
+ .withDescription("JAVA-Credit")
362
+ .execute();
363
+ t.truthy(response);
364
+ t.is("00", response.responseCode);
365
+ });
366
+ (0, ava_1.default)("JAVA_Credit_008e", async (t) => {
367
+ t.plan(2);
368
+ // create card
369
+ const card = new src_1.CreditCardData();
370
+ card.number = "4263970000005262";
371
+ card.expMonth = "12";
372
+ card.expYear = "2018";
373
+ card.cvn = "123";
374
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
375
+ card.cardHolderName = "Peter Watermelon";
376
+ // request
377
+ const response = await card
378
+ .refund(1)
379
+ .withCurrency("EUR")
380
+ .withDescription("JAVA-Credit")
381
+ .execute();
382
+ t.truthy(response);
383
+ t.is("00", response.responseCode);
384
+ });
385
+ (0, ava_1.default)("JAVA_Credit_009a", async (t) => {
386
+ t.plan(2);
387
+ // create card
388
+ const card = new src_1.CreditCardData();
389
+ card.number = "4263970000005262";
390
+ card.expMonth = "12";
391
+ card.expYear = "2018";
392
+ card.cvn = "123";
393
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
394
+ card.cardHolderName = "Peter Watermelon";
395
+ // request
396
+ const response = await card
397
+ .refund(1)
398
+ .withCurrency("EUR")
399
+ .withDescription("JAVA-Credit")
400
+ .execute();
401
+ t.truthy(response);
402
+ t.is("00", response.responseCode);
403
+ });
404
+ (0, ava_1.default)("JAVA_Credit_009b", async (t) => {
405
+ t.plan(2);
406
+ const config = new ServiceConfigs_1.GpEcomConfig();
407
+ config.merchantId = "heartlandgpsandbox";
408
+ config.accountId = "api";
409
+ config.sharedSecret = "secret";
410
+ config.refundPassword = "refund";
411
+ config.rebatePassword = "rebate";
412
+ config.timeout = 20000;
413
+ config.channel = "EC";
414
+ src_1.ServicesContainer.configureService(config, "withChannelEC");
415
+ // create card
416
+ const card = new src_1.CreditCardData();
417
+ card.number = "4263970000005262";
418
+ card.expMonth = "12";
419
+ card.expYear = "2018";
420
+ card.cvn = "123";
421
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
422
+ card.cardHolderName = "Peter Watermelon";
423
+ // request
424
+ const response = await card
425
+ .refund(1)
426
+ .withCurrency("EUR")
427
+ .withDescription("JAVA-Credit")
428
+ .execute("withChannelEC");
429
+ t.truthy(response);
430
+ t.is("00", response.responseCode);
431
+ });
432
+ (0, ava_1.default)("JAVA_Credit_009c", async (t) => {
433
+ t.plan(2);
434
+ const config = new ServiceConfigs_1.GpEcomConfig();
435
+ config.merchantId = "heartlandgpsandbox";
436
+ config.accountId = "api";
437
+ config.sharedSecret = "secret";
438
+ config.refundPassword = "refund";
439
+ config.rebatePassword = "rebate";
440
+ config.timeout = 20000;
441
+ config.channel = "ECOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOM";
442
+ src_1.ServicesContainer.configureService(config, "withChannelECOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOM");
443
+ // create card
444
+ const card = new src_1.CreditCardData();
445
+ card.number = "4263970000005262";
446
+ card.expMonth = "12";
447
+ card.expYear = "2018";
448
+ card.cvn = "123";
449
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
450
+ card.cardHolderName = "Peter Watermelon";
451
+ // request
452
+ const response = await card
453
+ .refund(1)
454
+ .withCurrency("EUR")
455
+ .withDescription("JAVA-Credit")
456
+ .execute("withChannelECOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOM");
457
+ t.truthy(response);
458
+ t.is("00", response.responseCode);
459
+ });
460
+ (0, ava_1.default)("JAVA_Credit_009d", async (t) => {
461
+ t.plan(2);
462
+ const config = new ServiceConfigs_1.GpEcomConfig();
463
+ config.merchantId = "heartlandgpsandbox";
464
+ config.accountId = "api";
465
+ config.sharedSecret = "secret";
466
+ config.refundPassword = "refund";
467
+ config.rebatePassword = "rebate";
468
+ config.timeout = 5000;
469
+ src_1.ServicesContainer.configureService(config, "noChannel");
470
+ // create card
471
+ const card = new src_1.CreditCardData();
472
+ card.number = "4263970000005262";
473
+ card.expMonth = "12";
474
+ card.expYear = "2018";
475
+ card.cvn = "123";
476
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
477
+ card.cardHolderName = "Peter Watermelon";
478
+ // request
479
+ const response = await card
480
+ .refund(1)
481
+ .withCurrency("EUR")
482
+ .withDescription("JAVA-Credit")
483
+ .execute("noChannel");
484
+ t.truthy(response);
485
+ t.is("00", response.responseCode);
486
+ });
487
+ (0, ava_1.default)("JAVA_Credit_010c", async (t) => {
488
+ t.plan(2);
489
+ // create card
490
+ const card = new src_1.CreditCardData();
491
+ card.number = "4263970000005262";
492
+ card.expMonth = "12";
493
+ card.expYear = "2018";
494
+ card.cvn = "123";
495
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
496
+ card.cardHolderName = "Peter Watermelon";
497
+ // request
498
+ const response = await card
499
+ .refund(1)
500
+ .withCurrency("EUR")
501
+ .withDescription("JAVA-Credit")
502
+ .execute();
503
+ t.truthy(response);
504
+ t.is("00", response.responseCode);
505
+ });
506
+ (0, ava_1.default)("JAVA_Credit_010d", async (t) => {
507
+ t.plan(2);
508
+ // create card
509
+ const card = new src_1.CreditCardData();
510
+ card.number = "4263970000005262";
511
+ card.expMonth = "12";
512
+ card.expYear = "2018";
513
+ card.cvn = "123";
514
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
515
+ card.cardHolderName = "Peter Watermelon";
516
+ // request
517
+ const response = await card
518
+ .refund(1)
519
+ .withCurrency("EUR")
520
+ .withDescription("JAVA-Credit")
521
+ .execute();
522
+ t.truthy(response);
523
+ t.is("00", response.responseCode);
524
+ });
525
+ (0, ava_1.default)("JAVA_Credit_010e", async (t) => {
526
+ t.plan(2);
527
+ // create card
528
+ const card = new src_1.CreditCardData();
529
+ card.number = "4263970000005262";
530
+ card.expMonth = "12";
531
+ card.expYear = "2018";
532
+ card.cvn = "123";
533
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
534
+ card.cardHolderName = "Peter Watermelon";
535
+ // request
536
+ const response = await card
537
+ .refund(1)
538
+ .withCurrency("EUR")
539
+ .withDescription("JAVA-Credit")
540
+ .execute();
541
+ t.truthy(response);
542
+ t.is("00", response.responseCode);
543
+ });
544
+ (0, ava_1.default)("JAVA_Credit_011a", async (t) => {
545
+ t.plan(2);
546
+ // create card
547
+ const card = new src_1.CreditCardData();
548
+ card.number = "4263970000005262";
549
+ card.expMonth = "12";
550
+ card.expYear = "2018";
551
+ card.cvn = "123";
552
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
553
+ card.cardHolderName = "Peter Watermelon";
554
+ // request
555
+ const response = await card
556
+ .refund(1)
557
+ .withCurrency("EUR")
558
+ .withDescription("JAVA-Credit")
559
+ .execute();
560
+ t.truthy(response);
561
+ t.is("00", response.responseCode);
562
+ });
563
+ (0, ava_1.default)("JAVA_Credit_012a", async (t) => {
564
+ t.plan(2);
565
+ // create card
566
+ const card = new src_1.CreditCardData();
567
+ card.number = "4263970000005262";
568
+ card.expMonth = "12";
569
+ card.expYear = "2018";
570
+ card.cvn = "123";
571
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
572
+ card.cardHolderName = "Peter Watermelon";
573
+ // request
574
+ const response = await card
575
+ .refund(1)
576
+ .withCurrency("EUR")
577
+ .withDescription("JAVA-Credit")
578
+ .execute();
579
+ t.truthy(response);
580
+ t.is("00", response.responseCode);
581
+ });
582
+ (0, ava_1.default)("JAVA_Credit_012b", async (t) => {
583
+ t.plan(2);
584
+ // create card
585
+ const card = new src_1.CreditCardData();
586
+ card.number = "4263970000005262";
587
+ card.expMonth = "12";
588
+ card.expYear = "2018";
589
+ card.cvn = "123";
590
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
591
+ card.cardHolderName = "Peter Watermelon";
592
+ // request
593
+ const response = await card
594
+ .refund(1)
595
+ .withCurrency("EUR")
596
+ .withDescription("JAVA-Credit")
597
+ .execute();
598
+ t.truthy(response);
599
+ t.is("00", response.responseCode);
600
+ });
601
+ (0, ava_1.default)("JAVA_Credit_012c", async (t) => {
602
+ t.plan(2);
603
+ // create card
604
+ const card = new src_1.CreditCardData();
605
+ card.number = "4263970000005262";
606
+ card.expMonth = "12";
607
+ card.expYear = "2018";
608
+ card.cvn = "123";
609
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
610
+ card.cardHolderName = "Peter Watermelon";
611
+ // request
612
+ const response = await card
613
+ .refund(1)
614
+ .withCurrency("EUR")
615
+ .withDescription("JAVA-Credit")
616
+ .execute();
617
+ t.truthy(response);
618
+ t.is("00", response.responseCode);
619
+ });
620
+ (0, ava_1.default)("JAVA_Credit_013a", async (t) => {
621
+ t.plan(2);
622
+ // create card
623
+ const card = new src_1.CreditCardData();
624
+ card.number = "4263970000005262";
625
+ card.expMonth = "12";
626
+ card.expYear = "2018";
627
+ card.cvn = "123";
628
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
629
+ card.cardHolderName = "Peter Watermelon";
630
+ // request
631
+ const response = await card
632
+ .refund(1)
633
+ .withCurrency("EUR")
634
+ .withDescription("JAVA-Credit")
635
+ .execute();
636
+ t.truthy(response);
637
+ t.is("00", response.responseCode);
638
+ });
639
+ (0, ava_1.default)("JAVA_Credit_013b", async (t) => {
640
+ t.plan(2);
641
+ // create card
642
+ const card = new src_1.CreditCardData();
643
+ card.number = "4263970000005262";
644
+ card.expMonth = "12";
645
+ card.expYear = "2018";
646
+ card.cvn = "123";
647
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
648
+ // request
649
+ const error = await t.throwsAsync(async () => await card
650
+ .refund(1)
651
+ .withCurrency("EUR")
652
+ .withDescription("JAVA-Credit")
653
+ .execute(), { instanceOf: src_1.GatewayError });
654
+ t.truthy(error?.message);
655
+ });
656
+ (0, ava_1.default)("JAVA_Credit_013c", async (t) => {
657
+ t.plan(2);
658
+ // create card
659
+ const card = new src_1.CreditCardData();
660
+ card.number = "4263970000005262";
661
+ card.expMonth = "12";
662
+ card.expYear = "2018";
663
+ card.cvn = "123";
664
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
665
+ /* eslint-disable */
666
+ card.cardHolderName =
667
+ "Peter Watermelooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo";
668
+ /* eslint-enable */
669
+ // request
670
+ const error = await t.throwsAsync(async () => await card
671
+ .refund(1)
672
+ .withCurrency("EUR")
673
+ .withDescription("JAVA-Credit")
674
+ .execute(), { instanceOf: src_1.GatewayError });
675
+ t.truthy(error?.message);
676
+ });
677
+ (0, ava_1.default)("JAVA_Credit_014a", async (t) => {
678
+ t.plan(2);
679
+ // create card
680
+ const card = new src_1.CreditCardData();
681
+ card.number = "4263970000005262";
682
+ card.expMonth = "12";
683
+ card.expYear = "2018";
684
+ card.cvn = "123";
685
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
686
+ card.cardHolderName = "Peter Watermelon";
687
+ // request
688
+ const response = await card
689
+ .refund(1)
690
+ .withCurrency("EUR")
691
+ .withDescription("JAVA-Credit")
692
+ .execute();
693
+ t.truthy(response);
694
+ t.is("00", response.responseCode);
695
+ });
696
+ (0, ava_1.default)("JAVA_Credit_014b", async (t) => {
697
+ t.plan(2);
698
+ // create card
699
+ const card = new src_1.CreditCardData();
700
+ card.number = "4263970000005262";
701
+ card.expMonth = "12";
702
+ card.expYear = "1813";
703
+ card.cvn = "123";
704
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
705
+ card.cardHolderName = "Peter Watermelon";
706
+ // request
707
+ const response = await card
708
+ .refund(1)
709
+ .withCurrency("EUR")
710
+ .withDescription("JAVA-Credit")
711
+ .execute();
712
+ t.truthy(response);
713
+ t.is("00", response.responseCode);
714
+ });
715
+ (0, ava_1.default)("JAVA_Credit_014c", async (t) => {
716
+ t.plan(2);
717
+ // create card
718
+ const card = new src_1.CreditCardData();
719
+ card.number = "4263970000005262";
720
+ card.expMonth = "18";
721
+ card.expYear = "2012";
722
+ card.cvn = "123";
723
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
724
+ card.cardHolderName = "Peter Watermelon";
725
+ // request
726
+ const response = await card
727
+ .refund(1)
728
+ .withCurrency("EUR")
729
+ .withDescription("JAVA-Credit")
730
+ .execute();
731
+ t.truthy(response);
732
+ t.is("00", response.responseCode);
733
+ });
734
+ (0, ava_1.default)("JAVA_Credit_014d", async (t) => {
735
+ t.plan(2);
736
+ // create card
737
+ const card = new src_1.CreditCardData();
738
+ card.number = "4263970000005262";
739
+ card.cvn = "123";
740
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
741
+ card.cardHolderName = "Peter Watermelon";
742
+ // request
743
+ const error = await t.throwsAsync(async () => await card
744
+ .refund(1)
745
+ .withCurrency("EUR")
746
+ .withDescription("JAVA-Credit")
747
+ .execute(), { instanceOf: src_1.GatewayError });
748
+ t.truthy(error?.message);
749
+ });
750
+ (0, ava_1.default)("JAVA_Credit_015a", async (t) => {
751
+ t.plan(2);
752
+ // create card
753
+ const card = new src_1.CreditCardData();
754
+ card.number = "4263970000005262";
755
+ card.expMonth = "12";
756
+ card.expYear = "2018";
757
+ card.cvn = "123";
758
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
759
+ card.cardHolderName = "Peter Watermelon";
760
+ // request
761
+ const response = await card
762
+ .refund(1)
763
+ .withCurrency("EUR")
764
+ .withDescription("JAVA-Credit")
765
+ .execute();
766
+ t.truthy(response);
767
+ t.is("00", response.responseCode);
768
+ });
769
+ (0, ava_1.default)("JAVA_Credit_015b", async (t) => {
770
+ t.plan(2);
771
+ // create card
772
+ const card = new src_1.CreditCardData();
773
+ card.number = "4263970000005262";
774
+ card.expMonth = "12";
775
+ card.expYear = "2018";
776
+ card.cvn = "123";
777
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
778
+ card.cardHolderName = "Peter Watermelon";
779
+ // request
780
+ const response = await card
781
+ .refund(1)
782
+ .withCurrency("EUR")
783
+ .withDescription("JAVA-Credit")
784
+ .execute();
785
+ t.truthy(response);
786
+ t.is("00", response.responseCode);
787
+ });
788
+ (0, ava_1.default)("JAVA_Credit_015c", async (t) => {
789
+ t.plan(2);
790
+ // create card
791
+ const card = new src_1.CreditCardData();
792
+ card.number = "4263970000005262";
793
+ card.expMonth = "12";
794
+ card.expYear = "2018";
795
+ card.cvn = "123";
796
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
797
+ card.cardHolderName = "Peter Watermelon";
798
+ // request
799
+ const response = await card
800
+ .refund(1)
801
+ .withCurrency("EUR")
802
+ .withDescription("JAVA-Credit")
803
+ .execute();
804
+ t.truthy(response);
805
+ t.is("00", response.responseCode);
806
+ });
807
+ (0, ava_1.default)("JAVA_Credit_016a", async (t) => {
808
+ t.plan(2);
809
+ // create card
810
+ const card = new src_1.CreditCardData();
811
+ card.number = "4263970000005262";
812
+ card.expMonth = "12";
813
+ card.expYear = "2018";
814
+ card.cvn = "123";
815
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
816
+ card.cardHolderName = "Peter Watermelon";
817
+ // request
818
+ const response = await card
819
+ .refund(1)
820
+ .withCurrency("EUR")
821
+ .withDescription("JAVA-Credit")
822
+ .execute();
823
+ t.truthy(response);
824
+ t.is("00", response.responseCode);
825
+ });
826
+ (0, ava_1.default)("JAVA_Credit_017a", async (t) => {
827
+ t.plan(2);
828
+ // create card
829
+ const card = new src_1.CreditCardData();
830
+ card.number = "4263970000005262";
831
+ card.expMonth = "12";
832
+ card.expYear = "2018";
833
+ card.cvn = "123";
834
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
835
+ card.cardHolderName = "Peter Watermelon";
836
+ // request
837
+ const response = await card
838
+ .refund(1)
839
+ .withCurrency("EUR")
840
+ .withDescription("JAVA-Credit")
841
+ .execute();
842
+ t.truthy(response);
843
+ t.is("00", response.responseCode);
844
+ });
845
+ (0, ava_1.default)("JAVA_Credit_017b", async (t) => {
846
+ t.plan(2);
847
+ // create card
848
+ const card = new src_1.CreditCardData();
849
+ card.number = "4263970000005262";
850
+ card.expMonth = "12";
851
+ card.expYear = "2018";
852
+ card.cvn = "123";
853
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
854
+ card.cardHolderName = "Peter Watermelon";
855
+ // request
856
+ const response = await card
857
+ .refund(1)
858
+ .withCurrency("EUR")
859
+ .withDescription("JAVA-Credit")
860
+ .execute();
861
+ t.truthy(response);
862
+ t.is("00", response.responseCode);
863
+ });
864
+ (0, ava_1.default)("JAVA_Credit_017c", async (t) => {
865
+ t.plan(2);
866
+ // create card
867
+ const card = new src_1.CreditCardData();
868
+ card.number = "4263970000005262";
869
+ card.expMonth = "12";
870
+ card.expYear = "2018";
871
+ card.cvn = "123456789";
872
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
873
+ card.cardHolderName = "Peter Watermelon";
874
+ // request
875
+ const error = await t.throwsAsync(async () => await card
876
+ .refund(1)
877
+ .withCurrency("EUR")
878
+ .withDescription("JAVA-Credit")
879
+ .execute(), { instanceOf: src_1.GatewayError });
880
+ t.truthy(error?.message);
881
+ });
882
+ (0, ava_1.default)("JAVA_Credit_017d", async (t) => {
883
+ t.plan(2);
884
+ // create card
885
+ const card = new src_1.CreditCardData();
886
+ card.number = "374101000000608";
887
+ card.expMonth = "12";
888
+ card.expYear = "2018";
889
+ card.cvn = "1234";
890
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
891
+ card.cardHolderName = "Peter Watermelon";
892
+ // request
893
+ const response = await card
894
+ .refund(1)
895
+ .withCurrency("EUR")
896
+ .withDescription("JAVA-Credit")
897
+ .execute();
898
+ t.truthy(response);
899
+ t.is("00", response.responseCode);
900
+ });
901
+ (0, ava_1.default)("JAVA_Credit_017f", async (t) => {
902
+ t.plan(2);
903
+ // create card
904
+ const card = new src_1.CreditCardData();
905
+ card.number = "4242424242424240";
906
+ card.expMonth = "12";
907
+ card.expYear = "2018";
908
+ card.cvn = "7";
909
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
910
+ card.cardHolderName = "Peter Watermelon";
911
+ // request
912
+ const error = await t.throwsAsync(async () => await card
913
+ .refund(1)
914
+ .withCurrency("EUR")
915
+ .withDescription("JAVA-Credit")
916
+ .execute(), { instanceOf: src_1.GatewayError });
917
+ t.truthy(error?.message);
918
+ });
919
+ (0, ava_1.default)("JAVA_Credit_017g", async (t) => {
920
+ t.plan(2);
921
+ // create card
922
+ const card = new src_1.CreditCardData();
923
+ card.number = "4263970000005262";
924
+ card.expMonth = "12";
925
+ card.expYear = "2018";
926
+ card.cvn = "12#";
927
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
928
+ card.cardHolderName = "Peter Watermelon";
929
+ // request
930
+ const error = await t.throwsAsync(async () => await card
931
+ .refund(1)
932
+ .withCurrency("EUR")
933
+ .withDescription("JAVA-Credit")
934
+ .execute(), { instanceOf: src_1.GatewayError });
935
+ t.truthy(error?.message);
936
+ });
937
+ (0, ava_1.default)("JAVA_Credit_018a", async (t) => {
938
+ t.plan(2);
939
+ // create card
940
+ const card = new src_1.CreditCardData();
941
+ card.number = "4263970000005262";
942
+ card.expMonth = "12";
943
+ card.expYear = "2018";
944
+ card.cvn = "123";
945
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
946
+ card.cardHolderName = "Peter Watermelon";
947
+ // request
948
+ const response = await card
949
+ .refund(1)
950
+ .withCurrency("EUR")
951
+ .withDescription("JAVA-Credit")
952
+ .execute();
953
+ t.truthy(response);
954
+ t.is("00", response.responseCode);
955
+ });
956
+ (0, ava_1.default)("JAVA_Credit_018b", async (t) => {
957
+ t.plan(2);
958
+ // create card
959
+ const card = new src_1.CreditCardData();
960
+ card.number = "4263970000005262";
961
+ card.expMonth = "12";
962
+ card.expYear = "2018";
963
+ card.cvn = "123";
964
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
965
+ card.cardHolderName = "Peter Watermelon";
966
+ // request
967
+ const response = await card
968
+ .refund(1)
969
+ .withCurrency("EUR")
970
+ .withDescription("JAVA-Credit")
971
+ .execute();
972
+ t.truthy(response);
973
+ t.is("00", response.responseCode);
974
+ });
975
+ (0, ava_1.default)("JAVA_Credit_018c", async (t) => {
976
+ t.plan(2);
977
+ // create card
978
+ const card = new src_1.CreditCardData();
979
+ card.number = "4263970000005262";
980
+ card.expMonth = "12";
981
+ card.expYear = "2018";
982
+ card.cvn = "123";
983
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
984
+ card.cardHolderName = "Peter Watermelon";
985
+ // request
986
+ const response = await card
987
+ .refund(1)
988
+ .withCurrency("EUR")
989
+ .withDescription("JAVA-Credit")
990
+ .execute();
991
+ t.truthy(response);
992
+ t.is("00", response.responseCode);
993
+ });
994
+ (0, ava_1.default)("JAVA_Credit_018d", async (t) => {
995
+ t.plan(2);
996
+ // create card
997
+ const card = new src_1.CreditCardData();
998
+ card.number = "4263970000005262";
999
+ card.expMonth = "12";
1000
+ card.expYear = "2018";
1001
+ card.cvn = "123";
1002
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1003
+ card.cardHolderName = "Peter Watermelon";
1004
+ // request
1005
+ const response = await card
1006
+ .refund(1)
1007
+ .withCurrency("EUR")
1008
+ .withDescription("JAVA-Credit")
1009
+ .execute();
1010
+ t.truthy(response);
1011
+ t.is("00", response.responseCode);
1012
+ });
1013
+ (0, ava_1.default)("JAVA_Credit_019a", async (t) => {
1014
+ t.plan(2);
1015
+ // create card
1016
+ const card = new src_1.CreditCardData();
1017
+ card.number = "4263970000005262";
1018
+ card.expMonth = "12";
1019
+ card.expYear = "2018";
1020
+ card.cvn = "123";
1021
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1022
+ card.cardHolderName = "Peter Watermelon";
1023
+ // request
1024
+ const response = await card
1025
+ .refund(1)
1026
+ .withCurrency("EUR")
1027
+ .withDescription("JAVA-Credit")
1028
+ .execute();
1029
+ t.truthy(response);
1030
+ t.is("00", response.responseCode);
1031
+ });
1032
+ (0, ava_1.default)("JAVA_Credit_019b", async (t) => {
1033
+ t.plan(2);
1034
+ // create card
1035
+ const card = new src_1.CreditCardData();
1036
+ card.number = "4263970000005262";
1037
+ card.expMonth = "12";
1038
+ card.expYear = "2018";
1039
+ card.cvn = "123";
1040
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1041
+ card.cardHolderName = "Peter Watermelon";
1042
+ // request
1043
+ const response = await card
1044
+ .refund(1)
1045
+ .withCurrency("EUR")
1046
+ .withDescription("JAVA-Credit")
1047
+ .execute();
1048
+ t.truthy(response);
1049
+ t.is("00", response.responseCode);
1050
+ });
1051
+ (0, ava_1.default)("JAVA_Credit_019c", async (t) => {
1052
+ t.plan(2);
1053
+ // create card
1054
+ const card = new src_1.CreditCardData();
1055
+ card.number = "4263970000005262";
1056
+ card.expMonth = "12";
1057
+ card.expYear = "2018";
1058
+ card.cvn = "123";
1059
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1060
+ card.cardHolderName = "Peter Watermelon";
1061
+ // request
1062
+ const response = await card
1063
+ .refund(1)
1064
+ .withCurrency("EUR")
1065
+ .withDescription("JAVA-Credit")
1066
+ .execute();
1067
+ t.truthy(response);
1068
+ t.is("00", response.responseCode);
1069
+ });
1070
+ (0, ava_1.default)("JAVA_Credit_020a", async (t) => {
1071
+ t.plan(2);
1072
+ // create card
1073
+ const card = new src_1.CreditCardData();
1074
+ card.number = "4263970000005262";
1075
+ card.expMonth = "12";
1076
+ card.expYear = "2018";
1077
+ card.cvn = "123";
1078
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1079
+ card.cardHolderName = "Peter Watermelon";
1080
+ // request
1081
+ const response = await card
1082
+ .refund(1)
1083
+ .withCurrency("EUR")
1084
+ .withDescription("JAVA-Credit")
1085
+ .execute();
1086
+ t.truthy(response);
1087
+ t.is("00", response.responseCode);
1088
+ });
1089
+ (0, ava_1.default)("JAVA_Credit_020b", async (t) => {
1090
+ t.plan(2);
1091
+ const config = new ServiceConfigs_1.GpEcomConfig();
1092
+ config.merchantId = "heartlandgpsandbox";
1093
+ config.accountId = "api";
1094
+ config.sharedSecret = "secreto";
1095
+ config.refundPassword = "refund";
1096
+ config.rebatePassword = "rebate";
1097
+ config.timeout = 5000;
1098
+ config.channel = "ECOM";
1099
+ src_1.ServicesContainer.configureService(config, "withSecreto");
1100
+ // create card
1101
+ const card = new src_1.CreditCardData();
1102
+ card.number = "4263970000005262";
1103
+ card.expMonth = "12";
1104
+ card.expYear = "2018";
1105
+ card.cvn = "123";
1106
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1107
+ card.cardHolderName = "Peter Watermelon";
1108
+ // request
1109
+ const error = await t.throwsAsync(async () => await card
1110
+ .refund(1)
1111
+ .withCurrency("EUR")
1112
+ .withDescription("JAVA-Credit")
1113
+ .execute("withSecreto"), { instanceOf: src_1.GatewayError });
1114
+ t.truthy(error?.message);
1115
+ });
1116
+ (0, ava_1.default)("JAVA_Credit_021a", async (t) => {
1117
+ t.plan(2);
1118
+ // create card
1119
+ const card = new src_1.CreditCardData();
1120
+ card.number = "4263970000005262";
1121
+ card.expMonth = "12";
1122
+ card.expYear = "2018";
1123
+ card.cvn = "123";
1124
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1125
+ card.cardHolderName = "Peter Watermelon";
1126
+ // request
1127
+ const response = await card
1128
+ .refund(1)
1129
+ .withCurrency("EUR")
1130
+ .withDescription("JAVA-Credit")
1131
+ .execute();
1132
+ t.truthy(response);
1133
+ t.is("00", response.responseCode);
1134
+ });
1135
+ (0, ava_1.default)("JAVA_Credit_021b", async (t) => {
1136
+ t.plan(2);
1137
+ // create card
1138
+ const card = new src_1.CreditCardData();
1139
+ card.number = "4263970000005262";
1140
+ card.expMonth = "12";
1141
+ card.expYear = "2018";
1142
+ card.cvn = "123";
1143
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1144
+ card.cardHolderName = "Peter Watermelon";
1145
+ // request
1146
+ const response = await card
1147
+ .refund(1.005)
1148
+ .withCurrency("EUR")
1149
+ .withDescription("JAVA-Credit-021b")
1150
+ .execute();
1151
+ t.truthy(response);
1152
+ t.is("00", response.responseCode);
1153
+ });
1154
+ (0, ava_1.default)("JAVA_Credit_021c", async (t) => {
1155
+ t.plan(2);
1156
+ // create card
1157
+ const card = new src_1.CreditCardData();
1158
+ card.number = "4263970000005262";
1159
+ card.expMonth = "12";
1160
+ card.expYear = "2018";
1161
+ card.cvn = "123";
1162
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1163
+ card.cardHolderName = "Peter Watermelon";
1164
+ // request
1165
+ const error = t.throws(() => card
1166
+ .refund()
1167
+ .withCurrency("EUR")
1168
+ .withDescription("JAVA-Credit")
1169
+ .execute(), { instanceOf: src_1.BuilderError });
1170
+ t.truthy(error?.message);
1171
+ });
1172
+ (0, ava_1.default)("JAVA_Credit_021d", async (t) => {
1173
+ t.plan(2);
1174
+ // create card
1175
+ const card = new src_1.CreditCardData();
1176
+ card.number = "4263970000005262";
1177
+ card.expMonth = "12";
1178
+ card.expYear = "2018";
1179
+ card.cvn = "123";
1180
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1181
+ card.cardHolderName = "Peter Watermelon";
1182
+ // request
1183
+ const error = t.throws(() => card
1184
+ .refund()
1185
+ .withCurrency("EUR")
1186
+ .withDescription("JAVA-Credit")
1187
+ .execute(), { instanceOf: src_1.BuilderError });
1188
+ t.truthy(error?.message);
1189
+ });
1190
+ (0, ava_1.default)("JAVA_Credit_021e", async (t) => {
1191
+ t.plan(2);
1192
+ // create card
1193
+ const card = new src_1.CreditCardData();
1194
+ card.number = "4263970000005262";
1195
+ card.expMonth = "12";
1196
+ card.expYear = "2018";
1197
+ card.cvn = "123";
1198
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1199
+ card.cardHolderName = "Peter Watermelon";
1200
+ // request
1201
+ const response = await card
1202
+ .refund(100000)
1203
+ .withCurrency("EUR")
1204
+ .withDescription("JAVA-Credit")
1205
+ .execute();
1206
+ t.truthy(response);
1207
+ t.is("00", response.responseCode);
1208
+ });
1209
+ (0, ava_1.default)("JAVA_Credit_021f", async (t) => {
1210
+ t.plan(2);
1211
+ // create card
1212
+ const card = new src_1.CreditCardData();
1213
+ card.number = "4263970000005262";
1214
+ card.expMonth = "12";
1215
+ card.expYear = "2018";
1216
+ card.cvn = "123";
1217
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1218
+ card.cardHolderName = "Peter Watermelon";
1219
+ // request
1220
+ const error = t.throws(() => card
1221
+ .refund()
1222
+ .withCurrency("EUR")
1223
+ .withDescription("JAVA-Credit")
1224
+ .execute(), { instanceOf: src_1.BuilderError });
1225
+ t.truthy(error?.message);
1226
+ });
1227
+ (0, ava_1.default)("JAVA_Credit_022a", async (t) => {
1228
+ t.plan(2);
1229
+ // create card
1230
+ const card = new src_1.CreditCardData();
1231
+ card.number = "4263970000005262";
1232
+ card.expMonth = "12";
1233
+ card.expYear = "2018";
1234
+ card.cvn = "123";
1235
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1236
+ card.cardHolderName = "Peter Watermelon";
1237
+ // request
1238
+ const response = await card
1239
+ .refund(1)
1240
+ .withCurrency("EUR")
1241
+ .withDescription("JAVA-Credit")
1242
+ .execute();
1243
+ t.truthy(response);
1244
+ t.is("00", response.responseCode);
1245
+ });
1246
+ (0, ava_1.default)("JAVA_Credit_022b", async (t) => {
1247
+ t.plan(2);
1248
+ // create card
1249
+ const card = new src_1.CreditCardData();
1250
+ card.number = "4263970000005262";
1251
+ card.expMonth = "12";
1252
+ card.expYear = "2018";
1253
+ card.cvn = "123";
1254
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1255
+ card.cardHolderName = "Peter Watermelon";
1256
+ // request
1257
+ const error = await t.throwsAsync(async () => await card
1258
+ .refund(1)
1259
+ .withCurrency("EURO")
1260
+ .withDescription("JAVA-Credit")
1261
+ .execute(), { instanceOf: src_1.GatewayError });
1262
+ t.truthy(error?.message);
1263
+ });
1264
+ (0, ava_1.default)("JAVA_Credit_022c", async (t) => {
1265
+ t.plan(2);
1266
+ // create card
1267
+ const card = new src_1.CreditCardData();
1268
+ card.number = "4263970000005262";
1269
+ card.expMonth = "12";
1270
+ card.expYear = "2018";
1271
+ card.cvn = "123";
1272
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1273
+ card.cardHolderName = "Peter Watermelon";
1274
+ // request
1275
+ const error = await t.throwsAsync(async () => await card
1276
+ .refund(1)
1277
+ .withCurrency("EU#")
1278
+ .withDescription("JAVA-Credit")
1279
+ .execute(), { instanceOf: src_1.GatewayError });
1280
+ t.truthy(error?.message);
1281
+ });
1282
+ (0, ava_1.default)("JAVA_Credit_022d", async (t) => {
1283
+ t.plan(2);
1284
+ // create card
1285
+ const card = new src_1.CreditCardData();
1286
+ card.number = "4263970000005262";
1287
+ card.expMonth = "12";
1288
+ card.expYear = "2018";
1289
+ card.cvn = "123";
1290
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1291
+ card.cardHolderName = "Peter Watermelon";
1292
+ // request
1293
+ const error = t.throws(() => card.refund(1).withDescription("JAVA-Credit").execute(), { instanceOf: src_1.BuilderError });
1294
+ t.truthy(error?.message);
1295
+ });
1296
+ //# sourceMappingURL=CreditTest.js.map