first_data_gateway 1.0.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 +7 -0
- data/Gemfile +7 -0
- data/README.md +123 -0
- data/Rakefile +8 -0
- data/docs/AccessTokenResponse.md +11 -0
- data/docs/Address.md +14 -0
- data/docs/Airline.md +21 -0
- data/docs/AirlineAncillaryServiceCategory.md +8 -0
- data/docs/AirlineTravelRoute.md +16 -0
- data/docs/Amount.md +10 -0
- data/docs/AmountComponents.md +14 -0
- data/docs/AuthenticationApi.md +68 -0
- data/docs/AuthenticationResponseVerification.md +10 -0
- data/docs/BasketItem.md +11 -0
- data/docs/Billing.md +13 -0
- data/docs/CarRental.md +15 -0
- data/docs/CarRentalExtraCharges.md +8 -0
- data/docs/CardVerificationsTransaction.md +9 -0
- data/docs/ClientLocale.md +9 -0
- data/docs/Contact.md +11 -0
- data/docs/Error.md +10 -0
- data/docs/ErrorDetails.md +9 -0
- data/docs/ErrorResponse.md +11 -0
- data/docs/Expiration.md +9 -0
- data/docs/Frequency.md +9 -0
- data/docs/IndustrySpecificExtensions.md +10 -0
- data/docs/InstallmentOptions.md +10 -0
- data/docs/Lodging.md +12 -0
- data/docs/LodgingExtraCharges.md +8 -0
- data/docs/Order.md +10 -0
- data/docs/OrderApi.md +148 -0
- data/docs/PayPal.md +8 -0
- data/docs/PaymentApi.md +345 -0
- data/docs/PaymentCard.md +15 -0
- data/docs/PaymentCardAuthenticationRequest.md +8 -0
- data/docs/PaymentCardAuthenticationResult.md +12 -0
- data/docs/PaymentMethod.md +11 -0
- data/docs/PaymentSchedulesRequest.md +21 -0
- data/docs/PaymentSchedulesResponse.md +11 -0
- data/docs/PaymentUrlRequest.md +11 -0
- data/docs/PaymentUrlResponse.md +13 -0
- data/docs/PrimaryTransaction.md +18 -0
- data/docs/PrimaryTransactionAdditionalDetails.md +14 -0
- data/docs/ProcessorData.md +10 -0
- data/docs/ResponseType.md +7 -0
- data/docs/SecondaryTransaction.md +9 -0
- data/docs/Sepa.md +12 -0
- data/docs/SepaMandate.md +11 -0
- data/docs/Shipping.md +10 -0
- data/docs/SplitShipment.md +9 -0
- data/docs/StoredCredential.md +11 -0
- data/docs/TransactionErrorResponse.md +28 -0
- data/docs/TransactionResponse.md +27 -0
- data/docs/TransactionResponseAuthenticationRedirect.md +10 -0
- data/docs/TransactionResponseAuthenticationRedirectParams.md +10 -0
- data/docs/TransactionType.md +7 -0
- data/first_data_gateway.gemspec +45 -0
- data/git_push.sh +55 -0
- data/lib/simple/client_context.rb +15 -0
- data/lib/simple/gateway.rb +155 -0
- data/lib/simple/merchant_credentials.rb +10 -0
- data/lib/simple/signature.rb +52 -0
- data/lib/simple_client.rb +4 -0
- data/lib/swagger_client.rb +91 -0
- data/lib/swagger_client/api/authentication_api.rb +111 -0
- data/lib/swagger_client/api/order_api.rb +229 -0
- data/lib/swagger_client/api/payment_api.rb +517 -0
- data/lib/swagger_client/api_client.rb +390 -0
- data/lib/swagger_client/api_error.rb +38 -0
- data/lib/swagger_client/configuration.rb +202 -0
- data/lib/swagger_client/models/access_token_response.rb +252 -0
- data/lib/swagger_client/models/address.rb +361 -0
- data/lib/swagger_client/models/airline.rb +487 -0
- data/lib/swagger_client/models/airline_ancillary_service_category.rb +221 -0
- data/lib/swagger_client/models/airline_travel_route.rb +406 -0
- data/lib/swagger_client/models/amount.rb +217 -0
- data/lib/swagger_client/models/amount_components.rb +242 -0
- data/lib/swagger_client/models/authentication_response_verification.rb +239 -0
- data/lib/swagger_client/models/basket_item.rb +218 -0
- data/lib/swagger_client/models/billing.rb +282 -0
- data/lib/swagger_client/models/car_rental.rb +317 -0
- data/lib/swagger_client/models/car_rental_extra_charges.rb +221 -0
- data/lib/swagger_client/models/card_verifications_transaction.rb +203 -0
- data/lib/swagger_client/models/client_locale.rb +209 -0
- data/lib/swagger_client/models/contact.rb +279 -0
- data/lib/swagger_client/models/error.rb +211 -0
- data/lib/swagger_client/models/error_details.rb +199 -0
- data/lib/swagger_client/models/error_response.rb +218 -0
- data/lib/swagger_client/models/expiration.rb +207 -0
- data/lib/swagger_client/models/frequency.rb +270 -0
- data/lib/swagger_client/models/industry_specific_extensions.rb +206 -0
- data/lib/swagger_client/models/installment_options.rb +259 -0
- data/lib/swagger_client/models/lodging.rb +245 -0
- data/lib/swagger_client/models/lodging_extra_charges.rb +221 -0
- data/lib/swagger_client/models/order.rb +206 -0
- data/lib/swagger_client/models/pay_pal.rb +213 -0
- data/lib/swagger_client/models/payment_card.rb +294 -0
- data/lib/swagger_client/models/payment_card_authentication_request.rb +222 -0
- data/lib/swagger_client/models/payment_card_authentication_result.rb +336 -0
- data/lib/swagger_client/models/payment_method.rb +254 -0
- data/lib/swagger_client/models/payment_schedules_request.rb +398 -0
- data/lib/swagger_client/models/payment_schedules_response.rb +267 -0
- data/lib/swagger_client/models/payment_url_request.rb +232 -0
- data/lib/swagger_client/models/payment_url_response.rb +286 -0
- data/lib/swagger_client/models/primary_transaction.rb +298 -0
- data/lib/swagger_client/models/primary_transaction_additional_details.rb +244 -0
- data/lib/swagger_client/models/processor_data.rb +216 -0
- data/lib/swagger_client/models/response_type.rb +37 -0
- data/lib/swagger_client/models/secondary_transaction.rb +197 -0
- data/lib/swagger_client/models/sepa.rb +321 -0
- data/lib/swagger_client/models/sepa_mandate.rb +321 -0
- data/lib/swagger_client/models/shipping.rb +222 -0
- data/lib/swagger_client/models/split_shipment.rb +201 -0
- data/lib/swagger_client/models/stored_credential.rb +290 -0
- data/lib/swagger_client/models/transaction_error_response.rb +445 -0
- data/lib/swagger_client/models/transaction_response.rb +436 -0
- data/lib/swagger_client/models/transaction_response_authentication_redirect.rb +239 -0
- data/lib/swagger_client/models/transaction_response_authentication_redirect_params.rb +206 -0
- data/lib/swagger_client/models/transaction_type.rb +36 -0
- data/lib/swagger_client/version.rb +15 -0
- data/spec/api/authentication_api_spec.rb +51 -0
- data/spec/api/order_api_spec.rb +73 -0
- data/spec/api/payment_api_spec.rb +126 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/access_token_response_spec.rb +64 -0
- data/spec/models/address_spec.rb +78 -0
- data/spec/models/airline_ancillary_service_category_spec.rb +46 -0
- data/spec/models/airline_spec.rb +124 -0
- data/spec/models/airline_travel_route_spec.rb +94 -0
- data/spec/models/amount_components_spec.rb +78 -0
- data/spec/models/amount_spec.rb +54 -0
- data/spec/models/authentication_response_verification_spec.rb +58 -0
- data/spec/models/basket_item_spec.rb +60 -0
- data/spec/models/billing_spec.rb +76 -0
- data/spec/models/car_rental_extra_charges_spec.rb +46 -0
- data/spec/models/car_rental_spec.rb +84 -0
- data/spec/models/card_verifications_transaction_spec.rb +48 -0
- data/spec/models/client_locale_spec.rb +48 -0
- data/spec/models/contact_spec.rb +60 -0
- data/spec/models/error_details_spec.rb +48 -0
- data/spec/models/error_response_spec.rb +60 -0
- data/spec/models/error_spec.rb +54 -0
- data/spec/models/expiration_spec.rb +48 -0
- data/spec/models/frequency_spec.rb +52 -0
- data/spec/models/industry_specific_extensions_spec.rb +54 -0
- data/spec/models/installment_options_spec.rb +54 -0
- data/spec/models/lodging_extra_charges_spec.rb +46 -0
- data/spec/models/lodging_spec.rb +66 -0
- data/spec/models/order_spec.rb +54 -0
- data/spec/models/pay_pal_spec.rb +42 -0
- data/spec/models/payment_card_authentication_request_spec.rb +46 -0
- data/spec/models/payment_card_authentication_result_spec.rb +78 -0
- data/spec/models/payment_card_spec.rb +88 -0
- data/spec/models/payment_method_spec.rb +64 -0
- data/spec/models/payment_schedules_request_spec.rb +124 -0
- data/spec/models/payment_schedules_response_spec.rb +64 -0
- data/spec/models/payment_url_request_spec.rb +60 -0
- data/spec/models/payment_url_response_spec.rb +76 -0
- data/spec/models/primary_transaction_additional_details_spec.rb +78 -0
- data/spec/models/primary_transaction_spec.rb +102 -0
- data/spec/models/processor_data_spec.rb +54 -0
- data/spec/models/response_type_spec.rb +36 -0
- data/spec/models/secondary_transaction_spec.rb +48 -0
- data/spec/models/sepa_mandate_spec.rb +64 -0
- data/spec/models/sepa_spec.rb +66 -0
- data/spec/models/shipping_spec.rb +54 -0
- data/spec/models/split_shipment_spec.rb +48 -0
- data/spec/models/stored_credential_spec.rb +68 -0
- data/spec/models/transaction_error_response_spec.rb +170 -0
- data/spec/models/transaction_response_authentication_redirect_params_spec.rb +54 -0
- data/spec/models/transaction_response_authentication_redirect_spec.rb +58 -0
- data/spec/models/transaction_response_spec.rb +164 -0
- data/spec/models/transaction_type_spec.rb +36 -0
- data/spec/spec_helper.rb +111 -0
- metadata +457 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Payment Gateway API Specification
|
|
3
|
+
|
|
4
|
+
#Payment Gateway API for payment processing.
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 0.0.1
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: unset
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
module SwaggerClient
|
|
14
|
+
VERSION = "1.0.1"
|
|
15
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Payment Gateway API Specification
|
|
3
|
+
|
|
4
|
+
#Payment Gateway API for payment processing.
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 0.0.1
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: unset
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
|
|
16
|
+
# Unit tests for SwaggerClient::AuthenticationApi
|
|
17
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'AuthenticationApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@instance = SwaggerClient::AuthenticationApi.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of AuthenticationApi' do
|
|
30
|
+
it 'should create an instance of AuthenticationApi' do
|
|
31
|
+
expect(@instance).to be_instance_of(SwaggerClient::AuthenticationApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for v1_authentication_access_tokens_post
|
|
36
|
+
# Generate an access token for user authentication
|
|
37
|
+
# This is the access token generation call for authorizing subsequent financial transactions. A valid access token is required for web client requests.
|
|
38
|
+
# @param content_type content type
|
|
39
|
+
# @param client_request_id A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format.
|
|
40
|
+
# @param api_key
|
|
41
|
+
# @param timestamp Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).
|
|
42
|
+
# @param message_signature Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal.
|
|
43
|
+
# @param [Hash] opts the optional parameters
|
|
44
|
+
# @return [AccessTokenResponse]
|
|
45
|
+
describe 'v1_authentication_access_tokens_post test' 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
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Payment Gateway API Specification
|
|
3
|
+
|
|
4
|
+
#Payment Gateway API for payment processing.
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 0.0.1
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: unset
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
|
|
16
|
+
# Unit tests for SwaggerClient::OrderApi
|
|
17
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'OrderApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@instance = SwaggerClient::OrderApi.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of OrderApi' do
|
|
30
|
+
it 'should create an instance of OrderApi' do
|
|
31
|
+
expect(@instance).to be_instance_of(SwaggerClient::OrderApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for perform_payment_post_authorisation
|
|
36
|
+
# Use this to capture/complete a transaction. Partial postauths are allowed.
|
|
37
|
+
# This can be used for postauth and partial postauths.
|
|
38
|
+
# @param content_type content type
|
|
39
|
+
# @param client_request_id A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format.
|
|
40
|
+
# @param api_key
|
|
41
|
+
# @param timestamp Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).
|
|
42
|
+
# @param message_signature Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal.
|
|
43
|
+
# @param order_id Gateway order identifier as returned in the parameter orderId
|
|
44
|
+
# @param payload
|
|
45
|
+
# @param [Hash] opts the optional parameters
|
|
46
|
+
# @option opts [String] :store_id an optional outlet id for clients that support multiple store in the same developer app
|
|
47
|
+
# @return [TransactionResponse]
|
|
48
|
+
describe 'perform_payment_post_authorisation test' do
|
|
49
|
+
it "should work" do
|
|
50
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# unit tests for return_transaction
|
|
55
|
+
# Use this to return/refund on the order. Partial returns are allowed.
|
|
56
|
+
# This can be used for Returns and Partial Returns.
|
|
57
|
+
# @param content_type content type
|
|
58
|
+
# @param client_request_id A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format.
|
|
59
|
+
# @param api_key
|
|
60
|
+
# @param timestamp Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).
|
|
61
|
+
# @param message_signature Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal.
|
|
62
|
+
# @param order_id Gateway order identifier as returned in the parameter orderId
|
|
63
|
+
# @param payload
|
|
64
|
+
# @param [Hash] opts the optional parameters
|
|
65
|
+
# @option opts [String] :store_id an optional outlet id for clients that support multiple store in the same developer app
|
|
66
|
+
# @return [TransactionResponse]
|
|
67
|
+
describe 'return_transaction test' do
|
|
68
|
+
it "should work" do
|
|
69
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
end
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Payment Gateway API Specification
|
|
3
|
+
|
|
4
|
+
#Payment Gateway API for payment processing.
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 0.0.1
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: unset
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
|
|
16
|
+
# Unit tests for SwaggerClient::PaymentApi
|
|
17
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'PaymentApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@instance = SwaggerClient::PaymentApi.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of PaymentApi' do
|
|
30
|
+
it 'should create an instance of PaymentApi' do
|
|
31
|
+
expect(@instance).to be_instance_of(SwaggerClient::PaymentApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for perform_payment_post_authorisation
|
|
36
|
+
# Use this to capture/complete a transaction. Partial postauths are allowed.
|
|
37
|
+
# This can be used for postauth and partial postauths.
|
|
38
|
+
# @param content_type content type
|
|
39
|
+
# @param client_request_id A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format.
|
|
40
|
+
# @param api_key
|
|
41
|
+
# @param timestamp Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).
|
|
42
|
+
# @param message_signature Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal.
|
|
43
|
+
# @param transaction_id Gateway transaction identifier as returned in the parameter ipgTransactionId
|
|
44
|
+
# @param payload
|
|
45
|
+
# @param [Hash] opts the optional parameters
|
|
46
|
+
# @option opts [String] :store_id an optional outlet id for clients that support multiple store in the same developer app
|
|
47
|
+
# @return [TransactionResponse]
|
|
48
|
+
describe 'perform_payment_post_authorisation test' do
|
|
49
|
+
it "should work" do
|
|
50
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# unit tests for primary_payment_transaction
|
|
55
|
+
# Generate a primary transaction
|
|
56
|
+
# Use this to originate a financial transaction, like a sale, preauthorization, or credit.
|
|
57
|
+
# @param content_type content type
|
|
58
|
+
# @param client_request_id A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format.
|
|
59
|
+
# @param api_key
|
|
60
|
+
# @param timestamp Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).
|
|
61
|
+
# @param message_signature Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal.
|
|
62
|
+
# @param payload Primary Transaction request
|
|
63
|
+
# @param [Hash] opts the optional parameters
|
|
64
|
+
# @return [TransactionResponse]
|
|
65
|
+
describe 'primary_payment_transaction test' do
|
|
66
|
+
it "should work" do
|
|
67
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# unit tests for return_transaction
|
|
72
|
+
# Return/refund a transaction.
|
|
73
|
+
# Use this to return/refund an existing transaction. Partial returns are allowed.
|
|
74
|
+
# @param content_type content type
|
|
75
|
+
# @param client_request_id A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format.
|
|
76
|
+
# @param api_key
|
|
77
|
+
# @param timestamp Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).
|
|
78
|
+
# @param message_signature Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal.
|
|
79
|
+
# @param transaction_id Gateway transaction identifier as returned in the parameter ipgTransactionId
|
|
80
|
+
# @param payload
|
|
81
|
+
# @param [Hash] opts the optional parameters
|
|
82
|
+
# @option opts [String] :store_id an optional outlet id for clients that support multiple store in the same developer app
|
|
83
|
+
# @return [TransactionResponse]
|
|
84
|
+
describe 'return_transaction test' do
|
|
85
|
+
it "should work" do
|
|
86
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# unit tests for transaction_inquiry
|
|
91
|
+
# Retrieve the state of a transaction
|
|
92
|
+
# Use this query to get the current state of an existing transaction.
|
|
93
|
+
# @param content_type content type
|
|
94
|
+
# @param client_request_id A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format.
|
|
95
|
+
# @param api_key
|
|
96
|
+
# @param timestamp Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).
|
|
97
|
+
# @param message_signature Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal.
|
|
98
|
+
# @param transaction_id Gateway transaction identifier as returned in the parameter ipgTransactionId
|
|
99
|
+
# @param [Hash] opts the optional parameters
|
|
100
|
+
# @option opts [String] :store_id an optional outlet id for clients that support multiple store in the same developer app
|
|
101
|
+
# @return [TransactionResponse]
|
|
102
|
+
describe 'transaction_inquiry test' do
|
|
103
|
+
it "should work" do
|
|
104
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# unit tests for void_transaction
|
|
109
|
+
# Reverse a previous action on an existing transaction
|
|
110
|
+
# Use this to reverse a postauth/completion, credit, preauth, or sale.
|
|
111
|
+
# @param content_type content type
|
|
112
|
+
# @param client_request_id A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format.
|
|
113
|
+
# @param api_key
|
|
114
|
+
# @param timestamp Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).
|
|
115
|
+
# @param message_signature Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal.
|
|
116
|
+
# @param transaction_id Gateway transaction identifier as returned in the parameter ipgTransactionId
|
|
117
|
+
# @param [Hash] opts the optional parameters
|
|
118
|
+
# @option opts [String] :store_id an optional outlet id for clients that support multiple store in the same developer app
|
|
119
|
+
# @return [TransactionResponse]
|
|
120
|
+
describe 'void_transaction test' do
|
|
121
|
+
it "should work" do
|
|
122
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
end
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Payment Gateway API Specification
|
|
3
|
+
|
|
4
|
+
#Payment Gateway API for payment processing.
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 0.0.1
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: unset
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
|
|
15
|
+
describe SwaggerClient::ApiClient do
|
|
16
|
+
context 'initialization' do
|
|
17
|
+
context 'URL stuff' do
|
|
18
|
+
context 'host' do
|
|
19
|
+
it 'removes http from host' do
|
|
20
|
+
SwaggerClient.configure { |c| c.host = 'http://example.com' }
|
|
21
|
+
expect(SwaggerClient::Configuration.default.host).to eq('example.com')
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
it 'removes https from host' do
|
|
25
|
+
SwaggerClient.configure { |c| c.host = 'https://wookiee.com' }
|
|
26
|
+
expect(SwaggerClient::ApiClient.default.config.host).to eq('wookiee.com')
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
it 'removes trailing path from host' do
|
|
30
|
+
SwaggerClient.configure { |c| c.host = 'hobo.com/v4' }
|
|
31
|
+
expect(SwaggerClient::Configuration.default.host).to eq('hobo.com')
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
context 'base_path' do
|
|
36
|
+
it "prepends a slash to base_path" do
|
|
37
|
+
SwaggerClient.configure { |c| c.base_path = 'v4/dog' }
|
|
38
|
+
expect(SwaggerClient::Configuration.default.base_path).to eq('/v4/dog')
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
it "doesn't prepend a slash if one is already there" do
|
|
42
|
+
SwaggerClient.configure { |c| c.base_path = '/v4/dog' }
|
|
43
|
+
expect(SwaggerClient::Configuration.default.base_path).to eq('/v4/dog')
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
it "ends up as a blank string if nil" do
|
|
47
|
+
SwaggerClient.configure { |c| c.base_path = nil }
|
|
48
|
+
expect(SwaggerClient::Configuration.default.base_path).to eq('')
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
describe "params_encoding in #build_request" do
|
|
55
|
+
let(:config) { SwaggerClient::Configuration.new }
|
|
56
|
+
let(:api_client) { SwaggerClient::ApiClient.new(config) }
|
|
57
|
+
|
|
58
|
+
it "defaults to nil" do
|
|
59
|
+
expect(SwaggerClient::Configuration.default.params_encoding).to eq(nil)
|
|
60
|
+
expect(config.params_encoding).to eq(nil)
|
|
61
|
+
|
|
62
|
+
request = api_client.build_request(:get, '/test')
|
|
63
|
+
expect(request.options[:params_encoding]).to eq(nil)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
it "can be customized" do
|
|
67
|
+
config.params_encoding = :multi
|
|
68
|
+
request = api_client.build_request(:get, '/test')
|
|
69
|
+
expect(request.options[:params_encoding]).to eq(:multi)
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
describe "timeout in #build_request" do
|
|
74
|
+
let(:config) { SwaggerClient::Configuration.new }
|
|
75
|
+
let(:api_client) { SwaggerClient::ApiClient.new(config) }
|
|
76
|
+
|
|
77
|
+
it "defaults to 0" do
|
|
78
|
+
expect(SwaggerClient::Configuration.default.timeout).to eq(0)
|
|
79
|
+
expect(config.timeout).to eq(0)
|
|
80
|
+
|
|
81
|
+
request = api_client.build_request(:get, '/test')
|
|
82
|
+
expect(request.options[:timeout]).to eq(0)
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
it "can be customized" do
|
|
86
|
+
config.timeout = 100
|
|
87
|
+
request = api_client.build_request(:get, '/test')
|
|
88
|
+
expect(request.options[:timeout]).to eq(100)
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
describe "#deserialize" do
|
|
93
|
+
it "handles Array<Integer>" do
|
|
94
|
+
api_client = SwaggerClient::ApiClient.new
|
|
95
|
+
headers = {'Content-Type' => 'application/json'}
|
|
96
|
+
response = double('response', headers: headers, body: '[12, 34]')
|
|
97
|
+
data = api_client.deserialize(response, 'Array<Integer>')
|
|
98
|
+
expect(data).to be_instance_of(Array)
|
|
99
|
+
expect(data).to eq([12, 34])
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
it "handles Array<Array<Integer>>" do
|
|
103
|
+
api_client = SwaggerClient::ApiClient.new
|
|
104
|
+
headers = {'Content-Type' => 'application/json'}
|
|
105
|
+
response = double('response', headers: headers, body: '[[12, 34], [56]]')
|
|
106
|
+
data = api_client.deserialize(response, 'Array<Array<Integer>>')
|
|
107
|
+
expect(data).to be_instance_of(Array)
|
|
108
|
+
expect(data).to eq([[12, 34], [56]])
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
it "handles Hash<String, String>" do
|
|
112
|
+
api_client = SwaggerClient::ApiClient.new
|
|
113
|
+
headers = {'Content-Type' => 'application/json'}
|
|
114
|
+
response = double('response', headers: headers, body: '{"message": "Hello"}')
|
|
115
|
+
data = api_client.deserialize(response, 'Hash<String, String>')
|
|
116
|
+
expect(data).to be_instance_of(Hash)
|
|
117
|
+
expect(data).to eq({:message => 'Hello'})
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
describe "#object_to_hash" do
|
|
122
|
+
it "ignores nils and includes empty arrays" do
|
|
123
|
+
# uncomment below to test object_to_hash for model
|
|
124
|
+
#api_client = SwaggerClient::ApiClient.new
|
|
125
|
+
#_model = SwaggerClient::ModelName.new
|
|
126
|
+
# update the model attribute below
|
|
127
|
+
#_model.id = 1
|
|
128
|
+
# update the expected value (hash) below
|
|
129
|
+
#expected = {id: 1, name: '', tags: []}
|
|
130
|
+
#expect(api_client.object_to_hash(_model)).to eq(expected)
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
describe "#build_collection_param" do
|
|
135
|
+
let(:param) { ['aa', 'bb', 'cc'] }
|
|
136
|
+
let(:api_client) { SwaggerClient::ApiClient.new }
|
|
137
|
+
|
|
138
|
+
it "works for csv" do
|
|
139
|
+
expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
it "works for ssv" do
|
|
143
|
+
expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
it "works for tsv" do
|
|
147
|
+
expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
it "works for pipes" do
|
|
151
|
+
expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
it "works for multi" do
|
|
155
|
+
expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
it "fails for invalid collection format" do
|
|
159
|
+
expect(proc { api_client.build_collection_param(param, :INVALID) }).to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
describe "#json_mime?" do
|
|
164
|
+
let(:api_client) { SwaggerClient::ApiClient.new }
|
|
165
|
+
|
|
166
|
+
it "works" do
|
|
167
|
+
expect(api_client.json_mime?(nil)).to eq false
|
|
168
|
+
expect(api_client.json_mime?('')).to eq false
|
|
169
|
+
|
|
170
|
+
expect(api_client.json_mime?('application/json')).to eq true
|
|
171
|
+
expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true
|
|
172
|
+
expect(api_client.json_mime?('APPLICATION/JSON')).to eq true
|
|
173
|
+
|
|
174
|
+
expect(api_client.json_mime?('application/xml')).to eq false
|
|
175
|
+
expect(api_client.json_mime?('text/plain')).to eq false
|
|
176
|
+
expect(api_client.json_mime?('application/jsonp')).to eq false
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
describe "#select_header_accept" do
|
|
181
|
+
let(:api_client) { SwaggerClient::ApiClient.new }
|
|
182
|
+
|
|
183
|
+
it "works" do
|
|
184
|
+
expect(api_client.select_header_accept(nil)).to be_nil
|
|
185
|
+
expect(api_client.select_header_accept([])).to be_nil
|
|
186
|
+
|
|
187
|
+
expect(api_client.select_header_accept(['application/json'])).to eq('application/json')
|
|
188
|
+
expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
|
189
|
+
expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
|
190
|
+
|
|
191
|
+
expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml')
|
|
192
|
+
expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml')
|
|
193
|
+
end
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
describe "#select_header_content_type" do
|
|
197
|
+
let(:api_client) { SwaggerClient::ApiClient.new }
|
|
198
|
+
|
|
199
|
+
it "works" do
|
|
200
|
+
expect(api_client.select_header_content_type(nil)).to eq('application/json')
|
|
201
|
+
expect(api_client.select_header_content_type([])).to eq('application/json')
|
|
202
|
+
|
|
203
|
+
expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
|
|
204
|
+
expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
|
205
|
+
expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
|
206
|
+
expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml')
|
|
207
|
+
expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain')
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
describe "#sanitize_filename" do
|
|
212
|
+
let(:api_client) { SwaggerClient::ApiClient.new }
|
|
213
|
+
|
|
214
|
+
it "works" do
|
|
215
|
+
expect(api_client.sanitize_filename('sun')).to eq('sun')
|
|
216
|
+
expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
|
|
217
|
+
expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
|
|
218
|
+
expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif')
|
|
219
|
+
expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif')
|
|
220
|
+
expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif')
|
|
221
|
+
expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif')
|
|
222
|
+
expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif')
|
|
223
|
+
expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif')
|
|
224
|
+
end
|
|
225
|
+
end
|
|
226
|
+
end
|