citypay_api_client 1.1.1 → 1.1.2
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.
- checksums.yaml +4 -4
- data/README.md +15 -14
- data/citypay_api_client.gemspec +4 -3
- data/docs/AirlineAdvice.md +1 -1
- data/docs/AuthRequest.md +3 -1
- data/docs/AuthResponse.md +5 -1
- data/docs/AuthorisationAndPaymentApi.md +300 -9
- data/docs/BatchProcessingApi.md +15 -11
- data/docs/BatchTransactionResultModel.md +5 -1
- data/docs/Card.md +1 -1
- data/docs/CardHolderAccountApi.md +64 -9
- data/docs/ChargeRequest.md +2 -0
- data/docs/ContactDetails.md +11 -11
- data/docs/DirectPostApi.md +40 -16
- data/docs/DirectPostRequest.md +3 -1
- data/docs/OperationalFunctionsApi.md +28 -8
- data/docs/PaylinkApi.md +249 -73
- data/docs/PaylinkCustomParam.md +3 -1
- data/docs/PaylinkFieldGuardModel.md +1 -1
- data/docs/PaylinkTokenRequestModel.md +4 -0
- data/docs/RegisterCard.md +1 -1
- data/docs/ThreeDSecure.md +1 -1
- data/docs/TokenisationResponseModel.md +2 -2
- data/docs/images/3dsv1-challenge.png +0 -0
- data/docs/images/3dsv2-challenge.png +0 -0
- data/docs/images/3dsv2-frictionless.png +0 -0
- data/docs/images/3dsv2-method-challenge.png +0 -0
- data/docs/images/3dsv2-method-frictionless.png +0 -0
- data/docs/images/3dsv2-no3d.png +0 -0
- data/docs/images/citypay-logo.svg +1 -0
- data/docs/images/direct-post-flow.png +0 -0
- data/docs/images/favicon.ico +0 -0
- data/docs/images/header.png +0 -0
- data/docs/images/logo.ai +1913 -4
- data/docs/images/logo.png +0 -0
- data/docs/images/logo.svg +1 -0
- data/docs/images/merchant-BPS-workflow.png +0 -0
- data/docs/images/paylink-field-guards.png +0 -0
- data/lib/.DS_Store +0 -0
- data/lib/citypay_api_client/api/authorisation_and_payment_api__.rb +4 -4
- data/lib/citypay_api_client/api/batch_processing_api__.rb +11 -11
- data/lib/citypay_api_client/api/card_holder_account_api__.rb +2 -2
- data/lib/citypay_api_client/api/direct_post_api__.rb +5 -5
- data/lib/citypay_api_client/api/operational_functions_api__.rb +3 -3
- data/lib/citypay_api_client/api/paylink_api__.rb +74 -74
- data/lib/citypay_api_client/api_client.rb +24 -22
- data/lib/citypay_api_client/api_error.rb +3 -2
- data/lib/citypay_api_client/configuration.rb +28 -9
- data/lib/citypay_api_client/models/account_create.rb +17 -20
- data/lib/citypay_api_client/models/account_status.rb +15 -20
- data/lib/citypay_api_client/models/acknowledgement.rb +27 -24
- data/lib/citypay_api_client/models/acl_check_request.rb +17 -20
- data/lib/citypay_api_client/models/acl_check_response_model.rb +15 -20
- data/lib/citypay_api_client/models/airline_advice.rb +45 -29
- data/lib/citypay_api_client/models/airline_segment.rb +35 -22
- data/lib/citypay_api_client/models/auth_reference.rb +41 -26
- data/lib/citypay_api_client/models/auth_references.rb +15 -20
- data/lib/citypay_api_client/models/auth_request.rb +66 -29
- data/lib/citypay_api_client/models/auth_response.rb +45 -22
- data/lib/citypay_api_client/models/authen_required.rb +15 -20
- data/lib/citypay_api_client/models/batch.rb +24 -21
- data/lib/citypay_api_client/models/batch_report_request.rb +23 -22
- data/lib/citypay_api_client/models/batch_report_response_model.rb +27 -20
- data/lib/citypay_api_client/models/batch_transaction.rb +25 -22
- data/lib/citypay_api_client/models/batch_transaction_result_model.rb +53 -22
- data/lib/citypay_api_client/models/bin.rb +15 -20
- data/lib/citypay_api_client/models/bin_lookup.rb +17 -20
- data/lib/citypay_api_client/models/c_res_auth_request.rb +15 -20
- data/lib/citypay_api_client/models/capture_request.rb +27 -22
- data/lib/citypay_api_client/models/card.rb +33 -26
- data/lib/citypay_api_client/models/card_holder_account.rb +19 -20
- data/lib/citypay_api_client/models/card_status.rb +15 -20
- data/lib/citypay_api_client/models/charge_request.rb +66 -29
- data/lib/citypay_api_client/models/check_batch_status.rb +23 -22
- data/lib/citypay_api_client/models/check_batch_status_response.rb +15 -20
- data/lib/citypay_api_client/models/contact_details.rb +77 -42
- data/lib/citypay_api_client/models/decision.rb +15 -20
- data/lib/citypay_api_client/models/direct_post_request.rb +66 -29
- data/lib/citypay_api_client/models/direct_token_auth_request.rb +15 -20
- data/lib/citypay_api_client/models/domain_key_check_request.rb +17 -20
- data/lib/citypay_api_client/models/domain_key_request.rb +19 -20
- data/lib/citypay_api_client/models/domain_key_response.rb +25 -22
- data/lib/citypay_api_client/models/error.rb +27 -24
- data/lib/citypay_api_client/models/event_data_model.rb +15 -20
- data/lib/citypay_api_client/models/exists.rb +17 -20
- data/lib/citypay_api_client/models/external_mpi.rb +39 -24
- data/lib/citypay_api_client/models/list_merchants_response.rb +21 -22
- data/lib/citypay_api_client/models/mcc6012.rb +15 -20
- data/lib/citypay_api_client/models/merchant.rb +15 -20
- data/lib/citypay_api_client/models/pa_res_auth_request.rb +19 -20
- data/lib/citypay_api_client/models/paylink_address.rb +52 -29
- data/lib/citypay_api_client/models/paylink_adjustment_request.rb +25 -22
- data/lib/citypay_api_client/models/paylink_attachment_request.rb +19 -20
- data/lib/citypay_api_client/models/paylink_attachment_result.rb +19 -20
- data/lib/citypay_api_client/models/paylink_bill_payment_token_request.rb +17 -20
- data/lib/citypay_api_client/models/paylink_card_holder.rb +30 -23
- data/lib/citypay_api_client/models/paylink_cart.rb +15 -20
- data/lib/citypay_api_client/models/paylink_cart_item_model.rb +15 -20
- data/lib/citypay_api_client/models/paylink_config.rb +15 -20
- data/lib/citypay_api_client/models/paylink_custom_param.rb +29 -22
- data/lib/citypay_api_client/models/paylink_email_notification_path.rb +17 -20
- data/lib/citypay_api_client/models/paylink_error_code.rb +19 -20
- data/lib/citypay_api_client/models/paylink_field_guard_model.rb +16 -21
- data/lib/citypay_api_client/models/paylink_part_payments.rb +15 -20
- data/lib/citypay_api_client/models/paylink_sms_notification_path.rb +17 -20
- data/lib/citypay_api_client/models/paylink_state_event.rb +15 -20
- data/lib/citypay_api_client/models/paylink_token_created.rb +21 -20
- data/lib/citypay_api_client/models/paylink_token_request_model.rb +75 -22
- data/lib/citypay_api_client/models/paylink_token_status.rb +15 -20
- data/lib/citypay_api_client/models/paylink_token_status_change_request.rb +19 -20
- data/lib/citypay_api_client/models/paylink_token_status_change_response.rb +17 -20
- data/lib/citypay_api_client/models/paylink_ui.rb +15 -20
- data/lib/citypay_api_client/models/ping.rb +21 -22
- data/lib/citypay_api_client/models/process_batch_request.rb +27 -22
- data/lib/citypay_api_client/models/process_batch_response.rb +17 -20
- data/lib/citypay_api_client/models/refund_request.rb +28 -21
- data/lib/citypay_api_client/models/register_card.rb +27 -22
- data/lib/citypay_api_client/models/request_challenged.rb +15 -20
- data/lib/citypay_api_client/models/retrieve_request.rb +23 -22
- data/lib/citypay_api_client/models/three_d_secure.rb +16 -21
- data/lib/citypay_api_client/models/tokenisation_response_model.rb +23 -24
- data/lib/citypay_api_client/models/void_request.rb +23 -22
- data/lib/citypay_api_client/version.rb +3 -3
- data/lib/citypay_api_client.rb +2 -2
- data/spec/.DS_Store +0 -0
- data/spec/it_api_sandbox_spec.rb +5 -11
- data/spec/models/account_create_spec.rb +1 -2
- data/spec/models/account_status_spec.rb +2 -2
- data/spec/models/airline_advice_spec.rb +0 -2
- data/spec/models/airline_segment_spec.rb +0 -2
- data/spec/models/auth_request_spec.rb +0 -2
- data/spec/models/auth_response_spec.rb +75 -30
- data/spec/models/batch_report_request_spec.rb +0 -2
- data/spec/models/batch_report_response_model_spec.rb +0 -2
- data/spec/models/batch_spec.rb +0 -2
- data/spec/models/batch_transaction_result_model_spec.rb +0 -2
- data/spec/models/batch_transaction_spec.rb +0 -2
- data/spec/models/bin_lookup_spec.rb +0 -2
- data/spec/models/capture_request_spec.rb +0 -2
- data/spec/models/card_holder_account_spec.rb +0 -2
- data/spec/models/charge_request_spec.rb +0 -2
- data/spec/models/direct_post_request_spec.rb +0 -2
- data/spec/models/domain_key_check_request_spec.rb +0 -2
- data/spec/models/paylink_token_request_model_spec.rb +0 -2
- data/spec/models/process_batch_request_spec.rb +0 -2
- data/spec/models/refund_request_spec.rb +0 -2
- data/spec/models/register_card_spec.rb +0 -2
- data/spec/spec_helper.rb +2 -2
- metadata +25 -12
- data/docs/OperationalApi.md +0 -214
- data/docs/PaymentProcessingApi.md +0 -559
@@ -1,11 +1,11 @@
|
|
1
1
|
=begin
|
2
2
|
#CityPay Payment API
|
3
3
|
|
4
|
-
# This CityPay API is
|
4
|
+
# This CityPay API is an 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 tokenized payments using cardholder 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](https://citypay.github.io/api-docs/payment-api/#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 cardholder 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
5
|
|
6
6
|
Contact: support@citypay.com
|
7
7
|
Generated by: https://openapi-generator.tech
|
8
|
-
OpenAPI Generator version:
|
8
|
+
OpenAPI Generator version: 7.2.0
|
9
9
|
|
10
10
|
=end
|
11
11
|
|
@@ -92,6 +92,74 @@ module CityPayApiClient
|
|
92
92
|
return data, status_code, headers
|
93
93
|
end
|
94
94
|
|
95
|
+
# Paylink Token Audit
|
96
|
+
# Allows for the changes to a pre-existing token.
|
97
|
+
# @param paylink_token_status_change_request [PaylinkTokenStatusChangeRequest]
|
98
|
+
# @param [Hash] opts the optional parameters
|
99
|
+
# @return [PaylinkTokenStatusChangeResponse]
|
100
|
+
def token_changes_request(paylink_token_status_change_request, opts = {})
|
101
|
+
data, _status_code, _headers = token_changes_request_with_http_info(paylink_token_status_change_request, opts)
|
102
|
+
data
|
103
|
+
end
|
104
|
+
|
105
|
+
# Paylink Token Audit
|
106
|
+
# Allows for the changes to a pre-existing token.
|
107
|
+
# @param paylink_token_status_change_request [PaylinkTokenStatusChangeRequest]
|
108
|
+
# @param [Hash] opts the optional parameters
|
109
|
+
# @return [Array<(PaylinkTokenStatusChangeResponse, Integer, Hash)>] PaylinkTokenStatusChangeResponse data, response status code and response headers
|
110
|
+
def token_changes_request_with_http_info(paylink_token_status_change_request, opts = {})
|
111
|
+
if @api_client.config.debugging
|
112
|
+
@api_client.config.logger.debug 'Calling API: PaylinkApi.token_changes_request ...'
|
113
|
+
end
|
114
|
+
# verify the required parameter 'paylink_token_status_change_request' is set
|
115
|
+
if @api_client.config.client_side_validation && paylink_token_status_change_request.nil?
|
116
|
+
fail ArgumentError, "Missing the required parameter 'paylink_token_status_change_request' when calling PaylinkApi.token_changes_request"
|
117
|
+
end
|
118
|
+
# resource path
|
119
|
+
local_var_path = '/paylink/token/changes'
|
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
|
+
# HTTP header 'Content-Type'
|
129
|
+
content_type = @api_client.select_header_content_type(['application/json', 'text/xml'])
|
130
|
+
if !content_type.nil?
|
131
|
+
header_params['Content-Type'] = content_type
|
132
|
+
end
|
133
|
+
|
134
|
+
# form parameters
|
135
|
+
form_params = opts[:form_params] || {}
|
136
|
+
|
137
|
+
# http body (model)
|
138
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(paylink_token_status_change_request)
|
139
|
+
|
140
|
+
# return_type
|
141
|
+
return_type = opts[:debug_return_type] || 'PaylinkTokenStatusChangeResponse'
|
142
|
+
|
143
|
+
# auth_names
|
144
|
+
auth_names = opts[:debug_auth_names] || ['cp-api-key']
|
145
|
+
|
146
|
+
new_options = opts.merge(
|
147
|
+
:operation => :"PaylinkApi.token_changes_request",
|
148
|
+
:header_params => header_params,
|
149
|
+
:query_params => query_params,
|
150
|
+
:form_params => form_params,
|
151
|
+
:body => post_body,
|
152
|
+
:auth_names => auth_names,
|
153
|
+
:return_type => return_type
|
154
|
+
)
|
155
|
+
|
156
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
157
|
+
if @api_client.config.debugging
|
158
|
+
@api_client.config.logger.debug "API called: PaylinkApi#token_changes_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
159
|
+
end
|
160
|
+
return data, status_code, headers
|
161
|
+
end
|
162
|
+
|
95
163
|
# Close Paylink Token
|
96
164
|
# 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
165
|
# @param token [String] The token returned by the create token process.
|
@@ -156,7 +224,7 @@ module CityPayApiClient
|
|
156
224
|
end
|
157
225
|
|
158
226
|
# 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. |
|
227
|
+
# 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
228
|
# @param paylink_bill_payment_token_request [PaylinkBillPaymentTokenRequest]
|
161
229
|
# @param [Hash] opts the optional parameters
|
162
230
|
# @return [PaylinkTokenCreated]
|
@@ -166,7 +234,7 @@ module CityPayApiClient
|
|
166
234
|
end
|
167
235
|
|
168
236
|
# 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 <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. |
|
237
|
+
# 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. |
|
170
238
|
# @param paylink_bill_payment_token_request [PaylinkBillPaymentTokenRequest]
|
171
239
|
# @param [Hash] opts the optional parameters
|
172
240
|
# @return [Array<(PaylinkTokenCreated, Integer, Hash)>] PaylinkTokenCreated data, response status code and response headers
|
@@ -355,7 +423,7 @@ module CityPayApiClient
|
|
355
423
|
end
|
356
424
|
|
357
425
|
# Reconcile Paylink Token
|
358
|
-
# Marks a Paylink Token as reconciled when
|
426
|
+
# Marks a Paylink Token as reconciled when reconciliation is performed on the merchant's side.
|
359
427
|
# @param token [String] The token returned by the create token process.
|
360
428
|
# @param [Hash] opts the optional parameters
|
361
429
|
# @return [Acknowledgement]
|
@@ -365,7 +433,7 @@ module CityPayApiClient
|
|
365
433
|
end
|
366
434
|
|
367
435
|
# Reconcile Paylink Token
|
368
|
-
# Marks a Paylink Token as reconciled when
|
436
|
+
# Marks a Paylink Token as reconciled when reconciliation is performed on the merchant's side.
|
369
437
|
# @param token [String] The token returned by the create token process.
|
370
438
|
# @param [Hash] opts the optional parameters
|
371
439
|
# @return [Array<(Acknowledgement, Integer, Hash)>] Acknowledgement data, response status code and response headers
|
@@ -480,74 +548,6 @@ module CityPayApiClient
|
|
480
548
|
return data, status_code, headers
|
481
549
|
end
|
482
550
|
|
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 `Closed` 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
551
|
# Paylink Token Status
|
552
552
|
# Obtains the full status of a given Paylink Token.
|
553
553
|
# @param token [String] The token returned by the create token process.
|
@@ -1,11 +1,11 @@
|
|
1
1
|
=begin
|
2
2
|
#CityPay Payment API
|
3
3
|
|
4
|
-
# This CityPay API is
|
4
|
+
# This CityPay API is an 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 tokenized payments using cardholder 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](https://citypay.github.io/api-docs/payment-api/#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 cardholder 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
5
|
|
6
6
|
Contact: support@citypay.com
|
7
7
|
Generated by: https://openapi-generator.tech
|
8
|
-
OpenAPI Generator version:
|
8
|
+
OpenAPI Generator version: 7.2.0
|
9
9
|
|
10
10
|
=end
|
11
11
|
|
@@ -16,6 +16,7 @@ require 'tempfile'
|
|
16
16
|
require 'time'
|
17
17
|
require 'typhoeus'
|
18
18
|
|
19
|
+
|
19
20
|
module CityPayApiClient
|
20
21
|
class ApiClient
|
21
22
|
# The Configuration object holding settings to be used in the API client.
|
@@ -45,9 +46,10 @@ module CityPayApiClient
|
|
45
46
|
# Call an API with given options.
|
46
47
|
#
|
47
48
|
# @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
|
48
|
-
# the data deserialized from response body (
|
49
|
+
# the data deserialized from response body (may be a Tempfile or nil), response status code and response headers.
|
49
50
|
def call_api(http_method, path, opts = {})
|
50
51
|
request = build_request(http_method, path, opts)
|
52
|
+
tempfile = download_file(request) if opts[:return_type] == 'File'
|
51
53
|
response = request.run
|
52
54
|
|
53
55
|
if @config.debugging
|
@@ -69,7 +71,9 @@ module CityPayApiClient
|
|
69
71
|
end
|
70
72
|
end
|
71
73
|
|
72
|
-
if opts[:return_type]
|
74
|
+
if opts[:return_type] == 'File'
|
75
|
+
data = tempfile
|
76
|
+
elsif opts[:return_type]
|
73
77
|
data = deserialize(response, opts[:return_type])
|
74
78
|
else
|
75
79
|
data = nil
|
@@ -125,9 +129,7 @@ module CityPayApiClient
|
|
125
129
|
end
|
126
130
|
end
|
127
131
|
|
128
|
-
|
129
|
-
download_file(request) if opts[:return_type] == 'File'
|
130
|
-
request
|
132
|
+
Typhoeus::Request.new(url, req_opts)
|
131
133
|
end
|
132
134
|
|
133
135
|
# Builds the HTTP request body
|
@@ -165,6 +167,8 @@ module CityPayApiClient
|
|
165
167
|
# process can use.
|
166
168
|
#
|
167
169
|
# @see Configuration#temp_folder_path
|
170
|
+
#
|
171
|
+
# @return [Tempfile] the tempfile generated
|
168
172
|
def download_file(request)
|
169
173
|
tempfile = nil
|
170
174
|
encoding = nil
|
@@ -179,21 +183,24 @@ module CityPayApiClient
|
|
179
183
|
prefix = prefix + '-' unless prefix.end_with?('-')
|
180
184
|
encoding = response.body.encoding
|
181
185
|
tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
|
182
|
-
@tempfile = tempfile
|
183
186
|
end
|
184
187
|
request.on_body do |chunk|
|
185
188
|
chunk.force_encoding(encoding)
|
186
189
|
tempfile.write(chunk)
|
187
190
|
end
|
188
|
-
request
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
191
|
+
# run the request to ensure the tempfile is created successfully before returning it
|
192
|
+
request.run
|
193
|
+
if tempfile
|
194
|
+
tempfile.close
|
195
|
+
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
|
196
|
+
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
197
|
+
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
198
|
+
"explicitly with `tempfile.delete`"
|
199
|
+
else
|
200
|
+
fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
|
196
201
|
end
|
202
|
+
|
203
|
+
tempfile
|
197
204
|
end
|
198
205
|
|
199
206
|
# Check if the given MIME is a JSON MIME.
|
@@ -214,15 +221,10 @@ module CityPayApiClient
|
|
214
221
|
# @param [String] return_type some examples: "User", "Array<User>", "Hash<String, Integer>"
|
215
222
|
def deserialize(response, return_type)
|
216
223
|
body = response.body
|
217
|
-
|
218
|
-
# handle file downloading - return the File instance processed in request callbacks
|
219
|
-
# note that response body is empty when the file is written in chunks in request on_body callback
|
220
|
-
return @tempfile if return_type == 'File'
|
221
|
-
|
222
224
|
return nil if body.nil? || body.empty?
|
223
225
|
|
224
226
|
# return response body directly for String return type
|
225
|
-
return body if return_type == 'String'
|
227
|
+
return body.to_s if return_type == 'String'
|
226
228
|
|
227
229
|
# ensuring a default content type
|
228
230
|
content_type = response.headers['Content-Type'] || 'application/json'
|
@@ -1,11 +1,11 @@
|
|
1
1
|
=begin
|
2
2
|
#CityPay Payment API
|
3
3
|
|
4
|
-
# This CityPay API is
|
4
|
+
# This CityPay API is an 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 tokenized payments using cardholder 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](https://citypay.github.io/api-docs/payment-api/#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 cardholder 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
5
|
|
6
6
|
Contact: support@citypay.com
|
7
7
|
Generated by: https://openapi-generator.tech
|
8
|
-
OpenAPI Generator version:
|
8
|
+
OpenAPI Generator version: 7.2.0
|
9
9
|
|
10
10
|
=end
|
11
11
|
|
@@ -31,6 +31,7 @@ module CityPayApiClient
|
|
31
31
|
end
|
32
32
|
else
|
33
33
|
super arg
|
34
|
+
@message = arg
|
34
35
|
end
|
35
36
|
end
|
36
37
|
|
@@ -1,11 +1,11 @@
|
|
1
1
|
=begin
|
2
2
|
#CityPay Payment API
|
3
3
|
|
4
|
-
# This CityPay API is
|
4
|
+
# This CityPay API is an 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 tokenized payments using cardholder 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](https://citypay.github.io/api-docs/payment-api/#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 cardholder 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
5
|
|
6
6
|
Contact: support@citypay.com
|
7
7
|
Generated by: https://openapi-generator.tech
|
8
|
-
OpenAPI Generator version:
|
8
|
+
OpenAPI Generator version: 7.2.0
|
9
9
|
|
10
10
|
=end
|
11
11
|
|
@@ -61,6 +61,16 @@ module CityPayApiClient
|
|
61
61
|
# Defines the access token (Bearer) used with OAuth2.
|
62
62
|
attr_accessor :access_token
|
63
63
|
|
64
|
+
# Defines a Proc used to fetch or refresh access tokens (Bearer) used with OAuth2.
|
65
|
+
# Overrides the access_token if set
|
66
|
+
# @return [Proc]
|
67
|
+
attr_accessor :access_token_getter
|
68
|
+
|
69
|
+
# Set this to return data as binary instead of downloading a temp file. When enabled (set to true)
|
70
|
+
# HTTP responses with return type `File` will be returned as a stream of binary data.
|
71
|
+
# Default to false.
|
72
|
+
attr_accessor :return_binary_data
|
73
|
+
|
64
74
|
# Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
|
65
75
|
# details will be logged with `logger.debug` (see the `logger` attribute).
|
66
76
|
# Default to false.
|
@@ -141,7 +151,7 @@ module CityPayApiClient
|
|
141
151
|
@scheme = 'https'
|
142
152
|
@host = 'api.citypay.com'
|
143
153
|
@base_path = ''
|
144
|
-
@server_index =
|
154
|
+
@server_index = nil
|
145
155
|
@server_operation_index = {}
|
146
156
|
@server_variables = {}
|
147
157
|
@server_operation_variables = {}
|
@@ -189,10 +199,12 @@ module CityPayApiClient
|
|
189
199
|
|
190
200
|
# Returns base URL for specified operation based on server settings
|
191
201
|
def base_url(operation = nil)
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
202
|
+
if operation_server_settings.key?(operation) then
|
203
|
+
index = server_operation_index.fetch(operation, server_index)
|
204
|
+
server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
|
205
|
+
else
|
206
|
+
server_index.nil? ? "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') : server_url(server_index, server_variables, nil)
|
207
|
+
end
|
196
208
|
end
|
197
209
|
|
198
210
|
# Gets API key (with prefix if set).
|
@@ -207,6 +219,12 @@ module CityPayApiClient
|
|
207
219
|
end
|
208
220
|
end
|
209
221
|
|
222
|
+
# Gets access_token using access_token_getter or uses the static access_token
|
223
|
+
def access_token_with_refresh
|
224
|
+
return access_token if access_token_getter.nil?
|
225
|
+
access_token_getter.call
|
226
|
+
end
|
227
|
+
|
210
228
|
# Gets Basic Auth token string
|
211
229
|
def basic_auth_token
|
212
230
|
'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
|
@@ -259,8 +277,8 @@ module CityPayApiClient
|
|
259
277
|
servers = server_settings if servers == nil
|
260
278
|
|
261
279
|
# check array index out of bound
|
262
|
-
if (index < 0 || index >= servers.size)
|
263
|
-
fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
|
280
|
+
if (index.nil? || index < 0 || index >= servers.size)
|
281
|
+
fail ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}"
|
264
282
|
end
|
265
283
|
|
266
284
|
server = servers[index]
|
@@ -285,5 +303,6 @@ module CityPayApiClient
|
|
285
303
|
url
|
286
304
|
end
|
287
305
|
|
306
|
+
|
288
307
|
end
|
289
308
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
=begin
|
2
2
|
#CityPay Payment API
|
3
3
|
|
4
|
-
# This CityPay API is
|
4
|
+
# This CityPay API is an 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 tokenized payments using cardholder 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](https://citypay.github.io/api-docs/payment-api/#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 cardholder 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
5
|
|
6
6
|
Contact: support@citypay.com
|
7
7
|
Generated by: https://openapi-generator.tech
|
8
|
-
OpenAPI Generator version:
|
8
|
+
OpenAPI Generator version: 7.2.0
|
9
9
|
|
10
10
|
=end
|
11
11
|
|
@@ -63,6 +63,8 @@ module CityPayApiClient
|
|
63
63
|
|
64
64
|
if attributes.key?(:'account_id')
|
65
65
|
self.account_id = attributes[:'account_id']
|
66
|
+
else
|
67
|
+
self.account_id = nil
|
66
68
|
end
|
67
69
|
|
68
70
|
if attributes.key?(:'contact')
|
@@ -73,6 +75,7 @@ module CityPayApiClient
|
|
73
75
|
# Show invalid properties with the reasons. Usually used together with valid?
|
74
76
|
# @return Array for valid properties with the reasons
|
75
77
|
def list_invalid_properties
|
78
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
76
79
|
invalid_properties = Array.new
|
77
80
|
if @account_id.nil?
|
78
81
|
invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
|
@@ -92,6 +95,7 @@ module CityPayApiClient
|
|
92
95
|
# Check to see if the all the properties in the model are valid
|
93
96
|
# @return true if the model is valid
|
94
97
|
def valid?
|
98
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
95
99
|
return false if @account_id.nil?
|
96
100
|
return false if @account_id.to_s.length > 50
|
97
101
|
return false if @account_id.to_s.length < 5
|
@@ -141,37 +145,30 @@ module CityPayApiClient
|
|
141
145
|
# @param [Hash] attributes Model attributes in the form of hash
|
142
146
|
# @return [Object] Returns the model itself
|
143
147
|
def self.build_from_hash(attributes)
|
144
|
-
new.build_from_hash(attributes)
|
145
|
-
end
|
146
|
-
|
147
|
-
# Builds the object from hash
|
148
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
149
|
-
# @return [Object] Returns the model itself
|
150
|
-
def build_from_hash(attributes)
|
151
148
|
return nil unless attributes.is_a?(Hash)
|
152
149
|
attributes = attributes.transform_keys(&:to_sym)
|
153
|
-
|
154
|
-
|
155
|
-
|
150
|
+
transformed_hash = {}
|
151
|
+
openapi_types.each_pair do |key, type|
|
152
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
153
|
+
transformed_hash["#{key}"] = nil
|
156
154
|
elsif type =~ /\AArray<(.*)>/i
|
157
155
|
# check to ensure the input is an array given that the attribute
|
158
156
|
# is documented as an array but the input is not
|
159
|
-
if attributes[
|
160
|
-
|
157
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
158
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
161
159
|
end
|
162
|
-
elsif !attributes[
|
163
|
-
|
160
|
+
elsif !attributes[attribute_map[key]].nil?
|
161
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
164
162
|
end
|
165
163
|
end
|
166
|
-
|
167
|
-
self
|
164
|
+
new(transformed_hash)
|
168
165
|
end
|
169
166
|
|
170
167
|
# Deserializes the data based on type
|
171
168
|
# @param string type Data type
|
172
169
|
# @param string value Value to be deserialized
|
173
170
|
# @return [Object] Deserialized data
|
174
|
-
def _deserialize(type, value)
|
171
|
+
def self._deserialize(type, value)
|
175
172
|
case type.to_sym
|
176
173
|
when :Time
|
177
174
|
Time.parse(value)
|
@@ -206,7 +203,7 @@ module CityPayApiClient
|
|
206
203
|
else # model
|
207
204
|
# models (e.g. Pet) or oneOf
|
208
205
|
klass = CityPayApiClient.const_get(type)
|
209
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
206
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
210
207
|
end
|
211
208
|
end
|
212
209
|
|