citypay_api_client 1.0.2 → 1.1.1

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. checksums.yaml +4 -4
  2. data/README.md +105 -34
  3. data/citypay_api_client.gemspec +4 -5
  4. data/docs/AccountCreate.md +10 -9
  5. data/docs/AccountStatus.md +8 -7
  6. data/docs/Acknowledgement.md +14 -13
  7. data/docs/AclCheckRequest.md +18 -0
  8. data/docs/AclCheckResponseModel.md +24 -0
  9. data/docs/AirlineAdvice.md +38 -37
  10. data/docs/AirlineSegment.md +22 -21
  11. data/docs/AuthReference.md +34 -33
  12. data/docs/AuthReferences.md +8 -7
  13. data/docs/AuthRequest.md +50 -49
  14. data/docs/AuthResponse.md +60 -59
  15. data/docs/AuthenRequired.md +12 -11
  16. data/docs/AuthorisationAndPaymentApi.md +559 -0
  17. data/docs/Batch.md +22 -0
  18. data/docs/BatchProcessingApi.md +214 -0
  19. data/docs/BatchReportRequest.md +20 -0
  20. data/docs/BatchReportResponseModel.md +28 -0
  21. data/docs/BatchTransaction.md +24 -0
  22. data/docs/BatchTransactionResultModel.md +40 -0
  23. data/docs/Bin.md +34 -0
  24. data/docs/BinLookup.md +18 -0
  25. data/docs/CResAuthRequest.md +8 -7
  26. data/docs/CaptureRequest.md +18 -17
  27. data/docs/Card.md +46 -41
  28. data/docs/CardHolderAccount.md +24 -21
  29. data/docs/CardHolderAccountApi.md +326 -105
  30. data/docs/CardStatus.md +10 -9
  31. data/docs/ChargeRequest.md +36 -31
  32. data/docs/CheckBatchStatus.md +20 -0
  33. data/docs/CheckBatchStatusResponse.md +18 -0
  34. data/docs/ContactDetails.md +32 -31
  35. data/docs/Decision.md +12 -11
  36. data/docs/DirectPostApi.md +365 -0
  37. data/docs/DirectPostRequest.md +58 -0
  38. data/docs/DirectTokenAuthRequest.md +24 -0
  39. data/docs/DomainKeyCheckRequest.md +18 -0
  40. data/docs/DomainKeyRequest.md +22 -0
  41. data/docs/DomainKeyResponse.md +26 -0
  42. data/docs/Error.md +16 -13
  43. data/docs/EventDataModel.md +26 -0
  44. data/docs/Exists.md +22 -0
  45. data/docs/ExternalMPI.md +16 -15
  46. data/docs/ListMerchantsResponse.md +12 -11
  47. data/docs/MCC6012.md +14 -13
  48. data/docs/Merchant.md +16 -15
  49. data/docs/OperationalApi.md +124 -22
  50. data/docs/OperationalFunctionsApi.md +355 -0
  51. data/docs/PaResAuthRequest.md +10 -9
  52. data/docs/PaylinkAddress.md +30 -0
  53. data/docs/PaylinkAdjustmentRequest.md +22 -0
  54. data/docs/PaylinkApi.md +630 -0
  55. data/docs/PaylinkAttachmentRequest.md +26 -0
  56. data/docs/PaylinkAttachmentResult.md +22 -0
  57. data/docs/PaylinkBillPaymentTokenRequest.md +32 -0
  58. data/docs/PaylinkCardHolder.md +36 -0
  59. data/docs/PaylinkCart.md +30 -0
  60. data/docs/PaylinkCartItemModel.md +32 -0
  61. data/docs/PaylinkConfig.md +60 -0
  62. data/docs/PaylinkCustomParam.md +36 -0
  63. data/docs/PaylinkEmailNotificationPath.md +26 -0
  64. data/docs/PaylinkErrorCode.md +20 -0
  65. data/docs/PaylinkFieldGuardModel.md +30 -0
  66. data/docs/PaylinkPartPayments.md +28 -0
  67. data/docs/PaylinkSMSNotificationPath.md +20 -0
  68. data/docs/PaylinkStateEvent.md +22 -0
  69. data/docs/PaylinkTokenCreated.md +44 -0
  70. data/docs/PaylinkTokenRequestModel.md +38 -0
  71. data/docs/PaylinkTokenStatus.md +72 -0
  72. data/docs/PaylinkTokenStatusChangeRequest.md +26 -0
  73. data/docs/PaylinkTokenStatusChangeResponse.md +20 -0
  74. data/docs/PaylinkUI.md +24 -0
  75. data/docs/PaymentProcessingApi.md +307 -68
  76. data/docs/Ping.md +8 -7
  77. data/docs/ProcessBatchRequest.md +24 -0
  78. data/docs/ProcessBatchResponse.md +20 -0
  79. data/docs/RefundRequest.md +26 -0
  80. data/docs/RegisterCard.md +16 -13
  81. data/docs/RequestChallenged.md +16 -15
  82. data/docs/RetrieveRequest.md +12 -11
  83. data/docs/ThreeDSecure.md +32 -15
  84. data/docs/TokenisationResponseModel.md +36 -0
  85. data/docs/VoidRequest.md +12 -13
  86. data/lib/.DS_Store +0 -0
  87. data/lib/citypay_api_client/api/authorisation_and_payment_api__.rb +565 -0
  88. data/lib/citypay_api_client/api/batch_processing_api__.rb +225 -0
  89. data/lib/citypay_api_client/api/{card_holder_account_api.rb → card_holder_account_api__.rb} +136 -46
  90. data/lib/citypay_api_client/api/direct_post_api__.rb +373 -0
  91. data/lib/citypay_api_client/api/operational_functions_api__.rb +356 -0
  92. data/lib/citypay_api_client/api/paylink_api__.rb +614 -0
  93. data/lib/citypay_api_client/api_client.rb +59 -59
  94. data/lib/citypay_api_client/api_error.rb +2 -2
  95. data/lib/citypay_api_client/configuration.rb +53 -15
  96. data/lib/citypay_api_client/models/account_create.rb +21 -8
  97. data/lib/citypay_api_client/models/account_status.rb +21 -8
  98. data/lib/citypay_api_client/models/acknowledgement.rb +21 -8
  99. data/lib/citypay_api_client/models/acl_check_request.rb +224 -0
  100. data/lib/citypay_api_client/models/acl_check_response_model.rb +249 -0
  101. data/lib/citypay_api_client/models/airline_advice.rb +23 -10
  102. data/lib/citypay_api_client/models/airline_segment.rb +21 -8
  103. data/lib/citypay_api_client/models/api_key.rb +16 -0
  104. data/lib/citypay_api_client/models/auth_reference.rb +45 -11
  105. data/lib/citypay_api_client/models/auth_references.rb +21 -8
  106. data/lib/citypay_api_client/models/auth_request.rb +79 -33
  107. data/lib/citypay_api_client/models/auth_response.rb +43 -106
  108. data/lib/citypay_api_client/models/authen_required.rb +21 -8
  109. data/lib/citypay_api_client/models/batch.rb +264 -0
  110. data/lib/citypay_api_client/models/batch_report_request.rb +277 -0
  111. data/lib/citypay_api_client/models/batch_report_response_model.rb +357 -0
  112. data/lib/citypay_api_client/models/batch_transaction.rb +321 -0
  113. data/lib/citypay_api_client/models/batch_transaction_result_model.rb +421 -0
  114. data/lib/citypay_api_client/models/bin.rb +299 -0
  115. data/lib/citypay_api_client/models/bin_lookup.rb +234 -0
  116. data/lib/citypay_api_client/models/c_res_auth_request.rb +21 -8
  117. data/lib/citypay_api_client/models/capture_request.rb +38 -20
  118. data/lib/citypay_api_client/models/card.rb +67 -10
  119. data/lib/citypay_api_client/models/card_holder_account.rb +35 -12
  120. data/lib/citypay_api_client/models/card_status.rb +21 -8
  121. data/lib/citypay_api_client/models/charge_request.rb +96 -24
  122. data/lib/citypay_api_client/models/check_batch_status.rb +259 -0
  123. data/lib/citypay_api_client/models/check_batch_status_response.rb +220 -0
  124. data/lib/citypay_api_client/models/contact_details.rb +87 -44
  125. data/lib/citypay_api_client/models/decision.rb +21 -8
  126. data/lib/citypay_api_client/models/direct_post_request.rb +670 -0
  127. data/lib/citypay_api_client/models/direct_token_auth_request.rb +249 -0
  128. data/lib/citypay_api_client/models/domain_key_check_request.rb +252 -0
  129. data/lib/citypay_api_client/models/domain_key_request.rb +250 -0
  130. data/lib/citypay_api_client/models/domain_key_response.rb +294 -0
  131. data/lib/citypay_api_client/models/error.rb +35 -12
  132. data/lib/citypay_api_client/models/event_data_model.rb +259 -0
  133. data/lib/citypay_api_client/models/exists.rb +244 -0
  134. data/lib/citypay_api_client/models/external_mpi.rb +27 -8
  135. data/lib/citypay_api_client/models/list_merchants_response.rb +21 -8
  136. data/lib/citypay_api_client/models/mcc6012.rb +21 -8
  137. data/lib/citypay_api_client/models/merchant.rb +21 -8
  138. data/lib/citypay_api_client/models/pa_res_auth_request.rb +22 -9
  139. data/lib/citypay_api_client/models/paylink_address.rb +402 -0
  140. data/lib/citypay_api_client/models/paylink_adjustment_request.rb +269 -0
  141. data/lib/citypay_api_client/models/paylink_attachment_request.rb +269 -0
  142. data/lib/citypay_api_client/models/paylink_attachment_result.rb +249 -0
  143. data/lib/citypay_api_client/models/paylink_bill_payment_token_request.rb +292 -0
  144. data/lib/citypay_api_client/models/paylink_card_holder.rb +353 -0
  145. data/lib/citypay_api_client/models/paylink_cart.rb +280 -0
  146. data/lib/citypay_api_client/models/paylink_cart_item_model.rb +289 -0
  147. data/lib/citypay_api_client/models/paylink_config.rb +433 -0
  148. data/lib/citypay_api_client/models/paylink_custom_param.rb +314 -0
  149. data/lib/citypay_api_client/models/paylink_email_notification_path.rb +268 -0
  150. data/lib/citypay_api_client/models/paylink_error_code.rb +239 -0
  151. data/lib/citypay_api_client/models/paylink_field_guard_model.rb +279 -0
  152. data/lib/citypay_api_client/models/paylink_part_payments.rb +269 -0
  153. data/lib/citypay_api_client/models/paylink_sms_notification_path.rb +234 -0
  154. data/lib/citypay_api_client/models/paylink_state_event.rb +239 -0
  155. data/lib/citypay_api_client/models/paylink_token_created.rb +364 -0
  156. data/lib/citypay_api_client/models/paylink_token_request_model.rb +374 -0
  157. data/lib/citypay_api_client/models/paylink_token_status.rb +490 -0
  158. data/lib/citypay_api_client/models/paylink_token_status_change_request.rb +270 -0
  159. data/lib/citypay_api_client/models/paylink_token_status_change_response.rb +235 -0
  160. data/lib/citypay_api_client/models/paylink_ui.rb +249 -0
  161. data/lib/citypay_api_client/models/ping.rb +21 -8
  162. data/lib/citypay_api_client/models/process_batch_request.rb +308 -0
  163. data/lib/citypay_api_client/models/process_batch_response.rb +234 -0
  164. data/lib/citypay_api_client/models/refund_request.rb +332 -0
  165. data/lib/citypay_api_client/models/register_card.rb +59 -12
  166. data/lib/citypay_api_client/models/request_challenged.rb +29 -16
  167. data/lib/citypay_api_client/models/retrieve_request.rb +21 -8
  168. data/lib/citypay_api_client/models/three_d_secure.rb +106 -13
  169. data/lib/citypay_api_client/models/tokenisation_response_model.rb +333 -0
  170. data/lib/citypay_api_client/models/void_request.rb +22 -19
  171. data/lib/citypay_api_client/utils/digest_utils.rb +18 -0
  172. data/lib/citypay_api_client/utils/direct_post_mac.rb +22 -0
  173. data/lib/citypay_api_client/version.rb +3 -3
  174. data/lib/citypay_api_client.rb +53 -6
  175. data/spec/.DS_Store +0 -0
  176. data/spec/api/authorisation_and_payment_api___spec.rb +130 -0
  177. data/spec/api/batch_processing_api___spec.rb +70 -0
  178. data/spec/api/{card_holder_account_api_spec.rb → card_holder_account_api___spec.rb} +15 -3
  179. data/spec/api/direct_post_api___spec.rb +98 -0
  180. data/spec/api/operational_functions_api___spec.rb +94 -0
  181. data/spec/api/paylink_api___spec.rb +131 -0
  182. data/spec/api_client_spec.rb +4 -4
  183. data/spec/configuration_spec.rb +5 -5
  184. data/spec/it_api_sandbox_spec.rb +222 -0
  185. data/spec/models/acknowledgement_spec.rb +6 -8
  186. data/spec/models/acl_check_request_spec.rb +33 -0
  187. data/spec/models/acl_check_response_model_spec.rb +51 -0
  188. data/spec/models/auth_references_spec.rb +7 -8
  189. data/spec/models/auth_response_spec.rb +29 -30
  190. data/spec/models/batch_report_request_spec.rb +39 -0
  191. data/spec/models/batch_report_response_model_spec.rb +63 -0
  192. data/spec/models/batch_spec.rb +45 -0
  193. data/spec/models/batch_transaction_result_model_spec.rb +87 -0
  194. data/spec/models/batch_transaction_spec.rb +51 -0
  195. data/spec/models/bin_lookup_spec.rb +33 -0
  196. data/spec/models/bin_spec.rb +81 -0
  197. data/spec/models/card_holder_account_spec.rb +8 -5
  198. data/spec/models/check_batch_status_response_spec.rb +45 -0
  199. data/spec/models/check_batch_status_spec.rb +39 -0
  200. data/spec/models/decision_spec.rb +1 -1
  201. data/spec/models/direct_post_request_spec.rb +153 -0
  202. data/spec/models/direct_token_auth_request_spec.rb +51 -0
  203. data/spec/models/domain_key_check_request_spec.rb +33 -0
  204. data/spec/models/domain_key_request_spec.rb +45 -0
  205. data/spec/models/domain_key_response_spec.rb +57 -0
  206. data/spec/models/event_data_model_spec.rb +57 -0
  207. data/spec/{api/operational_api_spec.rb → models/exists_spec.rb} +14 -20
  208. data/spec/models/list_merchants_response_spec.rb +2 -2
  209. data/spec/models/paylink_address_spec.rb +69 -0
  210. data/spec/models/paylink_adjustment_request_spec.rb +45 -0
  211. data/spec/models/paylink_attachment_request_spec.rb +45 -0
  212. data/spec/models/paylink_attachment_result_spec.rb +45 -0
  213. data/spec/models/paylink_bill_payment_token_request_spec.rb +63 -0
  214. data/spec/models/paylink_card_holder_spec.rb +87 -0
  215. data/spec/models/paylink_cart_item_model_spec.rb +75 -0
  216. data/spec/models/paylink_cart_spec.rb +69 -0
  217. data/spec/models/paylink_config_spec.rb +159 -0
  218. data/spec/models/paylink_custom_param_spec.rb +87 -0
  219. data/spec/models/paylink_email_notification_path_spec.rb +57 -0
  220. data/spec/models/paylink_error_code_spec.rb +39 -0
  221. data/spec/models/paylink_field_guard_model_spec.rb +45 -0
  222. data/spec/models/paylink_part_payments_spec.rb +63 -0
  223. data/spec/models/paylink_sms_notification_path_spec.rb +39 -0
  224. data/spec/models/paylink_state_event_spec.rb +45 -0
  225. data/spec/models/paylink_token_created_spec.rb +111 -0
  226. data/spec/models/paylink_token_request_model_spec.rb +93 -0
  227. data/spec/models/paylink_token_status_change_request_spec.rb +57 -0
  228. data/spec/models/paylink_token_status_change_response_spec.rb +39 -0
  229. data/spec/models/paylink_token_status_spec.rb +195 -0
  230. data/spec/models/paylink_ui_spec.rb +51 -0
  231. data/spec/models/process_batch_request_spec.rb +51 -0
  232. data/spec/models/process_batch_response_spec.rb +39 -0
  233. data/spec/models/refund_request_spec.rb +64 -0
  234. data/spec/models/tokenisation_response_model_spec.rb +87 -0
  235. data/spec/spec_helper.rb +2 -2
  236. data/spec/utils/direct_post_mac_spec.rb +13 -0
  237. metadata +212 -37
  238. data/Gemfile.lock +0 -70
  239. data/git_push.sh +0 -58
  240. data/lib/citypay_api_client/api/operational_api.rb +0 -147
  241. data/lib/citypay_api_client/api/payment_processing_api.rb +0 -405
  242. data/lib/citypay_api_client/test.rb +0 -20
  243. data/spec/api/payment_processing_api_spec.rb +0 -106
@@ -0,0 +1,614 @@
1
+ =begin
2
+ #CityPay Payment API
3
+
4
+ # This CityPay API is a HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokinsed payments using Card Holder Accounts. ## Compliance and Security Your application will need to adhere to PCI-DSS standards to operate safely and to meet requirements set out by Visa and MasterCard and the PCI Security Standards Council. These include * Data must be collected using TLS version 1.2 using [strong cryptography](#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive card holder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
5
+
6
+ Contact: support@citypay.com
7
+ Generated by: https://openapi-generator.tech
8
+ OpenAPI Generator version: 6.2.1
9
+
10
+ =end
11
+
12
+ require 'cgi'
13
+
14
+ module CityPayApiClient
15
+ class PaylinkApi
16
+ attr_accessor :api_client
17
+
18
+ def initialize(api_client = ApiClient.default)
19
+ @api_client = api_client
20
+ end
21
+ # Paylink Token Adjustment
22
+ # Adjusts a TokenRequest's amount value when for instance 1. a Token is created and the shopping cart is updated 2. an invoice is adjusted either due to part payment or due to increased incurred costs.
23
+ # @param token [String] The token returned by the create token process.
24
+ # @param paylink_adjustment_request [PaylinkAdjustmentRequest]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [Acknowledgement]
27
+ def token_adjustment_request(token, paylink_adjustment_request, opts = {})
28
+ data, _status_code, _headers = token_adjustment_request_with_http_info(token, paylink_adjustment_request, opts)
29
+ data
30
+ end
31
+
32
+ # Paylink Token Adjustment
33
+ # Adjusts a TokenRequest's amount value when for instance 1. a Token is created and the shopping cart is updated 2. an invoice is adjusted either due to part payment or due to increased incurred costs.
34
+ # @param token [String] The token returned by the create token process.
35
+ # @param paylink_adjustment_request [PaylinkAdjustmentRequest]
36
+ # @param [Hash] opts the optional parameters
37
+ # @return [Array<(Acknowledgement, Integer, Hash)>] Acknowledgement data, response status code and response headers
38
+ def token_adjustment_request_with_http_info(token, paylink_adjustment_request, opts = {})
39
+ if @api_client.config.debugging
40
+ @api_client.config.logger.debug 'Calling API: PaylinkApi.token_adjustment_request ...'
41
+ end
42
+ # verify the required parameter 'token' is set
43
+ if @api_client.config.client_side_validation && token.nil?
44
+ fail ArgumentError, "Missing the required parameter 'token' when calling PaylinkApi.token_adjustment_request"
45
+ end
46
+ # verify the required parameter 'paylink_adjustment_request' is set
47
+ if @api_client.config.client_side_validation && paylink_adjustment_request.nil?
48
+ fail ArgumentError, "Missing the required parameter 'paylink_adjustment_request' when calling PaylinkApi.token_adjustment_request"
49
+ end
50
+ # resource path
51
+ local_var_path = '/paylink/{token}/adjustment'.sub('{' + 'token' + '}', CGI.escape(token.to_s))
52
+
53
+ # query parameters
54
+ query_params = opts[:query_params] || {}
55
+
56
+ # header parameters
57
+ header_params = opts[:header_params] || {}
58
+ # HTTP header 'Accept' (if needed)
59
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
60
+ # HTTP header 'Content-Type'
61
+ content_type = @api_client.select_header_content_type(['application/json', 'text/xml'])
62
+ if !content_type.nil?
63
+ header_params['Content-Type'] = content_type
64
+ end
65
+
66
+ # form parameters
67
+ form_params = opts[:form_params] || {}
68
+
69
+ # http body (model)
70
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(paylink_adjustment_request)
71
+
72
+ # return_type
73
+ return_type = opts[:debug_return_type] || 'Acknowledgement'
74
+
75
+ # auth_names
76
+ auth_names = opts[:debug_auth_names] || ['cp-api-key']
77
+
78
+ new_options = opts.merge(
79
+ :operation => :"PaylinkApi.token_adjustment_request",
80
+ :header_params => header_params,
81
+ :query_params => query_params,
82
+ :form_params => form_params,
83
+ :body => post_body,
84
+ :auth_names => auth_names,
85
+ :return_type => return_type
86
+ )
87
+
88
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
89
+ if @api_client.config.debugging
90
+ @api_client.config.logger.debug "API called: PaylinkApi#token_adjustment_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
91
+ end
92
+ return data, status_code, headers
93
+ end
94
+
95
+ # Close Paylink Token
96
+ # Marks a Paylink Token as closed. This closes the Token for any future action and the Token will not appear in any status request calls.
97
+ # @param token [String] The token returned by the create token process.
98
+ # @param [Hash] opts the optional parameters
99
+ # @return [Acknowledgement]
100
+ def token_close_request(token, opts = {})
101
+ data, _status_code, _headers = token_close_request_with_http_info(token, opts)
102
+ data
103
+ end
104
+
105
+ # Close Paylink Token
106
+ # Marks a Paylink Token as closed. This closes the Token for any future action and the Token will not appear in any status request calls.
107
+ # @param token [String] The token returned by the create token process.
108
+ # @param [Hash] opts the optional parameters
109
+ # @return [Array<(Acknowledgement, Integer, Hash)>] Acknowledgement data, response status code and response headers
110
+ def token_close_request_with_http_info(token, opts = {})
111
+ if @api_client.config.debugging
112
+ @api_client.config.logger.debug 'Calling API: PaylinkApi.token_close_request ...'
113
+ end
114
+ # verify the required parameter 'token' is set
115
+ if @api_client.config.client_side_validation && token.nil?
116
+ fail ArgumentError, "Missing the required parameter 'token' when calling PaylinkApi.token_close_request"
117
+ end
118
+ # resource path
119
+ local_var_path = '/paylink/{token}/close'.sub('{' + 'token' + '}', CGI.escape(token.to_s))
120
+
121
+ # query parameters
122
+ query_params = opts[:query_params] || {}
123
+
124
+ # header parameters
125
+ header_params = opts[:header_params] || {}
126
+ # HTTP header 'Accept' (if needed)
127
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
128
+
129
+ # form parameters
130
+ form_params = opts[:form_params] || {}
131
+
132
+ # http body (model)
133
+ post_body = opts[:debug_body]
134
+
135
+ # return_type
136
+ return_type = opts[:debug_return_type] || 'Acknowledgement'
137
+
138
+ # auth_names
139
+ auth_names = opts[:debug_auth_names] || ['cp-api-key']
140
+
141
+ new_options = opts.merge(
142
+ :operation => :"PaylinkApi.token_close_request",
143
+ :header_params => header_params,
144
+ :query_params => query_params,
145
+ :form_params => form_params,
146
+ :body => post_body,
147
+ :auth_names => auth_names,
148
+ :return_type => return_type
149
+ )
150
+
151
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
152
+ if @api_client.config.debugging
153
+ @api_client.config.logger.debug "API called: PaylinkApi#token_close_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
154
+ end
155
+ return data, status_code, headers
156
+ end
157
+
158
+ # Create Bill Payment Paylink Token
159
+ # CityPay Paylink supports invoice and bill payment services by allowing merchants to raise an invoice in their systems and associate the invoice with a Paylink checkout token. CityPay will co-ordinate the checkout flow in relationship with your customer. Our bill payment solution may be used to streamline the payment flow with cardholders to allow your invoice to be paid promptly and via multiple payment channels such as Card Payment, Apple Pay or Google Pay. The bill payment service allows 1. setting up notification paths to an end customer, such as SMS or Email 2. enabling attachments to be included with Paylink tokens 3. produce chaser notifications for unpaid invoices 4. provide callbacks for notification of the payment of an invoice 5. support part payments against an invoice 6. support of field guards to protect the payment screen 7. support of status reporting on tokens 8. URL short codes for SMS notifications <img src=\"../images/merchant-BPS-workflow.png\" alt=\"Paylink BPSv2 Overview\" width=\"50%\"/> ### Notification Paths Notification paths can be provided which identify the channels for communication of the invoice availability. Up to 3 notification paths may be provided per request. Each notification uses a template to generate the body of the message. This allows for variable text to be sent out and customised for each call. SMS messages use URL Short Codes (USC) as a payment link to the invoice payment page. This allows for a standard payment URL to be shortened for optimised usage in SMS. For instance a URL of `https://checkout.citypay.com/PL1234/s348yb8yna4a48n2f8nq2f3msgyng-psn348ynaw8ynaw/en` becomes `citypay.com/Za48na3x`. Each USC is unique however it is a requirement that each USC generated is protected with Field Guards to ensure that sensitive data (such as customer contact details and GDPR) is protected. To send a notification path, append a `notification-path` property to the request. ```json { \"sms_notification_path\": { \"to\": \"+441534884000\" }, \"email_notification_path\": { \"to\": [\"help-desk@citypay.com\"], \"cc\": [\"third-party@citypay.com\"], \"reply\": [\"help@my-company.com\"] } } ``` Notification paths trigger a number of events which are stored as part of the timeline of events of a Paylink token - `BillPaymentSmsNotificationQueued` - identifies when an SMS notification has been queued for delivery - `BillPaymentSmsNotificationSent` - identifies when an SMS notification has been sent to the upstream network - `BillPaymentSmsNotificationDelivered` - identifies when an SMS notification has been delivered as notified by the upstream network - `BillPaymentSmsNotificationUndelivered` - identifies when an SMS notification has undelivered notification is provided by the upstream network - `BillPaymentSmsNotificationFailure` - identifies when an SMS notification has failed - `BillPaymentEmailNotificationQueued` - identifies when an email notification has been queued for delivery - `BillPaymentEmailNotificationSent` - identifies when an email notification has been accepted by our SMS forwarder - `BillPaymentEmailNotificationFailure` - identifies when an email notification has failed delivery #### SMS Notification Path SMS originated from a CityPay pool of numbers and by default only sends to country codes where the service is registered. SMSs may contain a From field which is configured as part of you onboarding and have a name associated to identify the service origin. For example if your business is titled `Health Surgery Ltd` the SMS may be sent to originate from `Health Surgery`. SMS is also configured for a \"polite mode\". This mode ensures that SMSs aren't sent in the middle of the night when backend services ordinarily run. SMSs will be queued until the time range is deemed as polite. Normally this is between 8am and 9pm. | Field | Type | Usage | Description | |----------|----------|----------|-------------------------------------------------------------------------------------------------| | template | string | Reserved | An optional template name to use a template other than the default. | | to | string | Reserved | The phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format to send the message to. | #### Email Notification Paths | Field | Type | Usage | Description | |----------|----------|----------|-------------------------------------------------------------------------------------------------| | template | string | Reserved | An optional template name to use a template other than the default. | | to | string[] | Required | An array of email addresses to be used for delivery. A maximum of 5 addresses can be added. | | cc | string[] | Required | An array of email addresses to be used for cc delivery. A maximum of 5 addresses can be added. | | bcc | string[] | Required | An array of email addresses to be used for bcc delivery. A maximum of 5 addresses can be added. | | reply_to | string[] | Required | An array of email addresses to be used for the Reply-To header of an email. | ### Field Guards To ensure that invoices are paid by the intended recipient, Paylink supports the addition of Field Guards. A Field Guard is an intended field which is to be used as a form of guarded authentication. More than 1 field can be requested. <img src=\"../images/paylink-field-guards.png\" alt=\"Paylink Field Guards\" width=\"50%\"/> To determine the source value of the field, each field name is searched in the order of - identifier - cardholder data such as name - custom parameters - pass through data If no field values are found, the token request returns a D041 validation error. #### Authentication and Validation When values are entered by the user, resultant comparisons are performed by 1. Transliteration of both the source value and entered value. For example, names with accents (e.g. é will become e) 2. Only Alphanumeric values are retained any whitespace or special characters are ignored 3. Case is ignored Should all values match, the user is authenticated and can continue to the payment form rendered by the Paylink server. On successful login, an event will be added to include that the access guard validated access. #### Access-Key To ensure that a user does not need to re-enter these values multiple times, a cookie is pushed to the user’s browser with an access-key digest value. This value will be presented to the server on each refresh therefore allowing the guard to accept the call. Each value is uniquely stored per merchant account and cannot be shared cross merchant. The lifetime of the cookie is set to 24 hours. #### Brute Force Prevention To prevent multiple calls hitting the server, attempting a brute force attack, the login process 1. is fronted by a contemporary web application firewall 2. creates an event for each token when access was denied 3. should the number of failed events breach more than 5 in 30 minutes, the token is locked for an hour 4. should the number of events breach more than 20 the token is fully locked ### Attachments Attachments can be included in the request in 2 ways 1. Via a data element direct in the request 2. Via a URL upload to a provided pre-signed URL The decision of which option is dependent on the size of the attachments. Should the attachment size be greater than 32kb a URL upload is required. Small attachments can be included in the JSON request. This is to prevent our web firewall from blocking your request and to also ensure efficiency of larger file uploads. There is a maximum of 3 attachments that can be added to a request. ```json [{ \"filename\": \"invoice1.pdf\", \"mime-type\": \"application/pdf\" },{ \"filename\": \"invoice2.pdf\", \"data\": \"b4sE64Enc0dEd...=\", \"mime-type\": \"application/pdf\" }] ``` | Field | Type | Usage | Description | |-----------|--------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------| | filename | string | Required | The name of the attachment normally taken from the filename. You should not include the filename path as appropriate | | data | string | Optional | base64 encoding of the file if less than 32kb in size | | mime-type | string | Required | The mime type of the attachment as defined in [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html). Currently only `application/pdf` is supported | #### Attachment Result A result of an attachment specifies whether the attachment was successfully added or whether a further upload is requried | Field | Type | Usage | Description | |--------|--------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------| | result | string | Required | `OK` should the file have uploaded or `UPLOAD` if the file is required to be uploaded. | | name | string | Required | The filename that was specified in the upload process | | url | string | Optional | Should an upload be required, this URL is available for an upload to be issued. The URL is only available for uploads for 24 hours from creation. |
160
+ # @param paylink_bill_payment_token_request [PaylinkBillPaymentTokenRequest]
161
+ # @param [Hash] opts the optional parameters
162
+ # @return [PaylinkTokenCreated]
163
+ def token_create_bill_payment_request(paylink_bill_payment_token_request, opts = {})
164
+ data, _status_code, _headers = token_create_bill_payment_request_with_http_info(paylink_bill_payment_token_request, opts)
165
+ data
166
+ end
167
+
168
+ # Create Bill Payment Paylink Token
169
+ # CityPay Paylink supports invoice and bill payment services by allowing merchants to raise an invoice in their systems and associate the invoice with a Paylink checkout token. CityPay will co-ordinate the checkout flow in relationship with your customer. Our bill payment solution may be used to streamline the payment flow with cardholders to allow your invoice to be paid promptly and via multiple payment channels such as Card Payment, Apple Pay or Google Pay. The bill payment service allows 1. setting up notification paths to an end customer, such as SMS or Email 2. enabling attachments to be included with Paylink tokens 3. produce chaser notifications for unpaid invoices 4. provide callbacks for notification of the payment of an invoice 5. support part payments against an invoice 6. support of field guards to protect the payment screen 7. support of status reporting on tokens 8. URL short codes for SMS notifications &lt;img src&#x3D;\&quot;../images/merchant-BPS-workflow.png\&quot; alt&#x3D;\&quot;Paylink BPSv2 Overview\&quot; width&#x3D;\&quot;50%\&quot;/&gt; ### Notification Paths Notification paths can be provided which identify the channels for communication of the invoice availability. Up to 3 notification paths may be provided per request. Each notification uses a template to generate the body of the message. This allows for variable text to be sent out and customised for each call. SMS messages use URL Short Codes (USC) as a payment link to the invoice payment page. This allows for a standard payment URL to be shortened for optimised usage in SMS. For instance a URL of &#x60;https://checkout.citypay.com/PL1234/s348yb8yna4a48n2f8nq2f3msgyng-psn348ynaw8ynaw/en&#x60; becomes &#x60;citypay.com/Za48na3x&#x60;. Each USC is unique however it is a requirement that each USC generated is protected with Field Guards to ensure that sensitive data (such as customer contact details and GDPR) is protected. To send a notification path, append a &#x60;notification-path&#x60; property to the request. &#x60;&#x60;&#x60;json { \&quot;sms_notification_path\&quot;: { \&quot;to\&quot;: \&quot;+441534884000\&quot; }, \&quot;email_notification_path\&quot;: { \&quot;to\&quot;: [\&quot;help-desk@citypay.com\&quot;], \&quot;cc\&quot;: [\&quot;third-party@citypay.com\&quot;], \&quot;reply\&quot;: [\&quot;help@my-company.com\&quot;] } } &#x60;&#x60;&#x60; Notification paths trigger a number of events which are stored as part of the timeline of events of a Paylink token - &#x60;BillPaymentSmsNotificationQueued&#x60; - identifies when an SMS notification has been queued for delivery - &#x60;BillPaymentSmsNotificationSent&#x60; - identifies when an SMS notification has been sent to the upstream network - &#x60;BillPaymentSmsNotificationDelivered&#x60; - identifies when an SMS notification has been delivered as notified by the upstream network - &#x60;BillPaymentSmsNotificationUndelivered&#x60; - identifies when an SMS notification has undelivered notification is provided by the upstream network - &#x60;BillPaymentSmsNotificationFailure&#x60; - identifies when an SMS notification has failed - &#x60;BillPaymentEmailNotificationQueued&#x60; - identifies when an email notification has been queued for delivery - &#x60;BillPaymentEmailNotificationSent&#x60; - identifies when an email notification has been accepted by our SMS forwarder - &#x60;BillPaymentEmailNotificationFailure&#x60; - identifies when an email notification has failed delivery #### SMS Notification Path SMS originated from a CityPay pool of numbers and by default only sends to country codes where the service is registered. SMSs may contain a From field which is configured as part of you onboarding and have a name associated to identify the service origin. For example if your business is titled &#x60;Health Surgery Ltd&#x60; the SMS may be sent to originate from &#x60;Health Surgery&#x60;. SMS is also configured for a \&quot;polite mode\&quot;. This mode ensures that SMSs aren&#39;t sent in the middle of the night when backend services ordinarily run. SMSs will be queued until the time range is deemed as polite. Normally this is between 8am and 9pm. | Field | Type | Usage | Description | |----------|----------|----------|-------------------------------------------------------------------------------------------------| | template | string | Reserved | An optional template name to use a template other than the default. | | to | string | Reserved | The phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format to send the message to. | #### Email Notification Paths | Field | Type | Usage | Description | |----------|----------|----------|-------------------------------------------------------------------------------------------------| | template | string | Reserved | An optional template name to use a template other than the default. | | to | string[] | Required | An array of email addresses to be used for delivery. A maximum of 5 addresses can be added. | | cc | string[] | Required | An array of email addresses to be used for cc delivery. A maximum of 5 addresses can be added. | | bcc | string[] | Required | An array of email addresses to be used for bcc delivery. A maximum of 5 addresses can be added. | | reply_to | string[] | Required | An array of email addresses to be used for the Reply-To header of an email. | ### Field Guards To ensure that invoices are paid by the intended recipient, Paylink supports the addition of Field Guards. A Field Guard is an intended field which is to be used as a form of guarded authentication. More than 1 field can be requested. &lt;img src&#x3D;\&quot;../images/paylink-field-guards.png\&quot; alt&#x3D;\&quot;Paylink Field Guards\&quot; width&#x3D;\&quot;50%\&quot;/&gt; To determine the source value of the field, each field name is searched in the order of - identifier - cardholder data such as name - custom parameters - pass through data If no field values are found, the token request returns a D041 validation error. #### Authentication and Validation When values are entered by the user, resultant comparisons are performed by 1. Transliteration of both the source value and entered value. For example, names with accents (e.g. é will become e) 2. Only Alphanumeric values are retained any whitespace or special characters are ignored 3. Case is ignored Should all values match, the user is authenticated and can continue to the payment form rendered by the Paylink server. On successful login, an event will be added to include that the access guard validated access. #### Access-Key To ensure that a user does not need to re-enter these values multiple times, a cookie is pushed to the user’s browser with an access-key digest value. This value will be presented to the server on each refresh therefore allowing the guard to accept the call. Each value is uniquely stored per merchant account and cannot be shared cross merchant. The lifetime of the cookie is set to 24 hours. #### Brute Force Prevention To prevent multiple calls hitting the server, attempting a brute force attack, the login process 1. is fronted by a contemporary web application firewall 2. creates an event for each token when access was denied 3. should the number of failed events breach more than 5 in 30 minutes, the token is locked for an hour 4. should the number of events breach more than 20 the token is fully locked ### Attachments Attachments can be included in the request in 2 ways 1. Via a data element direct in the request 2. Via a URL upload to a provided pre-signed URL The decision of which option is dependent on the size of the attachments. Should the attachment size be greater than 32kb a URL upload is required. Small attachments can be included in the JSON request. This is to prevent our web firewall from blocking your request and to also ensure efficiency of larger file uploads. There is a maximum of 3 attachments that can be added to a request. &#x60;&#x60;&#x60;json [{ \&quot;filename\&quot;: \&quot;invoice1.pdf\&quot;, \&quot;mime-type\&quot;: \&quot;application/pdf\&quot; },{ \&quot;filename\&quot;: \&quot;invoice2.pdf\&quot;, \&quot;data\&quot;: \&quot;b4sE64Enc0dEd...&#x3D;\&quot;, \&quot;mime-type\&quot;: \&quot;application/pdf\&quot; }] &#x60;&#x60;&#x60; | Field | Type | Usage | Description | |-----------|--------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------| | filename | string | Required | The name of the attachment normally taken from the filename. You should not include the filename path as appropriate | | data | string | Optional | base64 encoding of the file if less than 32kb in size | | mime-type | string | Required | The mime type of the attachment as defined in [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html). Currently only &#x60;application/pdf&#x60; is supported | #### Attachment Result A result of an attachment specifies whether the attachment was successfully added or whether a further upload is requried | Field | Type | Usage | Description | |--------|--------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------| | result | string | Required | &#x60;OK&#x60; should the file have uploaded or &#x60;UPLOAD&#x60; if the file is required to be uploaded. | | name | string | Required | The filename that was specified in the upload process | | url | string | Optional | Should an upload be required, this URL is available for an upload to be issued. The URL is only available for uploads for 24 hours from creation. |
170
+ # @param paylink_bill_payment_token_request [PaylinkBillPaymentTokenRequest]
171
+ # @param [Hash] opts the optional parameters
172
+ # @return [Array<(PaylinkTokenCreated, Integer, Hash)>] PaylinkTokenCreated data, response status code and response headers
173
+ def token_create_bill_payment_request_with_http_info(paylink_bill_payment_token_request, opts = {})
174
+ if @api_client.config.debugging
175
+ @api_client.config.logger.debug 'Calling API: PaylinkApi.token_create_bill_payment_request ...'
176
+ end
177
+ # verify the required parameter 'paylink_bill_payment_token_request' is set
178
+ if @api_client.config.client_side_validation && paylink_bill_payment_token_request.nil?
179
+ fail ArgumentError, "Missing the required parameter 'paylink_bill_payment_token_request' when calling PaylinkApi.token_create_bill_payment_request"
180
+ end
181
+ # resource path
182
+ local_var_path = '/paylink/bill-payment'
183
+
184
+ # query parameters
185
+ query_params = opts[:query_params] || {}
186
+
187
+ # header parameters
188
+ header_params = opts[:header_params] || {}
189
+ # HTTP header 'Accept' (if needed)
190
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
191
+ # HTTP header 'Content-Type'
192
+ content_type = @api_client.select_header_content_type(['application/json', 'text/xml'])
193
+ if !content_type.nil?
194
+ header_params['Content-Type'] = content_type
195
+ end
196
+
197
+ # form parameters
198
+ form_params = opts[:form_params] || {}
199
+
200
+ # http body (model)
201
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(paylink_bill_payment_token_request)
202
+
203
+ # return_type
204
+ return_type = opts[:debug_return_type] || 'PaylinkTokenCreated'
205
+
206
+ # auth_names
207
+ auth_names = opts[:debug_auth_names] || ['cp-api-key']
208
+
209
+ new_options = opts.merge(
210
+ :operation => :"PaylinkApi.token_create_bill_payment_request",
211
+ :header_params => header_params,
212
+ :query_params => query_params,
213
+ :form_params => form_params,
214
+ :body => post_body,
215
+ :auth_names => auth_names,
216
+ :return_type => return_type
217
+ )
218
+
219
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
220
+ if @api_client.config.debugging
221
+ @api_client.config.logger.debug "API called: PaylinkApi#token_create_bill_payment_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
222
+ end
223
+ return data, status_code, headers
224
+ end
225
+
226
+ # Create Paylink Token
227
+ # Creates a Paylink token from the CityPay API.
228
+ # @param paylink_token_request_model [PaylinkTokenRequestModel]
229
+ # @param [Hash] opts the optional parameters
230
+ # @return [PaylinkTokenCreated]
231
+ def token_create_request(paylink_token_request_model, opts = {})
232
+ data, _status_code, _headers = token_create_request_with_http_info(paylink_token_request_model, opts)
233
+ data
234
+ end
235
+
236
+ # Create Paylink Token
237
+ # Creates a Paylink token from the CityPay API.
238
+ # @param paylink_token_request_model [PaylinkTokenRequestModel]
239
+ # @param [Hash] opts the optional parameters
240
+ # @return [Array<(PaylinkTokenCreated, Integer, Hash)>] PaylinkTokenCreated data, response status code and response headers
241
+ def token_create_request_with_http_info(paylink_token_request_model, opts = {})
242
+ if @api_client.config.debugging
243
+ @api_client.config.logger.debug 'Calling API: PaylinkApi.token_create_request ...'
244
+ end
245
+ # verify the required parameter 'paylink_token_request_model' is set
246
+ if @api_client.config.client_side_validation && paylink_token_request_model.nil?
247
+ fail ArgumentError, "Missing the required parameter 'paylink_token_request_model' when calling PaylinkApi.token_create_request"
248
+ end
249
+ # resource path
250
+ local_var_path = '/paylink/create'
251
+
252
+ # query parameters
253
+ query_params = opts[:query_params] || {}
254
+
255
+ # header parameters
256
+ header_params = opts[:header_params] || {}
257
+ # HTTP header 'Accept' (if needed)
258
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
259
+ # HTTP header 'Content-Type'
260
+ content_type = @api_client.select_header_content_type(['application/json', 'text/xml'])
261
+ if !content_type.nil?
262
+ header_params['Content-Type'] = content_type
263
+ end
264
+
265
+ # form parameters
266
+ form_params = opts[:form_params] || {}
267
+
268
+ # http body (model)
269
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(paylink_token_request_model)
270
+
271
+ # return_type
272
+ return_type = opts[:debug_return_type] || 'PaylinkTokenCreated'
273
+
274
+ # auth_names
275
+ auth_names = opts[:debug_auth_names] || ['cp-api-key']
276
+
277
+ new_options = opts.merge(
278
+ :operation => :"PaylinkApi.token_create_request",
279
+ :header_params => header_params,
280
+ :query_params => query_params,
281
+ :form_params => form_params,
282
+ :body => post_body,
283
+ :auth_names => auth_names,
284
+ :return_type => return_type
285
+ )
286
+
287
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
288
+ if @api_client.config.debugging
289
+ @api_client.config.logger.debug "API called: PaylinkApi#token_create_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
290
+ end
291
+ return data, status_code, headers
292
+ end
293
+
294
+ # Purges any attachments for a Paylink Token
295
+ # Purges any attachments for a token for GDPR or DP reasons.
296
+ # @param token [String] The token returned by the create token process.
297
+ # @param [Hash] opts the optional parameters
298
+ # @return [Acknowledgement]
299
+ def token_purge_attachments_request(token, opts = {})
300
+ data, _status_code, _headers = token_purge_attachments_request_with_http_info(token, opts)
301
+ data
302
+ end
303
+
304
+ # Purges any attachments for a Paylink Token
305
+ # Purges any attachments for a token for GDPR or DP reasons.
306
+ # @param token [String] The token returned by the create token process.
307
+ # @param [Hash] opts the optional parameters
308
+ # @return [Array<(Acknowledgement, Integer, Hash)>] Acknowledgement data, response status code and response headers
309
+ def token_purge_attachments_request_with_http_info(token, opts = {})
310
+ if @api_client.config.debugging
311
+ @api_client.config.logger.debug 'Calling API: PaylinkApi.token_purge_attachments_request ...'
312
+ end
313
+ # verify the required parameter 'token' is set
314
+ if @api_client.config.client_side_validation && token.nil?
315
+ fail ArgumentError, "Missing the required parameter 'token' when calling PaylinkApi.token_purge_attachments_request"
316
+ end
317
+ # resource path
318
+ local_var_path = '/paylink/{token}/purge-attachments'.sub('{' + 'token' + '}', CGI.escape(token.to_s))
319
+
320
+ # query parameters
321
+ query_params = opts[:query_params] || {}
322
+
323
+ # header parameters
324
+ header_params = opts[:header_params] || {}
325
+ # HTTP header 'Accept' (if needed)
326
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
327
+
328
+ # form parameters
329
+ form_params = opts[:form_params] || {}
330
+
331
+ # http body (model)
332
+ post_body = opts[:debug_body]
333
+
334
+ # return_type
335
+ return_type = opts[:debug_return_type] || 'Acknowledgement'
336
+
337
+ # auth_names
338
+ auth_names = opts[:debug_auth_names] || ['cp-api-key']
339
+
340
+ new_options = opts.merge(
341
+ :operation => :"PaylinkApi.token_purge_attachments_request",
342
+ :header_params => header_params,
343
+ :query_params => query_params,
344
+ :form_params => form_params,
345
+ :body => post_body,
346
+ :auth_names => auth_names,
347
+ :return_type => return_type
348
+ )
349
+
350
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
351
+ if @api_client.config.debugging
352
+ @api_client.config.logger.debug "API called: PaylinkApi#token_purge_attachments_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
353
+ end
354
+ return data, status_code, headers
355
+ end
356
+
357
+ # Reconcile Paylink Token
358
+ # Marks a Paylink Token as reconciled when reconcilation is performed on the merchant's side.
359
+ # @param token [String] The token returned by the create token process.
360
+ # @param [Hash] opts the optional parameters
361
+ # @return [Acknowledgement]
362
+ def token_reconciled_request(token, opts = {})
363
+ data, _status_code, _headers = token_reconciled_request_with_http_info(token, opts)
364
+ data
365
+ end
366
+
367
+ # Reconcile Paylink Token
368
+ # Marks a Paylink Token as reconciled when reconcilation is performed on the merchant&#39;s side.
369
+ # @param token [String] The token returned by the create token process.
370
+ # @param [Hash] opts the optional parameters
371
+ # @return [Array<(Acknowledgement, Integer, Hash)>] Acknowledgement data, response status code and response headers
372
+ def token_reconciled_request_with_http_info(token, opts = {})
373
+ if @api_client.config.debugging
374
+ @api_client.config.logger.debug 'Calling API: PaylinkApi.token_reconciled_request ...'
375
+ end
376
+ # verify the required parameter 'token' is set
377
+ if @api_client.config.client_side_validation && token.nil?
378
+ fail ArgumentError, "Missing the required parameter 'token' when calling PaylinkApi.token_reconciled_request"
379
+ end
380
+ # resource path
381
+ local_var_path = '/paylink/{token}/reconciled'.sub('{' + 'token' + '}', CGI.escape(token.to_s))
382
+
383
+ # query parameters
384
+ query_params = opts[:query_params] || {}
385
+
386
+ # header parameters
387
+ header_params = opts[:header_params] || {}
388
+ # HTTP header 'Accept' (if needed)
389
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
390
+
391
+ # form parameters
392
+ form_params = opts[:form_params] || {}
393
+
394
+ # http body (model)
395
+ post_body = opts[:debug_body]
396
+
397
+ # return_type
398
+ return_type = opts[:debug_return_type] || 'Acknowledgement'
399
+
400
+ # auth_names
401
+ auth_names = opts[:debug_auth_names] || ['cp-api-key']
402
+
403
+ new_options = opts.merge(
404
+ :operation => :"PaylinkApi.token_reconciled_request",
405
+ :header_params => header_params,
406
+ :query_params => query_params,
407
+ :form_params => form_params,
408
+ :body => post_body,
409
+ :auth_names => auth_names,
410
+ :return_type => return_type
411
+ )
412
+
413
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
414
+ if @api_client.config.debugging
415
+ @api_client.config.logger.debug "API called: PaylinkApi#token_reconciled_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
416
+ end
417
+ return data, status_code, headers
418
+ end
419
+
420
+ # Reopen Paylink Token
421
+ # Allows for a Paylink Token to be reopened if a Token has been previously closed and payment has not yet been made.
422
+ # @param token [String] The token returned by the create token process.
423
+ # @param [Hash] opts the optional parameters
424
+ # @return [Acknowledgement]
425
+ def token_reopen_request(token, opts = {})
426
+ data, _status_code, _headers = token_reopen_request_with_http_info(token, opts)
427
+ data
428
+ end
429
+
430
+ # Reopen Paylink Token
431
+ # Allows for a Paylink Token to be reopened if a Token has been previously closed and payment has not yet been made.
432
+ # @param token [String] The token returned by the create token process.
433
+ # @param [Hash] opts the optional parameters
434
+ # @return [Array<(Acknowledgement, Integer, Hash)>] Acknowledgement data, response status code and response headers
435
+ def token_reopen_request_with_http_info(token, opts = {})
436
+ if @api_client.config.debugging
437
+ @api_client.config.logger.debug 'Calling API: PaylinkApi.token_reopen_request ...'
438
+ end
439
+ # verify the required parameter 'token' is set
440
+ if @api_client.config.client_side_validation && token.nil?
441
+ fail ArgumentError, "Missing the required parameter 'token' when calling PaylinkApi.token_reopen_request"
442
+ end
443
+ # resource path
444
+ local_var_path = '/paylink/{token}/reopen'.sub('{' + 'token' + '}', CGI.escape(token.to_s))
445
+
446
+ # query parameters
447
+ query_params = opts[:query_params] || {}
448
+
449
+ # header parameters
450
+ header_params = opts[:header_params] || {}
451
+ # HTTP header 'Accept' (if needed)
452
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
453
+
454
+ # form parameters
455
+ form_params = opts[:form_params] || {}
456
+
457
+ # http body (model)
458
+ post_body = opts[:debug_body]
459
+
460
+ # return_type
461
+ return_type = opts[:debug_return_type] || 'Acknowledgement'
462
+
463
+ # auth_names
464
+ auth_names = opts[:debug_auth_names] || ['cp-api-key']
465
+
466
+ new_options = opts.merge(
467
+ :operation => :"PaylinkApi.token_reopen_request",
468
+ :header_params => header_params,
469
+ :query_params => query_params,
470
+ :form_params => form_params,
471
+ :body => post_body,
472
+ :auth_names => auth_names,
473
+ :return_type => return_type
474
+ )
475
+
476
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
477
+ if @api_client.config.debugging
478
+ @api_client.config.logger.debug "API called: PaylinkApi#token_reopen_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
479
+ end
480
+ return data, status_code, headers
481
+ end
482
+
483
+ # Paylink Token Audit
484
+ # Obtains any changes on Paylink Tokens since a given date and time. This allows for a merchant to regularly check on activity over a collection of Paylink Tokens and to check on any events that may have occurred. If a Token is `Closed` it is not considered. Only statuses that have been appended since the given date and time is returned.
485
+ # @param paylink_token_status_change_request [PaylinkTokenStatusChangeRequest]
486
+ # @param [Hash] opts the optional parameters
487
+ # @return [PaylinkTokenStatusChangeResponse]
488
+ def token_status_changes_request(paylink_token_status_change_request, opts = {})
489
+ data, _status_code, _headers = token_status_changes_request_with_http_info(paylink_token_status_change_request, opts)
490
+ data
491
+ end
492
+
493
+ # Paylink Token Audit
494
+ # Obtains any changes on Paylink Tokens since a given date and time. This allows for a merchant to regularly check on activity over a collection of Paylink Tokens and to check on any events that may have occurred. If a Token is &#x60;Closed&#x60; it is not considered. Only statuses that have been appended since the given date and time is returned.
495
+ # @param paylink_token_status_change_request [PaylinkTokenStatusChangeRequest]
496
+ # @param [Hash] opts the optional parameters
497
+ # @return [Array<(PaylinkTokenStatusChangeResponse, Integer, Hash)>] PaylinkTokenStatusChangeResponse data, response status code and response headers
498
+ def token_status_changes_request_with_http_info(paylink_token_status_change_request, opts = {})
499
+ if @api_client.config.debugging
500
+ @api_client.config.logger.debug 'Calling API: PaylinkApi.token_status_changes_request ...'
501
+ end
502
+ # verify the required parameter 'paylink_token_status_change_request' is set
503
+ if @api_client.config.client_side_validation && paylink_token_status_change_request.nil?
504
+ fail ArgumentError, "Missing the required parameter 'paylink_token_status_change_request' when calling PaylinkApi.token_status_changes_request"
505
+ end
506
+ # resource path
507
+ local_var_path = '/paylink/token/changes'
508
+
509
+ # query parameters
510
+ query_params = opts[:query_params] || {}
511
+
512
+ # header parameters
513
+ header_params = opts[:header_params] || {}
514
+ # HTTP header 'Accept' (if needed)
515
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
516
+ # HTTP header 'Content-Type'
517
+ content_type = @api_client.select_header_content_type(['application/json', 'text/xml'])
518
+ if !content_type.nil?
519
+ header_params['Content-Type'] = content_type
520
+ end
521
+
522
+ # form parameters
523
+ form_params = opts[:form_params] || {}
524
+
525
+ # http body (model)
526
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(paylink_token_status_change_request)
527
+
528
+ # return_type
529
+ return_type = opts[:debug_return_type] || 'PaylinkTokenStatusChangeResponse'
530
+
531
+ # auth_names
532
+ auth_names = opts[:debug_auth_names] || ['cp-api-key']
533
+
534
+ new_options = opts.merge(
535
+ :operation => :"PaylinkApi.token_status_changes_request",
536
+ :header_params => header_params,
537
+ :query_params => query_params,
538
+ :form_params => form_params,
539
+ :body => post_body,
540
+ :auth_names => auth_names,
541
+ :return_type => return_type
542
+ )
543
+
544
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
545
+ if @api_client.config.debugging
546
+ @api_client.config.logger.debug "API called: PaylinkApi#token_status_changes_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
547
+ end
548
+ return data, status_code, headers
549
+ end
550
+
551
+ # Paylink Token Status
552
+ # Obtains the full status of a given Paylink Token.
553
+ # @param token [String] The token returned by the create token process.
554
+ # @param [Hash] opts the optional parameters
555
+ # @return [PaylinkTokenStatus]
556
+ def token_status_request(token, opts = {})
557
+ data, _status_code, _headers = token_status_request_with_http_info(token, opts)
558
+ data
559
+ end
560
+
561
+ # Paylink Token Status
562
+ # Obtains the full status of a given Paylink Token.
563
+ # @param token [String] The token returned by the create token process.
564
+ # @param [Hash] opts the optional parameters
565
+ # @return [Array<(PaylinkTokenStatus, Integer, Hash)>] PaylinkTokenStatus data, response status code and response headers
566
+ def token_status_request_with_http_info(token, opts = {})
567
+ if @api_client.config.debugging
568
+ @api_client.config.logger.debug 'Calling API: PaylinkApi.token_status_request ...'
569
+ end
570
+ # verify the required parameter 'token' is set
571
+ if @api_client.config.client_side_validation && token.nil?
572
+ fail ArgumentError, "Missing the required parameter 'token' when calling PaylinkApi.token_status_request"
573
+ end
574
+ # resource path
575
+ local_var_path = '/paylink/{token}/status'.sub('{' + 'token' + '}', CGI.escape(token.to_s))
576
+
577
+ # query parameters
578
+ query_params = opts[:query_params] || {}
579
+
580
+ # header parameters
581
+ header_params = opts[:header_params] || {}
582
+ # HTTP header 'Accept' (if needed)
583
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
584
+
585
+ # form parameters
586
+ form_params = opts[:form_params] || {}
587
+
588
+ # http body (model)
589
+ post_body = opts[:debug_body]
590
+
591
+ # return_type
592
+ return_type = opts[:debug_return_type] || 'PaylinkTokenStatus'
593
+
594
+ # auth_names
595
+ auth_names = opts[:debug_auth_names] || ['cp-api-key']
596
+
597
+ new_options = opts.merge(
598
+ :operation => :"PaylinkApi.token_status_request",
599
+ :header_params => header_params,
600
+ :query_params => query_params,
601
+ :form_params => form_params,
602
+ :body => post_body,
603
+ :auth_names => auth_names,
604
+ :return_type => return_type
605
+ )
606
+
607
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
608
+ if @api_client.config.debugging
609
+ @api_client.config.logger.debug "API called: PaylinkApi#token_status_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
610
+ end
611
+ return data, status_code, headers
612
+ end
613
+ end
614
+ end