citypay_api_client 1.0.3 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +105 -34
- data/citypay_api_client.gemspec +4 -5
- data/docs/AccountCreate.md +10 -9
- data/docs/AccountStatus.md +8 -7
- data/docs/Acknowledgement.md +14 -13
- data/docs/AclCheckRequest.md +18 -0
- data/docs/AclCheckResponseModel.md +24 -0
- data/docs/AirlineAdvice.md +38 -37
- data/docs/AirlineSegment.md +22 -21
- data/docs/AuthReference.md +34 -33
- data/docs/AuthReferences.md +8 -7
- data/docs/AuthRequest.md +50 -49
- data/docs/AuthResponse.md +60 -59
- data/docs/AuthenRequired.md +12 -11
- data/docs/AuthorisationAndPaymentApi.md +559 -0
- data/docs/Batch.md +22 -0
- data/docs/BatchProcessingApi.md +214 -0
- data/docs/BatchReportRequest.md +20 -0
- data/docs/BatchReportResponseModel.md +28 -0
- data/docs/BatchTransaction.md +24 -0
- data/docs/BatchTransactionResultModel.md +40 -0
- data/docs/Bin.md +34 -0
- data/docs/BinLookup.md +18 -0
- data/docs/CResAuthRequest.md +8 -7
- data/docs/CaptureRequest.md +18 -17
- data/docs/Card.md +46 -41
- data/docs/CardHolderAccount.md +24 -21
- data/docs/CardHolderAccountApi.md +326 -105
- data/docs/CardStatus.md +10 -9
- data/docs/ChargeRequest.md +36 -31
- data/docs/CheckBatchStatus.md +20 -0
- data/docs/CheckBatchStatusResponse.md +18 -0
- data/docs/ContactDetails.md +32 -31
- data/docs/Decision.md +12 -11
- data/docs/DirectPostApi.md +365 -0
- data/docs/DirectPostRequest.md +58 -0
- data/docs/DirectTokenAuthRequest.md +24 -0
- data/docs/DomainKeyCheckRequest.md +18 -0
- data/docs/DomainKeyRequest.md +22 -0
- data/docs/DomainKeyResponse.md +26 -0
- data/docs/Error.md +16 -13
- data/docs/EventDataModel.md +26 -0
- data/docs/Exists.md +22 -0
- data/docs/ExternalMPI.md +16 -15
- data/docs/ListMerchantsResponse.md +12 -11
- data/docs/MCC6012.md +14 -13
- data/docs/Merchant.md +16 -15
- data/docs/OperationalApi.md +124 -22
- data/docs/OperationalFunctionsApi.md +355 -0
- data/docs/PaResAuthRequest.md +10 -9
- data/docs/PaylinkAddress.md +30 -0
- data/docs/PaylinkAdjustmentRequest.md +22 -0
- data/docs/PaylinkApi.md +630 -0
- data/docs/PaylinkAttachmentRequest.md +26 -0
- data/docs/PaylinkAttachmentResult.md +22 -0
- data/docs/PaylinkBillPaymentTokenRequest.md +32 -0
- data/docs/PaylinkCardHolder.md +36 -0
- data/docs/PaylinkCart.md +30 -0
- data/docs/PaylinkCartItemModel.md +32 -0
- data/docs/PaylinkConfig.md +60 -0
- data/docs/PaylinkCustomParam.md +36 -0
- data/docs/PaylinkEmailNotificationPath.md +26 -0
- data/docs/PaylinkErrorCode.md +20 -0
- data/docs/PaylinkFieldGuardModel.md +30 -0
- data/docs/PaylinkPartPayments.md +28 -0
- data/docs/PaylinkSMSNotificationPath.md +20 -0
- data/docs/PaylinkStateEvent.md +22 -0
- data/docs/PaylinkTokenCreated.md +44 -0
- data/docs/PaylinkTokenRequestModel.md +38 -0
- data/docs/PaylinkTokenStatus.md +72 -0
- data/docs/PaylinkTokenStatusChangeRequest.md +26 -0
- data/docs/PaylinkTokenStatusChangeResponse.md +20 -0
- data/docs/PaylinkUI.md +24 -0
- data/docs/PaymentProcessingApi.md +307 -68
- data/docs/Ping.md +8 -7
- data/docs/ProcessBatchRequest.md +24 -0
- data/docs/ProcessBatchResponse.md +20 -0
- data/docs/RefundRequest.md +26 -0
- data/docs/RegisterCard.md +16 -13
- data/docs/RequestChallenged.md +16 -15
- data/docs/RetrieveRequest.md +12 -11
- data/docs/ThreeDSecure.md +32 -15
- data/docs/TokenisationResponseModel.md +36 -0
- data/docs/VoidRequest.md +12 -13
- data/lib/.DS_Store +0 -0
- data/lib/citypay_api_client/api/authorisation_and_payment_api__.rb +565 -0
- data/lib/citypay_api_client/api/batch_processing_api__.rb +225 -0
- data/lib/citypay_api_client/api/{card_holder_account_api.rb → card_holder_account_api__.rb} +136 -46
- data/lib/citypay_api_client/api/direct_post_api__.rb +373 -0
- data/lib/citypay_api_client/api/operational_functions_api__.rb +356 -0
- data/lib/citypay_api_client/api/paylink_api__.rb +614 -0
- data/lib/citypay_api_client/api_client.rb +59 -59
- data/lib/citypay_api_client/api_error.rb +2 -2
- data/lib/citypay_api_client/configuration.rb +53 -15
- data/lib/citypay_api_client/models/account_create.rb +21 -8
- data/lib/citypay_api_client/models/account_status.rb +21 -8
- data/lib/citypay_api_client/models/acknowledgement.rb +21 -8
- data/lib/citypay_api_client/models/acl_check_request.rb +224 -0
- data/lib/citypay_api_client/models/acl_check_response_model.rb +249 -0
- data/lib/citypay_api_client/models/airline_advice.rb +23 -10
- data/lib/citypay_api_client/models/airline_segment.rb +21 -8
- data/lib/citypay_api_client/models/auth_reference.rb +45 -11
- data/lib/citypay_api_client/models/auth_references.rb +21 -8
- data/lib/citypay_api_client/models/auth_request.rb +79 -35
- data/lib/citypay_api_client/models/auth_response.rb +43 -106
- data/lib/citypay_api_client/models/authen_required.rb +21 -8
- data/lib/citypay_api_client/models/batch.rb +264 -0
- data/lib/citypay_api_client/models/batch_report_request.rb +277 -0
- data/lib/citypay_api_client/models/batch_report_response_model.rb +357 -0
- data/lib/citypay_api_client/models/batch_transaction.rb +321 -0
- data/lib/citypay_api_client/models/batch_transaction_result_model.rb +421 -0
- data/lib/citypay_api_client/models/bin.rb +299 -0
- data/lib/citypay_api_client/models/bin_lookup.rb +234 -0
- data/lib/citypay_api_client/models/c_res_auth_request.rb +21 -8
- data/lib/citypay_api_client/models/capture_request.rb +38 -22
- data/lib/citypay_api_client/models/card.rb +67 -10
- data/lib/citypay_api_client/models/card_holder_account.rb +35 -12
- data/lib/citypay_api_client/models/card_status.rb +21 -8
- data/lib/citypay_api_client/models/charge_request.rb +96 -26
- data/lib/citypay_api_client/models/check_batch_status.rb +259 -0
- data/lib/citypay_api_client/models/check_batch_status_response.rb +220 -0
- data/lib/citypay_api_client/models/contact_details.rb +87 -44
- data/lib/citypay_api_client/models/decision.rb +21 -8
- data/lib/citypay_api_client/models/direct_post_request.rb +670 -0
- data/lib/citypay_api_client/models/direct_token_auth_request.rb +249 -0
- data/lib/citypay_api_client/models/domain_key_check_request.rb +252 -0
- data/lib/citypay_api_client/models/domain_key_request.rb +250 -0
- data/lib/citypay_api_client/models/domain_key_response.rb +294 -0
- data/lib/citypay_api_client/models/error.rb +35 -12
- data/lib/citypay_api_client/models/event_data_model.rb +259 -0
- data/lib/citypay_api_client/models/exists.rb +244 -0
- data/lib/citypay_api_client/models/external_mpi.rb +27 -8
- data/lib/citypay_api_client/models/list_merchants_response.rb +21 -8
- data/lib/citypay_api_client/models/mcc6012.rb +21 -8
- data/lib/citypay_api_client/models/merchant.rb +21 -8
- data/lib/citypay_api_client/models/pa_res_auth_request.rb +22 -9
- data/lib/citypay_api_client/models/paylink_address.rb +402 -0
- data/lib/citypay_api_client/models/paylink_adjustment_request.rb +269 -0
- data/lib/citypay_api_client/models/paylink_attachment_request.rb +269 -0
- data/lib/citypay_api_client/models/paylink_attachment_result.rb +249 -0
- data/lib/citypay_api_client/models/paylink_bill_payment_token_request.rb +292 -0
- data/lib/citypay_api_client/models/paylink_card_holder.rb +353 -0
- data/lib/citypay_api_client/models/paylink_cart.rb +280 -0
- data/lib/citypay_api_client/models/paylink_cart_item_model.rb +289 -0
- data/lib/citypay_api_client/models/paylink_config.rb +433 -0
- data/lib/citypay_api_client/models/paylink_custom_param.rb +314 -0
- data/lib/citypay_api_client/models/paylink_email_notification_path.rb +268 -0
- data/lib/citypay_api_client/models/paylink_error_code.rb +239 -0
- data/lib/citypay_api_client/models/paylink_field_guard_model.rb +279 -0
- data/lib/citypay_api_client/models/paylink_part_payments.rb +269 -0
- data/lib/citypay_api_client/models/paylink_sms_notification_path.rb +234 -0
- data/lib/citypay_api_client/models/paylink_state_event.rb +239 -0
- data/lib/citypay_api_client/models/paylink_token_created.rb +364 -0
- data/lib/citypay_api_client/models/paylink_token_request_model.rb +374 -0
- data/lib/citypay_api_client/models/paylink_token_status.rb +490 -0
- data/lib/citypay_api_client/models/paylink_token_status_change_request.rb +270 -0
- data/lib/citypay_api_client/models/paylink_token_status_change_response.rb +235 -0
- data/lib/citypay_api_client/models/paylink_ui.rb +249 -0
- data/lib/citypay_api_client/models/ping.rb +21 -8
- data/lib/citypay_api_client/models/process_batch_request.rb +308 -0
- data/lib/citypay_api_client/models/process_batch_response.rb +234 -0
- data/lib/citypay_api_client/models/refund_request.rb +332 -0
- data/lib/citypay_api_client/models/register_card.rb +59 -12
- data/lib/citypay_api_client/models/request_challenged.rb +29 -16
- data/lib/citypay_api_client/models/retrieve_request.rb +21 -8
- data/lib/citypay_api_client/models/three_d_secure.rb +106 -13
- data/lib/citypay_api_client/models/tokenisation_response_model.rb +333 -0
- data/lib/citypay_api_client/models/void_request.rb +22 -21
- data/lib/citypay_api_client/utils/digest_utils.rb +18 -0
- data/lib/citypay_api_client/utils/direct_post_mac.rb +22 -0
- data/lib/citypay_api_client/version.rb +3 -4
- data/lib/citypay_api_client.rb +53 -6
- data/spec/.DS_Store +0 -0
- data/spec/api/authorisation_and_payment_api___spec.rb +130 -0
- data/spec/api/batch_processing_api___spec.rb +70 -0
- data/spec/api/{card_holder_account_api_spec.rb → card_holder_account_api___spec.rb} +15 -3
- data/spec/api/direct_post_api___spec.rb +98 -0
- data/spec/api/operational_functions_api___spec.rb +94 -0
- data/spec/api/paylink_api___spec.rb +131 -0
- data/spec/api_client_spec.rb +4 -4
- data/spec/configuration_spec.rb +5 -5
- data/spec/it_api_sandbox_spec.rb +126 -58
- data/spec/models/acknowledgement_spec.rb +7 -22
- data/spec/models/acl_check_request_spec.rb +33 -0
- data/spec/models/acl_check_response_model_spec.rb +51 -0
- data/spec/models/auth_references_spec.rb +7 -8
- data/spec/models/auth_response_spec.rb +29 -30
- data/spec/models/batch_report_request_spec.rb +39 -0
- data/spec/models/batch_report_response_model_spec.rb +63 -0
- data/spec/models/batch_spec.rb +45 -0
- data/spec/models/batch_transaction_result_model_spec.rb +87 -0
- data/spec/models/batch_transaction_spec.rb +51 -0
- data/spec/models/bin_lookup_spec.rb +33 -0
- data/spec/models/bin_spec.rb +81 -0
- data/spec/models/card_holder_account_spec.rb +8 -5
- data/spec/models/check_batch_status_response_spec.rb +45 -0
- data/spec/models/check_batch_status_spec.rb +39 -0
- data/spec/models/decision_spec.rb +1 -1
- data/spec/models/direct_post_request_spec.rb +153 -0
- data/spec/models/direct_token_auth_request_spec.rb +51 -0
- data/spec/models/domain_key_check_request_spec.rb +33 -0
- data/spec/models/domain_key_request_spec.rb +45 -0
- data/spec/models/domain_key_response_spec.rb +57 -0
- data/spec/models/event_data_model_spec.rb +57 -0
- data/spec/{api/operational_api_spec.rb → models/exists_spec.rb} +14 -20
- data/spec/models/list_merchants_response_spec.rb +2 -2
- data/spec/models/paylink_address_spec.rb +69 -0
- data/spec/models/paylink_adjustment_request_spec.rb +45 -0
- data/spec/models/paylink_attachment_request_spec.rb +45 -0
- data/spec/models/paylink_attachment_result_spec.rb +45 -0
- data/spec/models/paylink_bill_payment_token_request_spec.rb +63 -0
- data/spec/models/paylink_card_holder_spec.rb +87 -0
- data/spec/models/paylink_cart_item_model_spec.rb +75 -0
- data/spec/models/paylink_cart_spec.rb +69 -0
- data/spec/models/paylink_config_spec.rb +159 -0
- data/spec/models/paylink_custom_param_spec.rb +87 -0
- data/spec/models/paylink_email_notification_path_spec.rb +57 -0
- data/spec/models/paylink_error_code_spec.rb +39 -0
- data/spec/models/paylink_field_guard_model_spec.rb +45 -0
- data/spec/models/paylink_part_payments_spec.rb +63 -0
- data/spec/models/paylink_sms_notification_path_spec.rb +39 -0
- data/spec/models/paylink_state_event_spec.rb +45 -0
- data/spec/models/paylink_token_created_spec.rb +111 -0
- data/spec/models/paylink_token_request_model_spec.rb +93 -0
- data/spec/models/paylink_token_status_change_request_spec.rb +57 -0
- data/spec/models/paylink_token_status_change_response_spec.rb +39 -0
- data/spec/models/paylink_token_status_spec.rb +195 -0
- data/spec/models/paylink_ui_spec.rb +51 -0
- data/spec/models/process_batch_request_spec.rb +51 -0
- data/spec/models/process_batch_response_spec.rb +39 -0
- data/spec/models/refund_request_spec.rb +64 -0
- data/spec/models/tokenisation_response_model_spec.rb +87 -0
- data/spec/spec_helper.rb +2 -2
- data/spec/utils/direct_post_mac_spec.rb +13 -0
- metadata +210 -37
- data/Gemfile.lock +0 -70
- data/git_push.sh +0 -58
- data/lib/citypay_api_client/api/operational_api.rb +0 -147
- data/lib/citypay_api_client/api/payment_processing_api.rb +0 -405
- data/lib/citypay_api_client/test.rb +0 -20
- data/spec/api/payment_processing_api_spec.rb +0 -106
data/spec/api_client_spec.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
=begin
|
2
2
|
#CityPay Payment API
|
3
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
|
4
|
+
# This CityPay API is a HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokinsed payments using Card Holder Accounts. ## Compliance and Security Your application will need to adhere to PCI-DSS standards to operate safely and to meet requirements set out by Visa and MasterCard and the PCI Security Standards Council. These include * Data must be collected using TLS version 1.2 using [strong cryptography](#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive card holder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
|
5
5
|
|
6
6
|
Contact: support@citypay.com
|
7
7
|
Generated by: https://openapi-generator.tech
|
8
|
-
OpenAPI Generator version:
|
8
|
+
OpenAPI Generator version: 6.2.1
|
9
9
|
|
10
10
|
=end
|
11
11
|
|
@@ -196,8 +196,8 @@ describe CityPayApiClient::ApiClient do
|
|
196
196
|
let(:api_client) { CityPayApiClient::ApiClient.new }
|
197
197
|
|
198
198
|
it 'works' do
|
199
|
-
expect(api_client.select_header_content_type(nil)).to
|
200
|
-
expect(api_client.select_header_content_type([])).to
|
199
|
+
expect(api_client.select_header_content_type(nil)).to be_nil
|
200
|
+
expect(api_client.select_header_content_type([])).to be_nil
|
201
201
|
|
202
202
|
expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
|
203
203
|
expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
data/spec/configuration_spec.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
=begin
|
2
2
|
#CityPay Payment API
|
3
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
|
4
|
+
# This CityPay API is a HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokinsed payments using Card Holder Accounts. ## Compliance and Security Your application will need to adhere to PCI-DSS standards to operate safely and to meet requirements set out by Visa and MasterCard and the PCI Security Standards Council. These include * Data must be collected using TLS version 1.2 using [strong cryptography](#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive card holder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
|
5
5
|
|
6
6
|
Contact: support@citypay.com
|
7
7
|
Generated by: https://openapi-generator.tech
|
8
|
-
OpenAPI Generator version:
|
8
|
+
OpenAPI Generator version: 6.2.1
|
9
9
|
|
10
10
|
=end
|
11
11
|
|
@@ -17,7 +17,7 @@ describe CityPayApiClient::Configuration do
|
|
17
17
|
before(:each) do
|
18
18
|
# uncomment below to setup host and base_path
|
19
19
|
# require 'URI'
|
20
|
-
# uri = URI.parse("https://api.citypay.com
|
20
|
+
# uri = URI.parse("https://api.citypay.com")
|
21
21
|
# CityPayApiClient.configure do |c|
|
22
22
|
# c.host = uri.host
|
23
23
|
# c.base_path = uri.path
|
@@ -27,14 +27,14 @@ describe CityPayApiClient::Configuration do
|
|
27
27
|
describe '#base_url' do
|
28
28
|
it 'should have the default value' do
|
29
29
|
# uncomment below to test default value of the base path
|
30
|
-
# expect(config.base_url).to eq("https://api.citypay.com
|
30
|
+
# expect(config.base_url).to eq("https://api.citypay.com")
|
31
31
|
end
|
32
32
|
|
33
33
|
it 'should remove trailing slashes' do
|
34
34
|
[nil, '', '/', '//'].each do |base_path|
|
35
35
|
config.base_path = base_path
|
36
36
|
# uncomment below to test trailing slashes
|
37
|
-
# expect(config.base_url).to eq("https://api.citypay.com
|
37
|
+
# expect(config.base_url).to eq("https://api.citypay.com")
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
data/spec/it_api_sandbox_spec.rb
CHANGED
@@ -2,13 +2,15 @@ require 'spec_helper'
|
|
2
2
|
require 'json'
|
3
3
|
require 'date'
|
4
4
|
require 'securerandom'
|
5
|
-
|
5
|
+
require 'typhoeus'
|
6
|
+
require 'base64'
|
7
|
+
require_relative '../lib/citypay_api_client/utils/digest_utils'
|
6
8
|
|
7
9
|
describe 'IntegrationTests' do
|
8
10
|
|
9
|
-
client_id =
|
10
|
-
licence_key =
|
11
|
-
merchant_id =
|
11
|
+
client_id = "PC222210"
|
12
|
+
licence_key = "SK5K1GQLI7USNET1"
|
13
|
+
merchant_id = "62421955"
|
12
14
|
|
13
15
|
before do
|
14
16
|
|
@@ -17,6 +19,7 @@ describe 'IntegrationTests' do
|
|
17
19
|
config.api_key['cp-api-key'] = CityPayApiClient::ApiKey.new(client_id: client_id, licence_key: licence_key).generate
|
18
20
|
config.debugging = true
|
19
21
|
config.host = "sandbox.citypay.com"
|
22
|
+
config.server_index = 1
|
20
23
|
end
|
21
24
|
cha_api = CityPayApiClient::CardHolderAccountApi.new
|
22
25
|
end
|
@@ -26,35 +29,36 @@ describe 'IntegrationTests' do
|
|
26
29
|
end
|
27
30
|
|
28
31
|
describe 'Can run operational tests' do
|
29
|
-
api_instance = CityPayApiClient::
|
32
|
+
api_instance = CityPayApiClient::OperationalFunctionsApi.new
|
30
33
|
|
31
34
|
it 'should ping and ack' do
|
32
35
|
uuid = SecureRandom.uuid
|
33
36
|
result = api_instance.ping_request(CityPayApiClient::Ping.new(identifier: uuid))
|
34
|
-
expect(result.code
|
35
|
-
expect(result.identifier
|
37
|
+
expect(result.code).to eq("044")
|
38
|
+
expect(result.identifier).to eq(uuid)
|
36
39
|
end
|
37
40
|
|
38
41
|
it 'should list merchants' do
|
39
42
|
result = api_instance.list_merchants_request("default")
|
40
|
-
expect(result.clientid
|
43
|
+
expect(result.clientid ).to eq(client_id)
|
41
44
|
end
|
42
45
|
|
43
46
|
end
|
44
47
|
|
45
48
|
describe 'Run payment processing tests' do
|
46
|
-
api_instance = CityPayApiClient::
|
49
|
+
api_instance = CityPayApiClient::AuthorisationAndPaymentApi.new
|
47
50
|
|
48
51
|
it 'should authorise' do
|
49
52
|
uuid = SecureRandom.uuid
|
50
53
|
result = api_instance.authorisation_request(CityPayApiClient::AuthRequest.new(
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
54
|
+
merchantid: merchant_id,
|
55
|
+
cardnumber: "4000000000000002",
|
56
|
+
csc: "012",
|
57
|
+
expmonth: 12,
|
58
|
+
expyear: 2030,
|
59
|
+
amount: 1395,
|
60
|
+
identifier: uuid,
|
61
|
+
threedsecure: CityPayApiClient::ThreeDSecure.new(tds_policy: "2")
|
58
62
|
))
|
59
63
|
|
60
64
|
expect(result.auth_response).to_not be_nil
|
@@ -63,10 +67,74 @@ describe 'IntegrationTests' do
|
|
63
67
|
|
64
68
|
response = result.auth_response
|
65
69
|
|
66
|
-
expect(response.identifier
|
67
|
-
expect(response.authcode
|
68
|
-
expect(response.amount
|
69
|
-
expect(response.result_code
|
70
|
+
expect(response.identifier).to eq(uuid.to_str)
|
71
|
+
expect(response.authcode).to eq("A12345")
|
72
|
+
expect(response.amount).to eq(1395)
|
73
|
+
expect(response.result_code).to eq("001")
|
74
|
+
|
75
|
+
expect(DigestUtils.validate_digest(response, licence_key)).to eq(true)
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
describe 'Run payment processing tests 3DSv2' do
|
81
|
+
api_instance = CityPayApiClient::AuthorisationAndPaymentApi.new
|
82
|
+
|
83
|
+
it 'should authorise 3DSv2' do
|
84
|
+
uuid = SecureRandom.uuid
|
85
|
+
result = api_instance.authorisation_request(CityPayApiClient::AuthRequest.new(
|
86
|
+
merchantid: merchant_id,
|
87
|
+
cardnumber: "4000000000000002",
|
88
|
+
csc: "123",
|
89
|
+
expmonth: 12,
|
90
|
+
expyear: 2030,
|
91
|
+
amount: 1396,
|
92
|
+
identifier: uuid,
|
93
|
+
trans_type: "A",
|
94
|
+
threedsecure: CityPayApiClient::ThreeDSecure.new(
|
95
|
+
cp_bx: "eyJhIjoiRkFwSCIsImMiOjI0LCJpIjoid3dIOTExTlBKSkdBRVhVZCIsImoiOmZhbHNlLCJsIjoiZW4tVVMiLCJoIjoxNDQwLCJ3IjoyNTYwLCJ0IjowLCJ1IjoiTW96aWxsYS81LjAgKE1hY2ludG9zaDsgSW50ZWwgTWFjIE9TIFggMTFfMl8zKSBBcHBsZVdlYktpdC81MzcuMzYgKEtIVE1MLCBsaWtlIEdlY2tvKSBDaHJvbWUvODkuMC40Mzg5LjgyIFNhZmFyaS81MzcuMzYiLCJ2IjoiMS4wLjAifQ",
|
96
|
+
merchant_termurl: "https://citypay.com/acs/return"
|
97
|
+
)
|
98
|
+
))
|
99
|
+
|
100
|
+
expect(result.auth_response).to be_nil
|
101
|
+
expect(result.authen_required).to be_nil
|
102
|
+
expect(result.request_challenged).to_not be_nil
|
103
|
+
|
104
|
+
response = result.request_challenged
|
105
|
+
|
106
|
+
expect(response.acs_url).to_not be_nil
|
107
|
+
expect(response.creq).to_not be_nil
|
108
|
+
expect(response.threedserver_trans_id).to_not be_nil
|
109
|
+
|
110
|
+
content = {
|
111
|
+
:threeDSSessionData => response.threedserver_trans_id,
|
112
|
+
:creq => response.creq
|
113
|
+
}
|
114
|
+
|
115
|
+
request = Typhoeus::Request.new("https://sandbox.citypay.com/3dsv2/acs",
|
116
|
+
method: :post,
|
117
|
+
headers: {
|
118
|
+
"Content-Type" => "application/json"
|
119
|
+
},
|
120
|
+
body: content.to_json)
|
121
|
+
res = request.run
|
122
|
+
c_res = res.response_body
|
123
|
+
|
124
|
+
expect(c_res['acsTransID']).to_not be_nil
|
125
|
+
expect(c_res['messageType']).to_not be_nil
|
126
|
+
expect(c_res['messageVersion']).to_not be_nil
|
127
|
+
expect(c_res['threeDSServerTransID']).to_not be_nil
|
128
|
+
expect(c_res['transStatus']).to_not be_nil
|
129
|
+
|
130
|
+
c_res_auth_request = CityPayApiClient::CResAuthRequest.new({:cres => Base64.encode64(c_res)})
|
131
|
+
|
132
|
+
c_res_request_response = api_instance.c_res_request(c_res_auth_request)
|
133
|
+
|
134
|
+
expect(c_res_request_response.amount).to eq(1396)
|
135
|
+
expect(c_res_request_response.authcode).to eq("A12345")
|
136
|
+
expect(c_res_request_response.authen_result).to eq("Y")
|
137
|
+
expect(c_res_request_response.authorised).to eq(true)
|
70
138
|
end
|
71
139
|
|
72
140
|
end
|
@@ -79,52 +147,53 @@ describe 'IntegrationTests' do
|
|
79
147
|
it 'should create a new cha' do
|
80
148
|
|
81
149
|
result = api_instance.account_create(CityPayApiClient::AccountCreate.new(
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
150
|
+
account_id: cha_id,
|
151
|
+
contact: CityPayApiClient::ContactDetails.new(
|
152
|
+
address1: "7 Esplanade",
|
153
|
+
area: "St Helier",
|
154
|
+
company: "CityPay Limited",
|
155
|
+
country: "JE",
|
156
|
+
email: "dev@citypay.com",
|
157
|
+
firstname: "Integration",
|
158
|
+
lastname: "Test",
|
159
|
+
postcode: "JE2 3QA"
|
160
|
+
)
|
93
161
|
))
|
94
162
|
|
95
|
-
expect(result.account_id
|
96
|
-
expect(result.contact.address1
|
163
|
+
expect(result.account_id).to eq(cha_id)
|
164
|
+
expect(result.contact.address1).to eq("7 Esplanade")
|
97
165
|
|
98
166
|
end
|
99
167
|
|
100
168
|
it 'should add a card to the account' do
|
101
169
|
result = api_instance.account_card_register_request(cha_id, CityPayApiClient::RegisterCard.new(
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
expect(result.account_id
|
107
|
-
expect(result.cards.length
|
108
|
-
expect(result.cards[0].expmonth
|
109
|
-
expect(result.cards[0].expyear
|
170
|
+
cardnumber: "4000000000000002",
|
171
|
+
expmonth: 12,
|
172
|
+
expyear: 2030,
|
173
|
+
))
|
174
|
+
expect(result.account_id).to eq(cha_id)
|
175
|
+
expect(result.cards.length).to eq(1)
|
176
|
+
expect(result.cards[0].expmonth).to eq(12)
|
177
|
+
expect(result.cards[0].expyear).to eq(2030)
|
110
178
|
|
111
179
|
end
|
112
180
|
|
113
181
|
it 'should retrieve the account and charge against it' do
|
114
182
|
result = api_instance.account_retrieve_request(cha_id)
|
115
|
-
expect(result.account_id
|
116
|
-
expect(result.contact.address1
|
117
|
-
expect(result.cards.length
|
118
|
-
expect(result.cards[0].expmonth
|
119
|
-
expect(result.cards[0].expyear
|
183
|
+
expect(result.account_id).to eq(cha_id)
|
184
|
+
expect(result.contact.address1).to eq("7 Esplanade")
|
185
|
+
expect(result.cards.length).to eq(1)
|
186
|
+
expect(result.cards[0].expmonth).to eq(12)
|
187
|
+
expect(result.cards[0].expyear).to eq(2030)
|
120
188
|
|
121
189
|
uuid = SecureRandom.uuid
|
122
190
|
result2 = api_instance.charge_request(CityPayApiClient::ChargeRequest.new(
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
191
|
+
amount: 7801,
|
192
|
+
csc: "012",
|
193
|
+
merchantid: merchant_id,
|
194
|
+
identifier: uuid,
|
195
|
+
threedsecure: CityPayApiClient::ThreeDSecure.new(tds_policy: "2"),
|
196
|
+
token: result.cards[0].token
|
128
197
|
))
|
129
198
|
|
130
199
|
# decision object returned
|
@@ -134,10 +203,10 @@ describe 'IntegrationTests' do
|
|
134
203
|
|
135
204
|
response = result2.auth_response
|
136
205
|
|
137
|
-
expect(response.identifier
|
138
|
-
expect(response.authcode
|
139
|
-
expect(response.amount
|
140
|
-
expect(response.result_code
|
206
|
+
expect(response.identifier).to eq(uuid.to_str)
|
207
|
+
expect(response.authcode).to eq("A12345")
|
208
|
+
expect(response.amount).to eq(7801)
|
209
|
+
expect(response.result_code).to eq("001")
|
141
210
|
|
142
211
|
end
|
143
212
|
|
@@ -145,10 +214,9 @@ describe 'IntegrationTests' do
|
|
145
214
|
it 'should delete the cha' do
|
146
215
|
|
147
216
|
result = api_instance.account_delete_request(cha_id)
|
148
|
-
|
217
|
+
expect(result.code).to eq("001")
|
149
218
|
end
|
150
219
|
|
151
220
|
end
|
152
221
|
|
153
|
-
|
154
|
-
end
|
222
|
+
end
|
@@ -19,7 +19,7 @@ require 'date'
|
|
19
19
|
describe 'Acknowledgement' do
|
20
20
|
before do
|
21
21
|
# run before each test
|
22
|
-
|
22
|
+
json = '
|
23
23
|
{
|
24
24
|
"code": "000",
|
25
25
|
"context": "1B12WmDZB3EYSbb",
|
@@ -28,17 +28,7 @@ describe 'Acknowledgement' do
|
|
28
28
|
}
|
29
29
|
'
|
30
30
|
|
31
|
-
|
32
|
-
{ "Acknowledgement": {
|
33
|
-
"code": "000",
|
34
|
-
"context": "1B12WmDZB3EYSbb",
|
35
|
-
"identifier": "testIdentifier",
|
36
|
-
"message": "System: Accepted Transaction"
|
37
|
-
}}
|
38
|
-
'
|
39
|
-
|
40
|
-
@instance1 = CityPayApiClient::ApiClient.new.convert_to_type(JSON.parse(json1, :symbolize_names => true), "Acknowledgement")
|
41
|
-
@instance2 = CityPayApiClient::ApiClient.new.convert_to_type(JSON.parse(json2, :symbolize_names => true), "Acknowledgement")
|
31
|
+
@instance = CityPayApiClient::ApiClient.new.convert_to_type(JSON.parse(json, :symbolize_names => true), "Acknowledgement")
|
42
32
|
end
|
43
33
|
|
44
34
|
after do
|
@@ -47,35 +37,30 @@ describe 'Acknowledgement' do
|
|
47
37
|
|
48
38
|
describe 'test an instance of Acknowledgement' do
|
49
39
|
it 'should create an instance of Acknowledgement' do
|
50
|
-
expect(@
|
51
|
-
expect(@instance2).to be_instance_of(CityPayApiClient::Acknowledgement)
|
40
|
+
expect(@instance).to be_instance_of(CityPayApiClient::Acknowledgement)
|
52
41
|
end
|
53
42
|
end
|
54
43
|
describe 'test attribute "code"' do
|
55
44
|
it 'should work' do
|
56
|
-
expect(@
|
57
|
-
expect(@instance2.code).to eq("000")
|
45
|
+
expect(@instance.code).to eq("000")
|
58
46
|
end
|
59
47
|
end
|
60
48
|
|
61
49
|
describe 'test attribute "context"' do
|
62
50
|
it 'should work' do
|
63
|
-
expect(@
|
64
|
-
expect(@instance2.context).to eq("1B12WmDZB3EYSbb")
|
51
|
+
expect(@instance.context).to eq("1B12WmDZB3EYSbb")
|
65
52
|
end
|
66
53
|
end
|
67
54
|
|
68
55
|
describe 'test attribute "identifier"' do
|
69
56
|
it 'should work' do
|
70
|
-
expect(@
|
71
|
-
expect(@instance2.identifier).to eq("testIdentifier")
|
57
|
+
expect(@instance.identifier).to eq("testIdentifier")
|
72
58
|
end
|
73
59
|
end
|
74
60
|
|
75
61
|
describe 'test attribute "message"' do
|
76
62
|
it 'should work' do
|
77
|
-
expect(@
|
78
|
-
expect(@instance2.message).to eq("System: Accepted Transaction")
|
63
|
+
expect(@instance.message).to eq("System: Accepted Transaction")
|
79
64
|
end
|
80
65
|
end
|
81
66
|
|
@@ -0,0 +1,33 @@
|
|
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
|
+
Contact: support@citypay.com
|
7
|
+
Generated by: https://openapi-generator.tech
|
8
|
+
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
9
|
+
|
10
|
+
=end
|
11
|
+
|
12
|
+
require 'spec_helper'
|
13
|
+
require 'json'
|
14
|
+
require 'date'
|
15
|
+
|
16
|
+
# Unit tests for CityPayApiClient::AclCheckRequest
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe CityPayApiClient::AclCheckRequest do
|
20
|
+
let(:instance) { CityPayApiClient::AclCheckRequest.new }
|
21
|
+
|
22
|
+
describe 'test an instance of AclCheckRequest' do
|
23
|
+
it 'should create an instance of AclCheckRequest' do
|
24
|
+
expect(instance).to be_instance_of(CityPayApiClient::AclCheckRequest)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
describe 'test attribute "ip"' do
|
28
|
+
it 'should work' do
|
29
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
@@ -0,0 +1,51 @@
|
|
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
|
+
Contact: support@citypay.com
|
7
|
+
Generated by: https://openapi-generator.tech
|
8
|
+
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
9
|
+
|
10
|
+
=end
|
11
|
+
|
12
|
+
require 'spec_helper'
|
13
|
+
require 'json'
|
14
|
+
require 'date'
|
15
|
+
|
16
|
+
# Unit tests for CityPayApiClient::AclCheckResponseModel
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe CityPayApiClient::AclCheckResponseModel do
|
20
|
+
let(:instance) { CityPayApiClient::AclCheckResponseModel.new }
|
21
|
+
|
22
|
+
describe 'test an instance of AclCheckResponseModel' do
|
23
|
+
it 'should create an instance of AclCheckResponseModel' do
|
24
|
+
expect(instance).to be_instance_of(CityPayApiClient::AclCheckResponseModel)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
describe 'test attribute "acl"' do
|
28
|
+
it 'should work' do
|
29
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
describe 'test attribute "cache"' do
|
34
|
+
it 'should work' do
|
35
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
describe 'test attribute "ip"' do
|
40
|
+
it 'should work' do
|
41
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
describe 'test attribute "provider"' do
|
46
|
+
it 'should work' do
|
47
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
@@ -20,13 +20,12 @@ describe 'AuthReferences' do
|
|
20
20
|
before do
|
21
21
|
# run before each test
|
22
22
|
|
23
|
-
json ='
|
23
|
+
json = '
|
24
24
|
{
|
25
|
-
"AuthReferences": {
|
26
25
|
"auths": [
|
27
26
|
{
|
28
|
-
"amount": 12,
|
29
|
-
"amount_value":
|
27
|
+
"amount": "0.12",
|
28
|
+
"amount_value": 12,
|
30
29
|
"atrn": null,
|
31
30
|
"authcode": "A12345",
|
32
31
|
"batchno": null,
|
@@ -41,8 +40,8 @@ describe 'AuthReferences' do
|
|
41
40
|
"transno": 88
|
42
41
|
}
|
43
42
|
]
|
44
|
-
}
|
45
43
|
}'
|
44
|
+
|
46
45
|
data = JSON.parse(json, :symbolize_names => true)
|
47
46
|
@instance = CityPayApiClient::ApiClient.new.convert_to_type(data, "AuthReferences")
|
48
47
|
end
|
@@ -60,13 +59,13 @@ describe 'AuthReferences' do
|
|
60
59
|
it 'should work' do
|
61
60
|
expect(@instance.auths.length).to eq(1)
|
62
61
|
i = @instance.auths[0]
|
63
|
-
expect(i.amount).to eq(12)
|
64
|
-
expect(i.amount_value).to eq(
|
62
|
+
expect(i.amount).to eq("0.12")
|
63
|
+
expect(i.amount_value).to eq(12)
|
65
64
|
expect(i.atrn).to eq(nil)
|
66
65
|
expect(i.authcode).to eq("A12345")
|
67
66
|
expect(i.batchno).to eq(nil)
|
68
67
|
expect(i.currency).to eq("GBP")
|
69
|
-
expect(i.datetime).to eq(
|
68
|
+
expect(i.datetime).to eq(Time.parse("2020-07-21T15:55:04Z"))
|
70
69
|
expect(i.identifier).to eq("TestingAPI")
|
71
70
|
expect(i.maskedpan).to eq("400000******0000")
|
72
71
|
expect(i.merchantid).to eq(12345678)
|
@@ -19,37 +19,36 @@ require 'date'
|
|
19
19
|
describe 'AuthResponse' do
|
20
20
|
before do
|
21
21
|
# run before each test
|
22
|
+
|
22
23
|
json = '
|
23
24
|
{
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
"transno": 74875
|
52
|
-
}
|
25
|
+
"amount": 5500,
|
26
|
+
"atrn": "atrn1",
|
27
|
+
"atsd": "a",
|
28
|
+
"authcode": "12345",
|
29
|
+
"authen_result": "R",
|
30
|
+
"authorised": true,
|
31
|
+
"avs_result": "G",
|
32
|
+
"bin_commercial": false,
|
33
|
+
"bin_debit": false,
|
34
|
+
"bin_description": "bin_desc",
|
35
|
+
"cavv": "cavvvvvvvvvvvvv",
|
36
|
+
"context": "20200812075906AAAGV4",
|
37
|
+
"csc_result": "C",
|
38
|
+
"currency": "GBP",
|
39
|
+
"datetime": "2020-08-12T07:59:11Z",
|
40
|
+
"eci": "0",
|
41
|
+
"identifier": "ident1",
|
42
|
+
"live": true,
|
43
|
+
"maskedpan": "400000******0002",
|
44
|
+
"merchantid": 12345,
|
45
|
+
"result": 1,
|
46
|
+
"result_code": "000",
|
47
|
+
"result_message": "System: Accepted Transaction",
|
48
|
+
"scheme": "VISA_BUSINESS",
|
49
|
+
"sha256": "abcdefg",
|
50
|
+
"trans_status": "P",
|
51
|
+
"transno": 74875
|
53
52
|
}
|
54
53
|
'
|
55
54
|
data = JSON.parse(json, :symbolize_names => true)
|
@@ -151,7 +150,7 @@ describe 'AuthResponse' do
|
|
151
150
|
|
152
151
|
describe 'test attribute "datetime"' do
|
153
152
|
it 'should work' do
|
154
|
-
expect(@instance.datetime).to eq(
|
153
|
+
expect(@instance.datetime).to eq(Time.parse("2020-08-12T07:59:11Z"))
|
155
154
|
end
|
156
155
|
end
|
157
156
|
|