citypay_api_client 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +176 -0
- data/Rakefile +10 -0
- data/citypay_api_client.gemspec +39 -0
- data/docs/AccountCreate.md +19 -0
- data/docs/AccountStatus.md +17 -0
- data/docs/Acknowledgement.md +23 -0
- data/docs/AirlineAdvice.md +47 -0
- data/docs/AirlineSegment.md +31 -0
- data/docs/AuthReference.md +43 -0
- data/docs/AuthReferences.md +17 -0
- data/docs/AuthRequest.md +59 -0
- data/docs/AuthResponse.md +69 -0
- data/docs/AuthenRequired.md +21 -0
- data/docs/CResAuthRequest.md +17 -0
- data/docs/CaptureRequest.md +27 -0
- data/docs/Card.md +51 -0
- data/docs/CardHolderAccount.md +31 -0
- data/docs/CardHolderAccountApi.md +515 -0
- data/docs/CardStatus.md +19 -0
- data/docs/ChargeRequest.md +41 -0
- data/docs/ContactDetails.md +41 -0
- data/docs/Decision.md +21 -0
- data/docs/Error.md +23 -0
- data/docs/ExternalMPI.md +25 -0
- data/docs/ListMerchantsResponse.md +21 -0
- data/docs/MCC6012.md +23 -0
- data/docs/Merchant.md +25 -0
- data/docs/OperationalApi.md +118 -0
- data/docs/PaResAuthRequest.md +19 -0
- data/docs/PaymentProcessingApi.md +338 -0
- data/docs/Ping.md +17 -0
- data/docs/RegisterCard.md +23 -0
- data/docs/RequestChallenged.md +25 -0
- data/docs/RetrieveRequest.md +21 -0
- data/docs/ThreeDSecure.md +25 -0
- data/docs/VoidRequest.md +23 -0
- data/git_push.sh +58 -0
- data/lib/citypay_api_client.rb +72 -0
- data/lib/citypay_api_client/api/card_holder_account_api.rb +628 -0
- data/lib/citypay_api_client/api/operational_api.rb +148 -0
- data/lib/citypay_api_client/api/payment_processing_api.rb +406 -0
- data/lib/citypay_api_client/api_client.rb +388 -0
- data/lib/citypay_api_client/api_error.rb +57 -0
- data/lib/citypay_api_client/configuration.rb +252 -0
- data/lib/citypay_api_client/models/account_create.rb +249 -0
- data/lib/citypay_api_client/models/account_status.rb +207 -0
- data/lib/citypay_api_client/models/acknowledgement.rb +285 -0
- data/lib/citypay_api_client/models/airline_advice.rb +551 -0
- data/lib/citypay_api_client/models/airline_segment.rb +408 -0
- data/lib/citypay_api_client/models/api_key.rb +53 -0
- data/lib/citypay_api_client/models/auth_reference.rb +400 -0
- data/lib/citypay_api_client/models/auth_references.rb +208 -0
- data/lib/citypay_api_client/models/auth_request.rb +631 -0
- data/lib/citypay_api_client/models/auth_response.rb +563 -0
- data/lib/citypay_api_client/models/authen_required.rb +227 -0
- data/lib/citypay_api_client/models/c_res_auth_request.rb +207 -0
- data/lib/citypay_api_client/models/capture_request.rb +285 -0
- data/lib/citypay_api_client/models/card.rb +425 -0
- data/lib/citypay_api_client/models/card_holder_account.rb +315 -0
- data/lib/citypay_api_client/models/card_status.rb +217 -0
- data/lib/citypay_api_client/models/charge_request.rb +453 -0
- data/lib/citypay_api_client/models/contact_details.rb +456 -0
- data/lib/citypay_api_client/models/decision.rb +224 -0
- data/lib/citypay_api_client/models/error.rb +285 -0
- data/lib/citypay_api_client/models/external_mpi.rb +307 -0
- data/lib/citypay_api_client/models/list_merchants_response.rb +252 -0
- data/lib/citypay_api_client/models/mcc6012.rb +237 -0
- data/lib/citypay_api_client/models/merchant.rb +247 -0
- data/lib/citypay_api_client/models/pa_res_auth_request.rb +227 -0
- data/lib/citypay_api_client/models/ping.rb +231 -0
- data/lib/citypay_api_client/models/register_card.rb +336 -0
- data/lib/citypay_api_client/models/request_challenged.rb +247 -0
- data/lib/citypay_api_client/models/retrieve_request.rb +256 -0
- data/lib/citypay_api_client/models/three_d_secure.rb +247 -0
- data/lib/citypay_api_client/models/void_request.rb +266 -0
- data/lib/citypay_api_client/version.rb +15 -0
- data/spec/api/card_holder_account_api_spec.rb +149 -0
- data/spec/api/operational_api_spec.rb +59 -0
- data/spec/api/payment_processing_api_spec.rb +107 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/account_create_spec.rb +47 -0
- data/spec/models/account_status_spec.rb +41 -0
- data/spec/models/acknowledgement_spec.rb +59 -0
- data/spec/models/airline_advice_spec.rb +131 -0
- data/spec/models/airline_segment_spec.rb +83 -0
- data/spec/models/auth_reference_spec.rb +119 -0
- data/spec/models/auth_references_spec.rb +41 -0
- data/spec/models/auth_request_spec.rb +167 -0
- data/spec/models/auth_response_spec.rb +197 -0
- data/spec/models/authen_required_spec.rb +53 -0
- data/spec/models/c_res_auth_request_spec.rb +41 -0
- data/spec/models/capture_request_spec.rb +71 -0
- data/spec/models/card_holder_account_spec.rb +83 -0
- data/spec/models/card_spec.rb +143 -0
- data/spec/models/card_status_spec.rb +47 -0
- data/spec/models/charge_request_spec.rb +113 -0
- data/spec/models/contact_details_spec.rb +113 -0
- data/spec/models/decision_spec.rb +53 -0
- data/spec/models/error_spec.rb +59 -0
- data/spec/models/external_mpi_spec.rb +65 -0
- data/spec/models/list_merchants_response_spec.rb +53 -0
- data/spec/models/mcc6012_spec.rb +59 -0
- data/spec/models/merchant_spec.rb +65 -0
- data/spec/models/pa_res_auth_request_spec.rb +47 -0
- data/spec/models/ping_spec.rb +41 -0
- data/spec/models/register_card_spec.rb +59 -0
- data/spec/models/request_challenged_spec.rb +65 -0
- data/spec/models/retrieve_request_spec.rb +53 -0
- data/spec/models/three_d_secure_spec.rb +65 -0
- data/spec/models/void_request_spec.rb +59 -0
- data/spec/spec_helper.rb +111 -0
- metadata +252 -0
data/docs/Ping.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# CityPayApiClient::Ping
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**identifier** | **String** | An identifier of the ping request which will be returned in the response. | [optional]
|
8
|
+
|
9
|
+
## Code Sample
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'CityPayApiClient'
|
13
|
+
|
14
|
+
instance = CityPayApiClient::Ping.new(identifier: 95b857a1-5955-4b86-963c-5a6dbfc4fb95)
|
15
|
+
```
|
16
|
+
|
17
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# CityPayApiClient::RegisterCard
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**cardnumber** | **String** | The primary number of the card. |
|
8
|
+
**default** | **Boolean** | Determines whether the card should be the new default card. | [optional]
|
9
|
+
**expmonth** | **Integer** | The expiry month of the card. |
|
10
|
+
**expyear** | **Integer** | The expiry year of the card. |
|
11
|
+
|
12
|
+
## Code Sample
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
require 'CityPayApiClient'
|
16
|
+
|
17
|
+
instance = CityPayApiClient::RegisterCard.new(cardnumber: 4000 0000 0000 0002,
|
18
|
+
default: null,
|
19
|
+
expmonth: 9,
|
20
|
+
expyear: 2023)
|
21
|
+
```
|
22
|
+
|
23
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# CityPayApiClient::RequestChallenged
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**acs_url** | **String** | The url of the Access Control Server (ACS) to forward the user to. | [optional]
|
8
|
+
**creq** | **String** | The challenge request data which is encoded for usage by the ACS. | [optional]
|
9
|
+
**merchantid** | **Integer** | The merchant id that processed this transaction. | [optional]
|
10
|
+
**three_d_server_trans_id** | **String** | The 3DSv2 trans id reference for the challenge process. | [optional]
|
11
|
+
**transno** | **Integer** | The transaction number for the challenge, ordered incrementally from 1 for every merchant_id. | [optional]
|
12
|
+
|
13
|
+
## Code Sample
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
require 'CityPayApiClient'
|
17
|
+
|
18
|
+
instance = CityPayApiClient::RequestChallenged.new(acs_url: https://acs.cardissuer.com/3dsv1,
|
19
|
+
creq: null,
|
20
|
+
merchantid: 11223344,
|
21
|
+
three_d_server_trans_id: null,
|
22
|
+
transno: 78416)
|
23
|
+
```
|
24
|
+
|
25
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# CityPayApiClient::RetrieveRequest
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**identifier** | **String** | The identifier of the transaction to retrieve. Optional if a transaction number is provided. | [optional]
|
8
|
+
**merchantid** | **Integer** | The merchant account to retrieve data for. |
|
9
|
+
**transno** | **Integer** | The transaction number of a transaction to retrieve. Optional if an identifier is supplied. | [optional]
|
10
|
+
|
11
|
+
## Code Sample
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'CityPayApiClient'
|
15
|
+
|
16
|
+
instance = CityPayApiClient::RetrieveRequest.new(identifier: 95b857a1-5955-4b86-963c-5a6dbfc4fb95,
|
17
|
+
merchantid: 11223344,
|
18
|
+
transno: 78416)
|
19
|
+
```
|
20
|
+
|
21
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# CityPayApiClient::ThreeDSecure
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**accept_headers** | **String** | The content of the HTTP accept header as sent to the merchant from the cardholder's user agent. This value will be validated by the ACS when the card holder authenticates themselves to verify that no intermediary is performing this action. Required for 3DSv1. | [optional]
|
8
|
+
**downgrade1** | **Boolean** | Where a merchant is configured for 3DSv2, setting this option will attempt to downgrade the transaction to 3DSv1. | [optional]
|
9
|
+
**merchant_termurl** | **String** | A controller URL for 3D-Secure processing that any response from an authentication request or challenge request should be sent to. The controller should forward on the response from the URL back via this API for subsequent processing. Required if 3DSv1 or 3DSv2 is required. | [optional]
|
10
|
+
**tds_policy** | **String** | A policy value which determines whether ThreeDSecure is enforced or bypassed. Note that this will only work for e-commerce transactions and accounts that have 3DSecure enabled and fully registered with Visa, MasterCard or American Express. It is useful when transactions may be wanted to bypass processing rules. Note that this may affect the liability shift of transactions and may occur a higher fee with the acquiring bank. Values are `0` for the default policy (default value if not supplied). Your default values are determined by your account manager on setup of the account. `1` for an enforced policy. Transactions will be enabled for 3DS processing `2` to bypass. Transactions that are bypassed will switch off 3DS processing. | [optional]
|
11
|
+
**user_agent** | **String** | The content of the HTTP user-agent header as sent to the merchant from the cardholder's user agent. This value will be validated by the ACS when the card holder authenticates themselves to verify that no intermediary is performing this action. Required for 3DSv1. | [optional]
|
12
|
+
|
13
|
+
## Code Sample
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
require 'CityPayApiClient'
|
17
|
+
|
18
|
+
instance = CityPayApiClient::ThreeDSecure.new(accept_headers: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9,
|
19
|
+
downgrade1: null,
|
20
|
+
merchant_termurl: null,
|
21
|
+
tds_policy: null,
|
22
|
+
user_agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36)
|
23
|
+
```
|
24
|
+
|
25
|
+
|
data/docs/VoidRequest.md
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# CityPayApiClient::VoidRequest
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**identifier** | **String** | The identifier of the transaction to void. If an empty value is supplied then a `trans_no` value must be supplied. | [optional]
|
8
|
+
**merchantid** | **Integer** | Identifies the merchant account to perform the void for. |
|
9
|
+
**sdk** | **String** | An optional reference value for the calling client such as a version number i.e. | [optional]
|
10
|
+
**transno** | **Integer** | The transaction number of the transaction to look up and void. If an empty value is supplied then an identifier value must be supplied. | [optional]
|
11
|
+
|
12
|
+
## Code Sample
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
require 'CityPayApiClient'
|
16
|
+
|
17
|
+
instance = CityPayApiClient::VoidRequest.new(identifier: 95b857a1-5955-4b86-963c-5a6dbfc4fb95,
|
18
|
+
merchantid: 11223344,
|
19
|
+
sdk: MyClient 1.3.0,
|
20
|
+
transno: 78416)
|
21
|
+
```
|
22
|
+
|
23
|
+
|
data/git_push.sh
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
3
|
+
#
|
4
|
+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
|
5
|
+
|
6
|
+
git_user_id=$1
|
7
|
+
git_repo_id=$2
|
8
|
+
release_note=$3
|
9
|
+
git_host=$4
|
10
|
+
|
11
|
+
if [ "$git_host" = "" ]; then
|
12
|
+
git_host="github.com"
|
13
|
+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
14
|
+
fi
|
15
|
+
|
16
|
+
if [ "$git_user_id" = "" ]; then
|
17
|
+
git_user_id="citypay"
|
18
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
19
|
+
fi
|
20
|
+
|
21
|
+
if [ "$git_repo_id" = "" ]; then
|
22
|
+
git_repo_id="citypay-api-client-ruby"
|
23
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
24
|
+
fi
|
25
|
+
|
26
|
+
if [ "$release_note" = "" ]; then
|
27
|
+
release_note="Minor update"
|
28
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
29
|
+
fi
|
30
|
+
|
31
|
+
# Initialize the local directory as a Git repository
|
32
|
+
git init
|
33
|
+
|
34
|
+
# Adds the files in the local repository and stages them for commit.
|
35
|
+
git add .
|
36
|
+
|
37
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
38
|
+
git commit -m "$release_note"
|
39
|
+
|
40
|
+
# Sets the new remote
|
41
|
+
git_remote=`git remote`
|
42
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
43
|
+
|
44
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
45
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
46
|
+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
47
|
+
else
|
48
|
+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
|
49
|
+
fi
|
50
|
+
|
51
|
+
fi
|
52
|
+
|
53
|
+
git pull origin master
|
54
|
+
|
55
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
56
|
+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
57
|
+
git push origin master 2>&1 | grep -v 'To https'
|
58
|
+
|
@@ -0,0 +1,72 @@
|
|
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 <aside class=\"notice\"> Before we begin a reminder that 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 including: </aside> * 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
|
+
The version of the OpenAPI document: 6.0.0
|
7
|
+
Contact: support@citypay.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
# Common files
|
14
|
+
require 'citypay_api_client/api_client'
|
15
|
+
require 'citypay_api_client/api_error'
|
16
|
+
require 'citypay_api_client/version'
|
17
|
+
require 'citypay_api_client/configuration'
|
18
|
+
|
19
|
+
# Models
|
20
|
+
require 'citypay_api_client/models/account_create'
|
21
|
+
require 'citypay_api_client/models/account_status'
|
22
|
+
require 'citypay_api_client/models/acknowledgement'
|
23
|
+
require 'citypay_api_client/models/airline_advice'
|
24
|
+
require 'citypay_api_client/models/airline_segment'
|
25
|
+
require 'citypay_api_client/models/auth_reference'
|
26
|
+
require 'citypay_api_client/models/auth_references'
|
27
|
+
require 'citypay_api_client/models/auth_request'
|
28
|
+
require 'citypay_api_client/models/auth_response'
|
29
|
+
require 'citypay_api_client/models/authen_required'
|
30
|
+
require 'citypay_api_client/models/c_res_auth_request'
|
31
|
+
require 'citypay_api_client/models/capture_request'
|
32
|
+
require 'citypay_api_client/models/card'
|
33
|
+
require 'citypay_api_client/models/card_holder_account'
|
34
|
+
require 'citypay_api_client/models/card_status'
|
35
|
+
require 'citypay_api_client/models/charge_request'
|
36
|
+
require 'citypay_api_client/models/contact_details'
|
37
|
+
require 'citypay_api_client/models/decision'
|
38
|
+
require 'citypay_api_client/models/error'
|
39
|
+
require 'citypay_api_client/models/external_mpi'
|
40
|
+
require 'citypay_api_client/models/list_merchants_response'
|
41
|
+
require 'citypay_api_client/models/mcc6012'
|
42
|
+
require 'citypay_api_client/models/merchant'
|
43
|
+
require 'citypay_api_client/models/pa_res_auth_request'
|
44
|
+
require 'citypay_api_client/models/ping'
|
45
|
+
require 'citypay_api_client/models/register_card'
|
46
|
+
require 'citypay_api_client/models/request_challenged'
|
47
|
+
require 'citypay_api_client/models/retrieve_request'
|
48
|
+
require 'citypay_api_client/models/three_d_secure'
|
49
|
+
require 'citypay_api_client/models/void_request'
|
50
|
+
|
51
|
+
# APIs
|
52
|
+
require 'citypay_api_client/api/card_holder_account_api'
|
53
|
+
require 'citypay_api_client/api/operational_api'
|
54
|
+
require 'citypay_api_client/api/payment_processing_api'
|
55
|
+
|
56
|
+
module CityPayApiClient
|
57
|
+
class << self
|
58
|
+
# Customize default settings for the SDK using block.
|
59
|
+
# CityPayApiClient.configure do |config|
|
60
|
+
# config.username = "xxx"
|
61
|
+
# config.password = "xxx"
|
62
|
+
# end
|
63
|
+
# If no block given, return the default Configuration object.
|
64
|
+
def configure
|
65
|
+
if block_given?
|
66
|
+
yield(Configuration.default)
|
67
|
+
else
|
68
|
+
Configuration.default
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,628 @@
|
|
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 <aside class=\"notice\"> Before we begin a reminder that 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 including: </aside> * 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
|
+
The version of the OpenAPI document: 6.0.0
|
7
|
+
Contact: support@citypay.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module CityPayApiClient
|
16
|
+
class CardHolderAccountApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Card Deletion
|
23
|
+
# Deletes a card from the account. The card will be marked for deletion before a subsequent purge will clear the card permanently.
|
24
|
+
# @param accountid [String] The account id that refers to the customer's account no. This value will have been provided when setting up the card holder account.
|
25
|
+
# @param card_id [String] The id of the card that is presented by a call to retrieve a card holder account.
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @return [Acknowledgement]
|
28
|
+
def account_card_delete_request(accountid, card_id, opts = {})
|
29
|
+
data, _status_code, _headers = account_card_delete_request_with_http_info(accountid, card_id, opts)
|
30
|
+
data
|
31
|
+
end
|
32
|
+
|
33
|
+
# Card Deletion
|
34
|
+
# Deletes a card from the account. The card will be marked for deletion before a subsequent purge will clear the card permanently.
|
35
|
+
# @param accountid [String] The account id that refers to the customer's account no. This value will have been provided when setting up the card holder account.
|
36
|
+
# @param card_id [String] The id of the card that is presented by a call to retrieve a card holder account.
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @return [Array<(Acknowledgement, Integer, Hash)>] Acknowledgement data, response status code and response headers
|
39
|
+
def account_card_delete_request_with_http_info(accountid, card_id, opts = {})
|
40
|
+
if @api_client.config.debugging
|
41
|
+
@api_client.config.logger.debug 'Calling API: CardHolderAccountApi.account_card_delete_request ...'
|
42
|
+
end
|
43
|
+
# verify the required parameter 'accountid' is set
|
44
|
+
if @api_client.config.client_side_validation && accountid.nil?
|
45
|
+
fail ArgumentError, "Missing the required parameter 'accountid' when calling CardHolderAccountApi.account_card_delete_request"
|
46
|
+
end
|
47
|
+
# verify the required parameter 'card_id' is set
|
48
|
+
if @api_client.config.client_side_validation && card_id.nil?
|
49
|
+
fail ArgumentError, "Missing the required parameter 'card_id' when calling CardHolderAccountApi.account_card_delete_request"
|
50
|
+
end
|
51
|
+
# resource path
|
52
|
+
local_var_path = '/account/{accountid}/card/{cardId}'.sub('{' + 'accountid' + '}', CGI.escape(accountid.to_s)).sub('{' + 'cardId' + '}', CGI.escape(card_id.to_s))
|
53
|
+
|
54
|
+
# query parameters
|
55
|
+
query_params = opts[:query_params] || {}
|
56
|
+
|
57
|
+
# header parameters
|
58
|
+
header_params = opts[:header_params] || {}
|
59
|
+
# HTTP header 'Accept' (if needed)
|
60
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
|
61
|
+
|
62
|
+
# form parameters
|
63
|
+
form_params = opts[:form_params] || {}
|
64
|
+
|
65
|
+
# http body (model)
|
66
|
+
post_body = opts[:body]
|
67
|
+
|
68
|
+
# return_type
|
69
|
+
return_type = opts[:return_type] || 'Acknowledgement'
|
70
|
+
|
71
|
+
# auth_names
|
72
|
+
auth_names = opts[:auth_names] || ['cp-api-key']
|
73
|
+
|
74
|
+
new_options = opts.merge(
|
75
|
+
:header_params => header_params,
|
76
|
+
:query_params => query_params,
|
77
|
+
:form_params => form_params,
|
78
|
+
:body => post_body,
|
79
|
+
:auth_names => auth_names,
|
80
|
+
:return_type => return_type
|
81
|
+
)
|
82
|
+
|
83
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
84
|
+
if @api_client.config.debugging
|
85
|
+
@api_client.config.logger.debug "API called: CardHolderAccountApi#account_card_delete_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
86
|
+
end
|
87
|
+
return data, status_code, headers
|
88
|
+
end
|
89
|
+
|
90
|
+
# Card Registration
|
91
|
+
# Allows for a card to be registered for the account. The card will be added for future processing and will be available as a tokenised value for future processing. The card will be validated for 0. Being a valid card number (luhn check) 0. Having a valid expiry date 0. Being a valid bin value.
|
92
|
+
# @param accountid [String] The account id that refers to the customer's account no. This value will have been provided when setting up the card holder account.
|
93
|
+
# @param register_card [RegisterCard]
|
94
|
+
# @param [Hash] opts the optional parameters
|
95
|
+
# @return [CardHolderAccount]
|
96
|
+
def account_card_register_request(accountid, register_card, opts = {})
|
97
|
+
data, _status_code, _headers = account_card_register_request_with_http_info(accountid, register_card, opts)
|
98
|
+
data
|
99
|
+
end
|
100
|
+
|
101
|
+
# Card Registration
|
102
|
+
# Allows for a card to be registered for the account. The card will be added for future processing and will be available as a tokenised value for future processing. The card will be validated for 0. Being a valid card number (luhn check) 0. Having a valid expiry date 0. Being a valid bin value.
|
103
|
+
# @param accountid [String] The account id that refers to the customer's account no. This value will have been provided when setting up the card holder account.
|
104
|
+
# @param register_card [RegisterCard]
|
105
|
+
# @param [Hash] opts the optional parameters
|
106
|
+
# @return [Array<(CardHolderAccount, Integer, Hash)>] CardHolderAccount data, response status code and response headers
|
107
|
+
def account_card_register_request_with_http_info(accountid, register_card, opts = {})
|
108
|
+
if @api_client.config.debugging
|
109
|
+
@api_client.config.logger.debug 'Calling API: CardHolderAccountApi.account_card_register_request ...'
|
110
|
+
end
|
111
|
+
# verify the required parameter 'accountid' is set
|
112
|
+
if @api_client.config.client_side_validation && accountid.nil?
|
113
|
+
fail ArgumentError, "Missing the required parameter 'accountid' when calling CardHolderAccountApi.account_card_register_request"
|
114
|
+
end
|
115
|
+
# verify the required parameter 'register_card' is set
|
116
|
+
if @api_client.config.client_side_validation && register_card.nil?
|
117
|
+
fail ArgumentError, "Missing the required parameter 'register_card' when calling CardHolderAccountApi.account_card_register_request"
|
118
|
+
end
|
119
|
+
# resource path
|
120
|
+
local_var_path = '/account/{accountid}/register'.sub('{' + 'accountid' + '}', CGI.escape(accountid.to_s))
|
121
|
+
|
122
|
+
# query parameters
|
123
|
+
query_params = opts[:query_params] || {}
|
124
|
+
|
125
|
+
# header parameters
|
126
|
+
header_params = opts[:header_params] || {}
|
127
|
+
# HTTP header 'Accept' (if needed)
|
128
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
|
129
|
+
# HTTP header 'Content-Type'
|
130
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/xml'])
|
131
|
+
|
132
|
+
# form parameters
|
133
|
+
form_params = opts[:form_params] || {}
|
134
|
+
|
135
|
+
# http body (model)
|
136
|
+
post_body = opts[:body] || @api_client.object_to_http_body(register_card)
|
137
|
+
|
138
|
+
# return_type
|
139
|
+
return_type = opts[:return_type] || 'CardHolderAccount'
|
140
|
+
|
141
|
+
# auth_names
|
142
|
+
auth_names = opts[:auth_names] || ['cp-api-key']
|
143
|
+
|
144
|
+
new_options = opts.merge(
|
145
|
+
:header_params => header_params,
|
146
|
+
:query_params => query_params,
|
147
|
+
:form_params => form_params,
|
148
|
+
:body => post_body,
|
149
|
+
:auth_names => auth_names,
|
150
|
+
:return_type => return_type
|
151
|
+
)
|
152
|
+
|
153
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
154
|
+
if @api_client.config.debugging
|
155
|
+
@api_client.config.logger.debug "API called: CardHolderAccountApi#account_card_register_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
156
|
+
end
|
157
|
+
return data, status_code, headers
|
158
|
+
end
|
159
|
+
|
160
|
+
# Card Status
|
161
|
+
# Updates the status of a card for processing. The following values are available | Status | Description | |--------|-------------| | Active | The card is active for processing and can be used for charging against with a valid token | | Inactive | The card is inactive for processing and cannot be used for processing, it will require reactivation before being used to charge | | Expired | The card has expired either due to the expiry date no longer being valid or due to a replacement card being issued |
|
162
|
+
# @param accountid [String] The account id that refers to the customer's account no. This value will have been provided when setting up the card holder account.
|
163
|
+
# @param card_id [String] The id of the card that is presented by a call to retrieve a card holder account.
|
164
|
+
# @param card_status [CardStatus]
|
165
|
+
# @param [Hash] opts the optional parameters
|
166
|
+
# @return [Acknowledgement]
|
167
|
+
def account_card_status_request(accountid, card_id, card_status, opts = {})
|
168
|
+
data, _status_code, _headers = account_card_status_request_with_http_info(accountid, card_id, card_status, opts)
|
169
|
+
data
|
170
|
+
end
|
171
|
+
|
172
|
+
# Card Status
|
173
|
+
# Updates the status of a card for processing. The following values are available | Status | Description | |--------|-------------| | Active | The card is active for processing and can be used for charging against with a valid token | | Inactive | The card is inactive for processing and cannot be used for processing, it will require reactivation before being used to charge | | Expired | The card has expired either due to the expiry date no longer being valid or due to a replacement card being issued |
|
174
|
+
# @param accountid [String] The account id that refers to the customer's account no. This value will have been provided when setting up the card holder account.
|
175
|
+
# @param card_id [String] The id of the card that is presented by a call to retrieve a card holder account.
|
176
|
+
# @param card_status [CardStatus]
|
177
|
+
# @param [Hash] opts the optional parameters
|
178
|
+
# @return [Array<(Acknowledgement, Integer, Hash)>] Acknowledgement data, response status code and response headers
|
179
|
+
def account_card_status_request_with_http_info(accountid, card_id, card_status, opts = {})
|
180
|
+
if @api_client.config.debugging
|
181
|
+
@api_client.config.logger.debug 'Calling API: CardHolderAccountApi.account_card_status_request ...'
|
182
|
+
end
|
183
|
+
# verify the required parameter 'accountid' is set
|
184
|
+
if @api_client.config.client_side_validation && accountid.nil?
|
185
|
+
fail ArgumentError, "Missing the required parameter 'accountid' when calling CardHolderAccountApi.account_card_status_request"
|
186
|
+
end
|
187
|
+
# verify the required parameter 'card_id' is set
|
188
|
+
if @api_client.config.client_side_validation && card_id.nil?
|
189
|
+
fail ArgumentError, "Missing the required parameter 'card_id' when calling CardHolderAccountApi.account_card_status_request"
|
190
|
+
end
|
191
|
+
# verify the required parameter 'card_status' is set
|
192
|
+
if @api_client.config.client_side_validation && card_status.nil?
|
193
|
+
fail ArgumentError, "Missing the required parameter 'card_status' when calling CardHolderAccountApi.account_card_status_request"
|
194
|
+
end
|
195
|
+
# resource path
|
196
|
+
local_var_path = '/account/{accountid}/card/{cardId}/status'.sub('{' + 'accountid' + '}', CGI.escape(accountid.to_s)).sub('{' + 'cardId' + '}', CGI.escape(card_id.to_s))
|
197
|
+
|
198
|
+
# query parameters
|
199
|
+
query_params = opts[:query_params] || {}
|
200
|
+
|
201
|
+
# header parameters
|
202
|
+
header_params = opts[:header_params] || {}
|
203
|
+
# HTTP header 'Accept' (if needed)
|
204
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
|
205
|
+
# HTTP header 'Content-Type'
|
206
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/xml'])
|
207
|
+
|
208
|
+
# form parameters
|
209
|
+
form_params = opts[:form_params] || {}
|
210
|
+
|
211
|
+
# http body (model)
|
212
|
+
post_body = opts[:body] || @api_client.object_to_http_body(card_status)
|
213
|
+
|
214
|
+
# return_type
|
215
|
+
return_type = opts[:return_type] || 'Acknowledgement'
|
216
|
+
|
217
|
+
# auth_names
|
218
|
+
auth_names = opts[:auth_names] || ['cp-api-key']
|
219
|
+
|
220
|
+
new_options = opts.merge(
|
221
|
+
:header_params => header_params,
|
222
|
+
:query_params => query_params,
|
223
|
+
:form_params => form_params,
|
224
|
+
:body => post_body,
|
225
|
+
:auth_names => auth_names,
|
226
|
+
:return_type => return_type
|
227
|
+
)
|
228
|
+
|
229
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
230
|
+
if @api_client.config.debugging
|
231
|
+
@api_client.config.logger.debug "API called: CardHolderAccountApi#account_card_status_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
232
|
+
end
|
233
|
+
return data, status_code, headers
|
234
|
+
end
|
235
|
+
|
236
|
+
# Contact Details Update
|
237
|
+
# Allows for the ability to change the contact details for an account.
|
238
|
+
# @param accountid [String] The account id that refers to the customer's account no. This value will have been provided when setting up the card holder account.
|
239
|
+
# @param contact_details [ContactDetails]
|
240
|
+
# @param [Hash] opts the optional parameters
|
241
|
+
# @return [CardHolderAccount]
|
242
|
+
def account_change_contact_request(accountid, contact_details, opts = {})
|
243
|
+
data, _status_code, _headers = account_change_contact_request_with_http_info(accountid, contact_details, opts)
|
244
|
+
data
|
245
|
+
end
|
246
|
+
|
247
|
+
# Contact Details Update
|
248
|
+
# Allows for the ability to change the contact details for an account.
|
249
|
+
# @param accountid [String] The account id that refers to the customer's account no. This value will have been provided when setting up the card holder account.
|
250
|
+
# @param contact_details [ContactDetails]
|
251
|
+
# @param [Hash] opts the optional parameters
|
252
|
+
# @return [Array<(CardHolderAccount, Integer, Hash)>] CardHolderAccount data, response status code and response headers
|
253
|
+
def account_change_contact_request_with_http_info(accountid, contact_details, opts = {})
|
254
|
+
if @api_client.config.debugging
|
255
|
+
@api_client.config.logger.debug 'Calling API: CardHolderAccountApi.account_change_contact_request ...'
|
256
|
+
end
|
257
|
+
# verify the required parameter 'accountid' is set
|
258
|
+
if @api_client.config.client_side_validation && accountid.nil?
|
259
|
+
fail ArgumentError, "Missing the required parameter 'accountid' when calling CardHolderAccountApi.account_change_contact_request"
|
260
|
+
end
|
261
|
+
# verify the required parameter 'contact_details' is set
|
262
|
+
if @api_client.config.client_side_validation && contact_details.nil?
|
263
|
+
fail ArgumentError, "Missing the required parameter 'contact_details' when calling CardHolderAccountApi.account_change_contact_request"
|
264
|
+
end
|
265
|
+
# resource path
|
266
|
+
local_var_path = '/account/{accountid}/contact'.sub('{' + 'accountid' + '}', CGI.escape(accountid.to_s))
|
267
|
+
|
268
|
+
# query parameters
|
269
|
+
query_params = opts[:query_params] || {}
|
270
|
+
|
271
|
+
# header parameters
|
272
|
+
header_params = opts[:header_params] || {}
|
273
|
+
# HTTP header 'Accept' (if needed)
|
274
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
|
275
|
+
# HTTP header 'Content-Type'
|
276
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/xml'])
|
277
|
+
|
278
|
+
# form parameters
|
279
|
+
form_params = opts[:form_params] || {}
|
280
|
+
|
281
|
+
# http body (model)
|
282
|
+
post_body = opts[:body] || @api_client.object_to_http_body(contact_details)
|
283
|
+
|
284
|
+
# return_type
|
285
|
+
return_type = opts[:return_type] || 'CardHolderAccount'
|
286
|
+
|
287
|
+
# auth_names
|
288
|
+
auth_names = opts[:auth_names] || ['cp-api-key']
|
289
|
+
|
290
|
+
new_options = opts.merge(
|
291
|
+
:header_params => header_params,
|
292
|
+
:query_params => query_params,
|
293
|
+
:form_params => form_params,
|
294
|
+
:body => post_body,
|
295
|
+
:auth_names => auth_names,
|
296
|
+
:return_type => return_type
|
297
|
+
)
|
298
|
+
|
299
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
300
|
+
if @api_client.config.debugging
|
301
|
+
@api_client.config.logger.debug "API called: CardHolderAccountApi#account_change_contact_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
302
|
+
end
|
303
|
+
return data, status_code, headers
|
304
|
+
end
|
305
|
+
|
306
|
+
# Account Create
|
307
|
+
# Creates a new card holder account and initialises the account ready for adding cards.
|
308
|
+
# @param account_create [AccountCreate]
|
309
|
+
# @param [Hash] opts the optional parameters
|
310
|
+
# @return [CardHolderAccount]
|
311
|
+
def account_create(account_create, opts = {})
|
312
|
+
data, _status_code, _headers = account_create_with_http_info(account_create, opts)
|
313
|
+
data
|
314
|
+
end
|
315
|
+
|
316
|
+
# Account Create
|
317
|
+
# Creates a new card holder account and initialises the account ready for adding cards.
|
318
|
+
# @param account_create [AccountCreate]
|
319
|
+
# @param [Hash] opts the optional parameters
|
320
|
+
# @return [Array<(CardHolderAccount, Integer, Hash)>] CardHolderAccount data, response status code and response headers
|
321
|
+
def account_create_with_http_info(account_create, opts = {})
|
322
|
+
if @api_client.config.debugging
|
323
|
+
@api_client.config.logger.debug 'Calling API: CardHolderAccountApi.account_create ...'
|
324
|
+
end
|
325
|
+
# verify the required parameter 'account_create' is set
|
326
|
+
if @api_client.config.client_side_validation && account_create.nil?
|
327
|
+
fail ArgumentError, "Missing the required parameter 'account_create' when calling CardHolderAccountApi.account_create"
|
328
|
+
end
|
329
|
+
# resource path
|
330
|
+
local_var_path = '/account/create'
|
331
|
+
|
332
|
+
# query parameters
|
333
|
+
query_params = opts[:query_params] || {}
|
334
|
+
|
335
|
+
# header parameters
|
336
|
+
header_params = opts[:header_params] || {}
|
337
|
+
# HTTP header 'Accept' (if needed)
|
338
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
|
339
|
+
# HTTP header 'Content-Type'
|
340
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/xml'])
|
341
|
+
|
342
|
+
# form parameters
|
343
|
+
form_params = opts[:form_params] || {}
|
344
|
+
|
345
|
+
# http body (model)
|
346
|
+
post_body = opts[:body] || @api_client.object_to_http_body(account_create)
|
347
|
+
|
348
|
+
# return_type
|
349
|
+
return_type = opts[:return_type] || 'CardHolderAccount'
|
350
|
+
|
351
|
+
# auth_names
|
352
|
+
auth_names = opts[:auth_names] || ['cp-api-key']
|
353
|
+
|
354
|
+
new_options = opts.merge(
|
355
|
+
:header_params => header_params,
|
356
|
+
:query_params => query_params,
|
357
|
+
:form_params => form_params,
|
358
|
+
:body => post_body,
|
359
|
+
:auth_names => auth_names,
|
360
|
+
:return_type => return_type
|
361
|
+
)
|
362
|
+
|
363
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
364
|
+
if @api_client.config.debugging
|
365
|
+
@api_client.config.logger.debug "API called: CardHolderAccountApi#account_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
366
|
+
end
|
367
|
+
return data, status_code, headers
|
368
|
+
end
|
369
|
+
|
370
|
+
# Account Deletion
|
371
|
+
# Allows for the deletion of an account. The account will marked for deletion and subsequent purging. No further transactions will be alowed to be processed or actioned against this account.
|
372
|
+
# @param accountid [String] The account id that refers to the customer's account no. This value will have been provided when setting up the card holder account.
|
373
|
+
# @param [Hash] opts the optional parameters
|
374
|
+
# @return [Acknowledgement]
|
375
|
+
def account_delete_request(accountid, opts = {})
|
376
|
+
data, _status_code, _headers = account_delete_request_with_http_info(accountid, opts)
|
377
|
+
data
|
378
|
+
end
|
379
|
+
|
380
|
+
# Account Deletion
|
381
|
+
# Allows for the deletion of an account. The account will marked for deletion and subsequent purging. No further transactions will be alowed to be processed or actioned against this account.
|
382
|
+
# @param accountid [String] The account id that refers to the customer's account no. This value will have been provided when setting up the card holder account.
|
383
|
+
# @param [Hash] opts the optional parameters
|
384
|
+
# @return [Array<(Acknowledgement, Integer, Hash)>] Acknowledgement data, response status code and response headers
|
385
|
+
def account_delete_request_with_http_info(accountid, opts = {})
|
386
|
+
if @api_client.config.debugging
|
387
|
+
@api_client.config.logger.debug 'Calling API: CardHolderAccountApi.account_delete_request ...'
|
388
|
+
end
|
389
|
+
# verify the required parameter 'accountid' is set
|
390
|
+
if @api_client.config.client_side_validation && accountid.nil?
|
391
|
+
fail ArgumentError, "Missing the required parameter 'accountid' when calling CardHolderAccountApi.account_delete_request"
|
392
|
+
end
|
393
|
+
# resource path
|
394
|
+
local_var_path = '/account/{accountid}'.sub('{' + 'accountid' + '}', CGI.escape(accountid.to_s))
|
395
|
+
|
396
|
+
# query parameters
|
397
|
+
query_params = opts[:query_params] || {}
|
398
|
+
|
399
|
+
# header parameters
|
400
|
+
header_params = opts[:header_params] || {}
|
401
|
+
# HTTP header 'Accept' (if needed)
|
402
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
|
403
|
+
|
404
|
+
# form parameters
|
405
|
+
form_params = opts[:form_params] || {}
|
406
|
+
|
407
|
+
# http body (model)
|
408
|
+
post_body = opts[:body]
|
409
|
+
|
410
|
+
# return_type
|
411
|
+
return_type = opts[:return_type] || 'Acknowledgement'
|
412
|
+
|
413
|
+
# auth_names
|
414
|
+
auth_names = opts[:auth_names] || ['cp-api-key']
|
415
|
+
|
416
|
+
new_options = opts.merge(
|
417
|
+
:header_params => header_params,
|
418
|
+
:query_params => query_params,
|
419
|
+
:form_params => form_params,
|
420
|
+
:body => post_body,
|
421
|
+
:auth_names => auth_names,
|
422
|
+
:return_type => return_type
|
423
|
+
)
|
424
|
+
|
425
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
426
|
+
if @api_client.config.debugging
|
427
|
+
@api_client.config.logger.debug "API called: CardHolderAccountApi#account_delete_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
428
|
+
end
|
429
|
+
return data, status_code, headers
|
430
|
+
end
|
431
|
+
|
432
|
+
# Account Retrieval
|
433
|
+
# Allows for the retrieval of a card holder account for the given `id`. Should duplicate accounts exist for the same `id`, the first account created with that `id` will be returned. The account can be used for tokenisation processing by listing all cards assigned to the account. The returned cards will include all `active`, `inactive` and `expired` cards. This can be used to enable a card holder to view their wallet and make constructive choices on which card to use.
|
434
|
+
# @param accountid [String] The account id that refers to the customer's account no. This value will have been provided when setting up the card holder account.
|
435
|
+
# @param [Hash] opts the optional parameters
|
436
|
+
# @return [CardHolderAccount]
|
437
|
+
def account_retrieve_request(accountid, opts = {})
|
438
|
+
data, _status_code, _headers = account_retrieve_request_with_http_info(accountid, opts)
|
439
|
+
data
|
440
|
+
end
|
441
|
+
|
442
|
+
# Account Retrieval
|
443
|
+
# Allows for the retrieval of a card holder account for the given `id`. Should duplicate accounts exist for the same `id`, the first account created with that `id` will be returned. The account can be used for tokenisation processing by listing all cards assigned to the account. The returned cards will include all `active`, `inactive` and `expired` cards. This can be used to enable a card holder to view their wallet and make constructive choices on which card to use.
|
444
|
+
# @param accountid [String] The account id that refers to the customer's account no. This value will have been provided when setting up the card holder account.
|
445
|
+
# @param [Hash] opts the optional parameters
|
446
|
+
# @return [Array<(CardHolderAccount, Integer, Hash)>] CardHolderAccount data, response status code and response headers
|
447
|
+
def account_retrieve_request_with_http_info(accountid, opts = {})
|
448
|
+
if @api_client.config.debugging
|
449
|
+
@api_client.config.logger.debug 'Calling API: CardHolderAccountApi.account_retrieve_request ...'
|
450
|
+
end
|
451
|
+
# verify the required parameter 'accountid' is set
|
452
|
+
if @api_client.config.client_side_validation && accountid.nil?
|
453
|
+
fail ArgumentError, "Missing the required parameter 'accountid' when calling CardHolderAccountApi.account_retrieve_request"
|
454
|
+
end
|
455
|
+
# resource path
|
456
|
+
local_var_path = '/account/{accountid}'.sub('{' + 'accountid' + '}', CGI.escape(accountid.to_s))
|
457
|
+
|
458
|
+
# query parameters
|
459
|
+
query_params = opts[:query_params] || {}
|
460
|
+
|
461
|
+
# header parameters
|
462
|
+
header_params = opts[:header_params] || {}
|
463
|
+
# HTTP header 'Accept' (if needed)
|
464
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
|
465
|
+
|
466
|
+
# form parameters
|
467
|
+
form_params = opts[:form_params] || {}
|
468
|
+
|
469
|
+
# http body (model)
|
470
|
+
post_body = opts[:body]
|
471
|
+
|
472
|
+
# return_type
|
473
|
+
return_type = opts[:return_type] || 'CardHolderAccount'
|
474
|
+
|
475
|
+
# auth_names
|
476
|
+
auth_names = opts[:auth_names] || ['cp-api-key']
|
477
|
+
|
478
|
+
new_options = opts.merge(
|
479
|
+
:header_params => header_params,
|
480
|
+
:query_params => query_params,
|
481
|
+
:form_params => form_params,
|
482
|
+
:body => post_body,
|
483
|
+
:auth_names => auth_names,
|
484
|
+
:return_type => return_type
|
485
|
+
)
|
486
|
+
|
487
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
488
|
+
if @api_client.config.debugging
|
489
|
+
@api_client.config.logger.debug "API called: CardHolderAccountApi#account_retrieve_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
490
|
+
end
|
491
|
+
return data, status_code, headers
|
492
|
+
end
|
493
|
+
|
494
|
+
# Account Status
|
495
|
+
# Updates the status of an account. An account can have the following statuses applied | Status | Description | |--------|-------------| | Active | The account is active for processing | | Disabled | The account has been disabled and cannot be used for processing. The account will require reactivation to continue procesing |
|
496
|
+
# @param accountid [String] The account id that refers to the customer's account no. This value will have been provided when setting up the card holder account.
|
497
|
+
# @param account_status [AccountStatus]
|
498
|
+
# @param [Hash] opts the optional parameters
|
499
|
+
# @return [Acknowledgement]
|
500
|
+
def account_status_request(accountid, account_status, opts = {})
|
501
|
+
data, _status_code, _headers = account_status_request_with_http_info(accountid, account_status, opts)
|
502
|
+
data
|
503
|
+
end
|
504
|
+
|
505
|
+
# Account Status
|
506
|
+
# Updates the status of an account. An account can have the following statuses applied | Status | Description | |--------|-------------| | Active | The account is active for processing | | Disabled | The account has been disabled and cannot be used for processing. The account will require reactivation to continue procesing |
|
507
|
+
# @param accountid [String] The account id that refers to the customer's account no. This value will have been provided when setting up the card holder account.
|
508
|
+
# @param account_status [AccountStatus]
|
509
|
+
# @param [Hash] opts the optional parameters
|
510
|
+
# @return [Array<(Acknowledgement, Integer, Hash)>] Acknowledgement data, response status code and response headers
|
511
|
+
def account_status_request_with_http_info(accountid, account_status, opts = {})
|
512
|
+
if @api_client.config.debugging
|
513
|
+
@api_client.config.logger.debug 'Calling API: CardHolderAccountApi.account_status_request ...'
|
514
|
+
end
|
515
|
+
# verify the required parameter 'accountid' is set
|
516
|
+
if @api_client.config.client_side_validation && accountid.nil?
|
517
|
+
fail ArgumentError, "Missing the required parameter 'accountid' when calling CardHolderAccountApi.account_status_request"
|
518
|
+
end
|
519
|
+
# verify the required parameter 'account_status' is set
|
520
|
+
if @api_client.config.client_side_validation && account_status.nil?
|
521
|
+
fail ArgumentError, "Missing the required parameter 'account_status' when calling CardHolderAccountApi.account_status_request"
|
522
|
+
end
|
523
|
+
# resource path
|
524
|
+
local_var_path = '/account/{accountid}/status'.sub('{' + 'accountid' + '}', CGI.escape(accountid.to_s))
|
525
|
+
|
526
|
+
# query parameters
|
527
|
+
query_params = opts[:query_params] || {}
|
528
|
+
|
529
|
+
# header parameters
|
530
|
+
header_params = opts[:header_params] || {}
|
531
|
+
# HTTP header 'Accept' (if needed)
|
532
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
|
533
|
+
# HTTP header 'Content-Type'
|
534
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/xml'])
|
535
|
+
|
536
|
+
# form parameters
|
537
|
+
form_params = opts[:form_params] || {}
|
538
|
+
|
539
|
+
# http body (model)
|
540
|
+
post_body = opts[:body] || @api_client.object_to_http_body(account_status)
|
541
|
+
|
542
|
+
# return_type
|
543
|
+
return_type = opts[:return_type] || 'Acknowledgement'
|
544
|
+
|
545
|
+
# auth_names
|
546
|
+
auth_names = opts[:auth_names] || ['cp-api-key']
|
547
|
+
|
548
|
+
new_options = opts.merge(
|
549
|
+
:header_params => header_params,
|
550
|
+
:query_params => query_params,
|
551
|
+
:form_params => form_params,
|
552
|
+
:body => post_body,
|
553
|
+
:auth_names => auth_names,
|
554
|
+
:return_type => return_type
|
555
|
+
)
|
556
|
+
|
557
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
558
|
+
if @api_client.config.debugging
|
559
|
+
@api_client.config.logger.debug "API called: CardHolderAccountApi#account_status_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
560
|
+
end
|
561
|
+
return data, status_code, headers
|
562
|
+
end
|
563
|
+
|
564
|
+
# Charge
|
565
|
+
# A charge process obtains an authorisation using a tokenised value which represents a stored card on a card holder account. A card must previously be registered by calling `/account-register-card` with the card details or retrieved using `/account-retrieve` Tokens are generated whenever a previously registered list of cards are retrieved. Each token has, by design a relatively short time to live of 30 minutes. This is both to safe guard the merchant and card holder from replay attacks. Tokens are also restricted to your account, preventing malicious actors from stealing details for use elsewhere. If a token is reused after it has expired it will be rejected and a new token will be required. Tokenisation can be used for - repeat authorisations on a previously stored card - easy authorisations just requiring CSC values to be entered - can be used for credential on file style payments - can require full 3-D Secure authentication to retain the liability shift - wallet style usage.
|
566
|
+
# @param charge_request [ChargeRequest]
|
567
|
+
# @param [Hash] opts the optional parameters
|
568
|
+
# @return [Decision]
|
569
|
+
def charge_request(charge_request, opts = {})
|
570
|
+
data, _status_code, _headers = charge_request_with_http_info(charge_request, opts)
|
571
|
+
data
|
572
|
+
end
|
573
|
+
|
574
|
+
# Charge
|
575
|
+
# A charge process obtains an authorisation using a tokenised value which represents a stored card on a card holder account. A card must previously be registered by calling `/account-register-card` with the card details or retrieved using `/account-retrieve` Tokens are generated whenever a previously registered list of cards are retrieved. Each token has, by design a relatively short time to live of 30 minutes. This is both to safe guard the merchant and card holder from replay attacks. Tokens are also restricted to your account, preventing malicious actors from stealing details for use elsewhere. If a token is reused after it has expired it will be rejected and a new token will be required. Tokenisation can be used for - repeat authorisations on a previously stored card - easy authorisations just requiring CSC values to be entered - can be used for credential on file style payments - can require full 3-D Secure authentication to retain the liability shift - wallet style usage.
|
576
|
+
# @param charge_request [ChargeRequest]
|
577
|
+
# @param [Hash] opts the optional parameters
|
578
|
+
# @return [Array<(Decision, Integer, Hash)>] Decision data, response status code and response headers
|
579
|
+
def charge_request_with_http_info(charge_request, opts = {})
|
580
|
+
if @api_client.config.debugging
|
581
|
+
@api_client.config.logger.debug 'Calling API: CardHolderAccountApi.charge_request ...'
|
582
|
+
end
|
583
|
+
# verify the required parameter 'charge_request' is set
|
584
|
+
if @api_client.config.client_side_validation && charge_request.nil?
|
585
|
+
fail ArgumentError, "Missing the required parameter 'charge_request' when calling CardHolderAccountApi.charge_request"
|
586
|
+
end
|
587
|
+
# resource path
|
588
|
+
local_var_path = '/charge'
|
589
|
+
|
590
|
+
# query parameters
|
591
|
+
query_params = opts[:query_params] || {}
|
592
|
+
|
593
|
+
# header parameters
|
594
|
+
header_params = opts[:header_params] || {}
|
595
|
+
# HTTP header 'Accept' (if needed)
|
596
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
|
597
|
+
# HTTP header 'Content-Type'
|
598
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/xml'])
|
599
|
+
|
600
|
+
# form parameters
|
601
|
+
form_params = opts[:form_params] || {}
|
602
|
+
|
603
|
+
# http body (model)
|
604
|
+
post_body = opts[:body] || @api_client.object_to_http_body(charge_request)
|
605
|
+
|
606
|
+
# return_type
|
607
|
+
return_type = opts[:return_type] || 'Decision'
|
608
|
+
|
609
|
+
# auth_names
|
610
|
+
auth_names = opts[:auth_names] || ['cp-api-key']
|
611
|
+
|
612
|
+
new_options = opts.merge(
|
613
|
+
:header_params => header_params,
|
614
|
+
:query_params => query_params,
|
615
|
+
:form_params => form_params,
|
616
|
+
:body => post_body,
|
617
|
+
:auth_names => auth_names,
|
618
|
+
:return_type => return_type
|
619
|
+
)
|
620
|
+
|
621
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
622
|
+
if @api_client.config.debugging
|
623
|
+
@api_client.config.logger.debug "API called: CardHolderAccountApi#charge_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
624
|
+
end
|
625
|
+
return data, status_code, headers
|
626
|
+
end
|
627
|
+
end
|
628
|
+
end
|