cybersource_rest_client 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/AuthenticationSDK/Cybersource.gemspec +23 -0
- data/AuthenticationSDK/authentication/http/GetSignatureParameter.rb +62 -0
- data/AuthenticationSDK/authentication/http/HttpSignatureHeader.rb +50 -0
- data/AuthenticationSDK/authentication/jwt/JwtToken.rb +62 -0
- data/AuthenticationSDK/authentication/payloadDigest/digest.rb +10 -0
- data/AuthenticationSDK/core/Authorization.rb +24 -0
- data/AuthenticationSDK/core/ITokenGeneration.rb +4 -0
- data/AuthenticationSDK/core/Logger.rb +26 -0
- data/AuthenticationSDK/core/MerchantConfig.rb +181 -0
- data/AuthenticationSDK/util/ApiException.rb +19 -0
- data/AuthenticationSDK/util/Cache.rb +36 -0
- data/AuthenticationSDK/util/Constants.rb +134 -0
- data/AuthenticationSDK/util/PropertiesUtil.rb +21 -0
- data/AuthenticationSDK/util/Utility.rb +31 -0
- data/lib/cyberSource_client.rb +286 -0
- data/lib/cyberSource_client/api/capture_api.rb +133 -0
- data/lib/cyberSource_client/api/credit_api.rb +127 -0
- data/lib/cyberSource_client/api/default_api.rb +75 -0
- data/lib/cyberSource_client/api/instrument_identifier_api.rb +393 -0
- data/lib/cyberSource_client/api/key_generation_api.rb +75 -0
- data/lib/cyberSource_client/api/payment_api.rb +127 -0
- data/lib/cyberSource_client/api/payment_instrument_api.rb +312 -0
- data/lib/cyberSource_client/api/refund_api.rb +191 -0
- data/lib/cyberSource_client/api/reversal_api.rb +133 -0
- data/lib/cyberSource_client/api/tokenization_api.rb +71 -0
- data/lib/cyberSource_client/api/void_api.rb +307 -0
- data/lib/cyberSource_client/api_client.rb +437 -0
- data/lib/cyberSource_client/api_error.rb +38 -0
- data/lib/cyberSource_client/configuration.rb +202 -0
- data/lib/cyberSource_client/models/auth_reversal_request.rb +219 -0
- data/lib/cyberSource_client/models/body.rb +295 -0
- data/lib/cyberSource_client/models/body_1.rb +183 -0
- data/lib/cyberSource_client/models/body_2.rb +331 -0
- data/lib/cyberSource_client/models/body_3.rb +331 -0
- data/lib/cyberSource_client/models/capture_payment_request.rb +267 -0
- data/lib/cyberSource_client/models/card_info.rb +214 -0
- data/lib/cyberSource_client/models/create_credit_request.rb +267 -0
- data/lib/cyberSource_client/models/create_payment_request.rb +285 -0
- data/lib/cyberSource_client/models/der_public_key.rb +205 -0
- data/lib/cyberSource_client/models/error.rb +192 -0
- data/lib/cyberSource_client/models/error_links.rb +205 -0
- data/lib/cyberSource_client/models/error_response.rb +192 -0
- data/lib/cyberSource_client/models/generate_public_key_request.rb +184 -0
- data/lib/cyberSource_client/models/inline_response_200.rb +202 -0
- data/lib/cyberSource_client/models/inline_response_200_1.rb +255 -0
- data/lib/cyberSource_client/models/inline_response_200_2.rb +377 -0
- data/lib/cyberSource_client/models/inline_response_200_2_buyer_information.rb +270 -0
- data/lib/cyberSource_client/models/inline_response_200_2_device_information.rb +219 -0
- data/lib/cyberSource_client/models/inline_response_200_2_merchant_information.rb +233 -0
- data/lib/cyberSource_client/models/inline_response_200_2_order_information.rb +230 -0
- data/lib/cyberSource_client/models/inline_response_200_2_order_information_amount_details.rb +385 -0
- data/lib/cyberSource_client/models/inline_response_200_2_order_information_bill_to.rb +459 -0
- data/lib/cyberSource_client/models/inline_response_200_2_order_information_invoice_details.rb +315 -0
- data/lib/cyberSource_client/models/inline_response_200_2_order_information_line_items.rb +564 -0
- data/lib/cyberSource_client/models/inline_response_200_2_order_information_ship_to.rb +429 -0
- data/lib/cyberSource_client/models/inline_response_200_2_payment_information.rb +192 -0
- data/lib/cyberSource_client/models/inline_response_200_2_payment_information_card.rb +274 -0
- data/lib/cyberSource_client/models/inline_response_200_2_payment_information_tokenized_card.rb +299 -0
- data/lib/cyberSource_client/models/inline_response_200_2_processing_information.rb +199 -0
- data/lib/cyberSource_client/models/inline_response_200_2_processor_information.rb +227 -0
- data/lib/cyberSource_client/models/inline_response_200_2_processor_information_avs.rb +199 -0
- data/lib/cyberSource_client/models/inline_response_200_2_processor_information_card_verification.rb +199 -0
- data/lib/cyberSource_client/models/inline_response_200_3.rb +314 -0
- data/lib/cyberSource_client/models/inline_response_200_4.rb +350 -0
- data/lib/cyberSource_client/models/inline_response_200_4_device_information.rb +199 -0
- data/lib/cyberSource_client/models/inline_response_200_4_order_information.rb +230 -0
- data/lib/cyberSource_client/models/inline_response_200_4_order_information_amount_details.rb +360 -0
- data/lib/cyberSource_client/models/inline_response_200_4_order_information_invoice_details.rb +305 -0
- data/lib/cyberSource_client/models/inline_response_200_4_order_information_ship_to.rb +249 -0
- data/lib/cyberSource_client/models/inline_response_200_4_processing_information.rb +208 -0
- data/lib/cyberSource_client/models/inline_response_200_4_processing_information_authorization_options.rb +199 -0
- data/lib/cyberSource_client/models/inline_response_200_5.rb +305 -0
- data/lib/cyberSource_client/models/inline_response_200_6.rb +305 -0
- data/lib/cyberSource_client/models/inline_response_200_7.rb +295 -0
- data/lib/cyberSource_client/models/inline_response_200_8.rb +277 -0
- data/lib/cyberSource_client/models/inline_response_200_8__links.rb +219 -0
- data/lib/cyberSource_client/models/inline_response_200_8__links_first.rb +184 -0
- data/lib/cyberSource_client/models/inline_response_200_8__links_last.rb +184 -0
- data/lib/cyberSource_client/models/inline_response_200_8__links_next.rb +184 -0
- data/lib/cyberSource_client/models/inline_response_200_8__links_prev.rb +184 -0
- data/lib/cyberSource_client/models/inline_response_200_8__links_self.rb +184 -0
- data/lib/cyberSource_client/models/inline_response_200_der.rb +205 -0
- data/lib/cyberSource_client/models/inline_response_200_jwk.rb +225 -0
- data/lib/cyberSource_client/models/inline_response_201.rb +350 -0
- data/lib/cyberSource_client/models/inline_response_201_1.rb +332 -0
- data/lib/cyberSource_client/models/inline_response_201_1_authorization_information.rb +224 -0
- data/lib/cyberSource_client/models/inline_response_201_1_processor_information.rb +324 -0
- data/lib/cyberSource_client/models/inline_response_201_1_reversal_amount_details.rb +249 -0
- data/lib/cyberSource_client/models/inline_response_201_2.rb +314 -0
- data/lib/cyberSource_client/models/inline_response_201_2__links.rb +201 -0
- data/lib/cyberSource_client/models/inline_response_201_2_order_information.rb +192 -0
- data/lib/cyberSource_client/models/inline_response_201_2_order_information_amount_details.rb +224 -0
- data/lib/cyberSource_client/models/inline_response_201_2_processor_information.rb +199 -0
- data/lib/cyberSource_client/models/inline_response_201_3.rb +323 -0
- data/lib/cyberSource_client/models/inline_response_201_3__links.rb +192 -0
- data/lib/cyberSource_client/models/inline_response_201_3_order_information.rb +183 -0
- data/lib/cyberSource_client/models/inline_response_201_3_processor_information.rb +224 -0
- data/lib/cyberSource_client/models/inline_response_201_3_refund_amount_details.rb +224 -0
- data/lib/cyberSource_client/models/inline_response_201_4.rb +323 -0
- data/lib/cyberSource_client/models/inline_response_201_4_credit_amount_details.rb +224 -0
- data/lib/cyberSource_client/models/inline_response_201_5.rb +280 -0
- data/lib/cyberSource_client/models/inline_response_201_5_void_amount_details.rb +219 -0
- data/lib/cyberSource_client/models/inline_response_201_6.rb +331 -0
- data/lib/cyberSource_client/models/inline_response_201__embedded.rb +183 -0
- data/lib/cyberSource_client/models/inline_response_201__embedded_capture.rb +193 -0
- data/lib/cyberSource_client/models/inline_response_201__embedded_capture__links.rb +183 -0
- data/lib/cyberSource_client/models/inline_response_201__links.rb +201 -0
- data/lib/cyberSource_client/models/inline_response_201__links_self.rb +194 -0
- data/lib/cyberSource_client/models/inline_response_201_client_reference_information.rb +199 -0
- data/lib/cyberSource_client/models/inline_response_201_error_information.rb +239 -0
- data/lib/cyberSource_client/models/inline_response_201_error_information_details.rb +228 -0
- data/lib/cyberSource_client/models/inline_response_201_order_information.rb +192 -0
- data/lib/cyberSource_client/models/inline_response_201_order_information_amount_details.rb +249 -0
- data/lib/cyberSource_client/models/inline_response_201_order_information_invoice_details.rb +184 -0
- data/lib/cyberSource_client/models/inline_response_201_payment_information.rb +201 -0
- data/lib/cyberSource_client/models/inline_response_201_payment_information_account_features.rb +623 -0
- data/lib/cyberSource_client/models/inline_response_201_payment_information_card.rb +199 -0
- data/lib/cyberSource_client/models/inline_response_201_payment_information_tokenized_card.rb +349 -0
- data/lib/cyberSource_client/models/inline_response_201_point_of_sale_information.rb +208 -0
- data/lib/cyberSource_client/models/inline_response_201_point_of_sale_information_emv.rb +199 -0
- data/lib/cyberSource_client/models/inline_response_201_processor_information.rb +642 -0
- data/lib/cyberSource_client/models/inline_response_201_processor_information_avs.rb +224 -0
- data/lib/cyberSource_client/models/inline_response_201_processor_information_card_verification.rb +224 -0
- data/lib/cyberSource_client/models/inline_response_201_processor_information_consumer_authentication_response.rb +224 -0
- data/lib/cyberSource_client/models/inline_response_201_processor_information_customer.rb +199 -0
- data/lib/cyberSource_client/models/inline_response_201_processor_information_electronic_verification_results.rb +474 -0
- data/lib/cyberSource_client/models/inline_response_201_processor_information_issuer.rb +224 -0
- data/lib/cyberSource_client/models/inline_response_201_processor_information_merchant_advice.rb +224 -0
- data/lib/cyberSource_client/models/inline_response_400.rb +271 -0
- data/lib/cyberSource_client/models/inline_response_400_1.rb +271 -0
- data/lib/cyberSource_client/models/inline_response_400_2.rb +271 -0
- data/lib/cyberSource_client/models/inline_response_400_3.rb +271 -0
- data/lib/cyberSource_client/models/inline_response_400_4.rb +271 -0
- data/lib/cyberSource_client/models/inline_response_400_5.rb +259 -0
- data/lib/cyberSource_client/models/inline_response_400_6.rb +202 -0
- data/lib/cyberSource_client/models/inline_response_409.rb +183 -0
- data/lib/cyberSource_client/models/inline_response_409__links.rb +183 -0
- data/lib/cyberSource_client/models/inline_response_409__links_payment_instruments.rb +183 -0
- data/lib/cyberSource_client/models/inline_response_502.rb +260 -0
- data/lib/cyberSource_client/models/inline_response_default.rb +192 -0
- data/lib/cyberSource_client/models/inline_response_default__links.rb +205 -0
- data/lib/cyberSource_client/models/inline_response_default__links_next.rb +204 -0
- data/lib/cyberSource_client/models/inline_response_default_response_status.rb +225 -0
- data/lib/cyberSource_client/models/inline_response_default_response_status_details.rb +194 -0
- data/lib/cyberSource_client/models/instrumentidentifiers__links.rb +201 -0
- data/lib/cyberSource_client/models/instrumentidentifiers__links_self.rb +183 -0
- data/lib/cyberSource_client/models/instrumentidentifiers_authorization_options_merchant_initiated_transaction.rb +184 -0
- data/lib/cyberSource_client/models/instrumentidentifiers_bank_account.rb +194 -0
- data/lib/cyberSource_client/models/instrumentidentifiers_card.rb +184 -0
- data/lib/cyberSource_client/models/instrumentidentifiers_details.rb +194 -0
- data/lib/cyberSource_client/models/instrumentidentifiers_metadata.rb +184 -0
- data/lib/cyberSource_client/models/instrumentidentifiers_processing_information.rb +183 -0
- data/lib/cyberSource_client/models/instrumentidentifiers_processing_information_authorization_options.rb +183 -0
- data/lib/cyberSource_client/models/instrumentidentifiers_processing_information_authorization_options_initiator.rb +183 -0
- data/lib/cyberSource_client/models/json_web_key.rb +225 -0
- data/lib/cyberSource_client/models/key_parameters.rb +184 -0
- data/lib/cyberSource_client/models/key_result.rb +202 -0
- data/lib/cyberSource_client/models/link.rb +204 -0
- data/lib/cyberSource_client/models/links.rb +205 -0
- data/lib/cyberSource_client/models/oct_create_payment_request.rb +237 -0
- data/lib/cyberSource_client/models/paymentinstruments_bank_account.rb +184 -0
- data/lib/cyberSource_client/models/paymentinstruments_bill_to.rb +284 -0
- data/lib/cyberSource_client/models/paymentinstruments_buyer_information.rb +215 -0
- data/lib/cyberSource_client/models/paymentinstruments_buyer_information_issued_by.rb +184 -0
- data/lib/cyberSource_client/models/paymentinstruments_buyer_information_personal_identification.rb +203 -0
- data/lib/cyberSource_client/models/paymentinstruments_card.rb +278 -0
- data/lib/cyberSource_client/models/paymentinstruments_instrument_identifier.rb +295 -0
- data/lib/cyberSource_client/models/paymentinstruments_merchant_information.rb +183 -0
- data/lib/cyberSource_client/models/paymentinstruments_merchant_information_merchant_descriptor.rb +184 -0
- data/lib/cyberSource_client/models/paymentinstruments_processing_information.rb +193 -0
- data/lib/cyberSource_client/models/paymentinstruments_processing_information_bank_transfer_options.rb +184 -0
- data/lib/cyberSource_client/models/paymentsflexv1tokens_card_info.rb +214 -0
- data/lib/cyberSource_client/models/refund_capture_request.rb +267 -0
- data/lib/cyberSource_client/models/refund_payment_request.rb +267 -0
- data/lib/cyberSource_client/models/response_status.rb +225 -0
- data/lib/cyberSource_client/models/response_status_details.rb +194 -0
- data/lib/cyberSource_client/models/tokenize_parameters.rb +193 -0
- data/lib/cyberSource_client/models/tokenize_request.rb +193 -0
- data/lib/cyberSource_client/models/tokenize_result.rb +255 -0
- data/lib/cyberSource_client/models/v2credits_point_of_sale_information.rb +183 -0
- data/lib/cyberSource_client/models/v2credits_point_of_sale_information_emv.rb +221 -0
- data/lib/cyberSource_client/models/v2credits_processing_information.rb +383 -0
- data/lib/cyberSource_client/models/v2payments_aggregator_information.rb +233 -0
- data/lib/cyberSource_client/models/v2payments_aggregator_information_sub_merchant.rb +424 -0
- data/lib/cyberSource_client/models/v2payments_buyer_information.rb +285 -0
- data/lib/cyberSource_client/models/v2payments_buyer_information_personal_identification.rb +252 -0
- data/lib/cyberSource_client/models/v2payments_client_reference_information.rb +219 -0
- data/lib/cyberSource_client/models/v2payments_consumer_authentication_information.rb +374 -0
- data/lib/cyberSource_client/models/v2payments_device_information.rb +249 -0
- data/lib/cyberSource_client/models/v2payments_merchant_defined_information.rb +224 -0
- data/lib/cyberSource_client/models/v2payments_merchant_information.rb +308 -0
- data/lib/cyberSource_client/models/v2payments_merchant_information_merchant_descriptor.rb +374 -0
- data/lib/cyberSource_client/models/v2payments_order_information.rb +230 -0
- data/lib/cyberSource_client/models/v2payments_order_information_amount_details.rb +605 -0
- data/lib/cyberSource_client/models/v2payments_order_information_amount_details_amex_additional_amounts.rb +224 -0
- data/lib/cyberSource_client/models/v2payments_order_information_amount_details_surcharge.rb +209 -0
- data/lib/cyberSource_client/models/v2payments_order_information_amount_details_tax_details.rb +328 -0
- data/lib/cyberSource_client/models/v2payments_order_information_bill_to.rb +618 -0
- data/lib/cyberSource_client/models/v2payments_order_information_invoice_details.rb +330 -0
- data/lib/cyberSource_client/models/v2payments_order_information_invoice_details_transaction_advice_addendum.rb +199 -0
- data/lib/cyberSource_client/models/v2payments_order_information_line_items.rb +649 -0
- data/lib/cyberSource_client/models/v2payments_order_information_ship_to.rb +474 -0
- data/lib/cyberSource_client/models/v2payments_order_information_shipping_details.rb +234 -0
- data/lib/cyberSource_client/models/v2payments_payment_information.rb +210 -0
- data/lib/cyberSource_client/models/v2payments_payment_information_card.rb +474 -0
- data/lib/cyberSource_client/models/v2payments_payment_information_customer.rb +202 -0
- data/lib/cyberSource_client/models/v2payments_payment_information_fluid_data.rb +259 -0
- data/lib/cyberSource_client/models/v2payments_payment_information_tokenized_card.rb +424 -0
- data/lib/cyberSource_client/models/v2payments_point_of_sale_information.rb +440 -0
- data/lib/cyberSource_client/models/v2payments_point_of_sale_information_emv.rb +256 -0
- data/lib/cyberSource_client/models/v2payments_processing_information.rb +432 -0
- data/lib/cyberSource_client/models/v2payments_processing_information_authorization_options.rb +361 -0
- data/lib/cyberSource_client/models/v2payments_processing_information_authorization_options_initiator.rb +247 -0
- data/lib/cyberSource_client/models/v2payments_processing_information_authorization_options_merchant_initiated_transaction.rb +224 -0
- data/lib/cyberSource_client/models/v2payments_processing_information_capture_options.rb +267 -0
- data/lib/cyberSource_client/models/v2payments_processing_information_issuer.rb +199 -0
- data/lib/cyberSource_client/models/v2payments_processing_information_recurring_options.rb +198 -0
- data/lib/cyberSource_client/models/v2payments_recipient_information.rb +249 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_aggregator_information.rb +233 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_aggregator_information_sub_merchant.rb +374 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_buyer_information.rb +224 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_merchant_information.rb +258 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_order_information.rb +230 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_order_information_amount_details.rb +546 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_order_information_bill_to.rb +449 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_order_information_invoice_details.rb +320 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_order_information_ship_to.rb +249 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_order_information_shipping_details.rb +199 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_payment_information.rb +183 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_point_of_sale_information.rb +208 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_point_of_sale_information_emv.rb +211 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_processing_information.rb +351 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_processing_information_authorization_options.rb +249 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_processing_information_capture_options.rb +242 -0
- data/lib/cyberSource_client/models/v2paymentsidrefunds_merchant_information.rb +258 -0
- data/lib/cyberSource_client/models/v2paymentsidrefunds_order_information.rb +230 -0
- data/lib/cyberSource_client/models/v2paymentsidrefunds_order_information_line_items.rb +639 -0
- data/lib/cyberSource_client/models/v2paymentsidrefunds_payment_information.rb +183 -0
- data/lib/cyberSource_client/models/v2paymentsidrefunds_payment_information_card.rb +374 -0
- data/lib/cyberSource_client/models/v2paymentsidrefunds_point_of_sale_information.rb +183 -0
- data/lib/cyberSource_client/models/v2paymentsidrefunds_processing_information.rb +333 -0
- data/lib/cyberSource_client/models/v2paymentsidrefunds_processing_information_recurring_options.rb +186 -0
- data/lib/cyberSource_client/models/v2paymentsidreversals_client_reference_information.rb +209 -0
- data/lib/cyberSource_client/models/v2paymentsidreversals_order_information.rb +185 -0
- data/lib/cyberSource_client/models/v2paymentsidreversals_order_information_line_items.rb +233 -0
- data/lib/cyberSource_client/models/v2paymentsidreversals_point_of_sale_information.rb +183 -0
- data/lib/cyberSource_client/models/v2paymentsidreversals_processing_information.rb +308 -0
- data/lib/cyberSource_client/models/v2paymentsidreversals_reversal_information.rb +211 -0
- data/lib/cyberSource_client/models/v2paymentsidreversals_reversal_information_amount_details.rb +224 -0
- data/lib/cyberSource_client/models/v2payouts_merchant_information.rb +258 -0
- data/lib/cyberSource_client/models/v2payouts_merchant_information_merchant_descriptor.rb +324 -0
- data/lib/cyberSource_client/models/v2payouts_order_information.rb +192 -0
- data/lib/cyberSource_client/models/v2payouts_order_information_amount_details.rb +249 -0
- data/lib/cyberSource_client/models/v2payouts_order_information_bill_to.rb +443 -0
- data/lib/cyberSource_client/models/v2payouts_payment_information.rb +183 -0
- data/lib/cyberSource_client/models/v2payouts_payment_information_card.rb +299 -0
- data/lib/cyberSource_client/models/v2payouts_processing_information.rb +283 -0
- data/lib/cyberSource_client/models/v2payouts_processing_information_payouts_options.rb +274 -0
- data/lib/cyberSource_client/models/v2payouts_recipient_information.rb +433 -0
- data/lib/cyberSource_client/models/v2payouts_sender_information.rb +517 -0
- data/lib/cyberSource_client/models/v2payouts_sender_information_account.rb +233 -0
- data/lib/cyberSource_client/models/void_capture_request.rb +183 -0
- data/lib/cyberSource_client/models/void_credit_request.rb +183 -0
- data/lib/cyberSource_client/models/void_payment_request.rb +183 -0
- data/lib/cyberSource_client/models/void_refund_request.rb +183 -0
- data/lib/cyberSource_client/version.rb +15 -0
- metadata +572 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8b7625049670ddc6fe04c3b815f64d1b40395f2dc8b4474020a1603ae3e183be
|
4
|
+
data.tar.gz: 3ddadd409732bac2bd32f1f3015765c76fd40c2d383c469914e68f0ee4cff80f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6285f04237f5f844c5056f2544a46b8975754e517f087af59acd024bbdece0ca22721739d677eb928692e9aa08775e9b0c70fa2a38ea9e269a659aeb05bfa8df
|
7
|
+
data.tar.gz: d9b33a02f50e1c79e53938f75d34fdb0cb86cf09874099d25a17992c730ee3d02d3233d4bb1da464f7b22fe5adc334f2749318ada4ef699af9d65096561854e2
|
@@ -0,0 +1,23 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = "AuthenticationSDK"
|
3
|
+
s.version = "0.0.1"
|
4
|
+
s.platform = Gem::Platform::RUBY
|
5
|
+
s.date = "2018-07-17"
|
6
|
+
s.summary = "Cybersource Payments REST API Ruby Gem"
|
7
|
+
s.description = "Move your business forward with the Cybersource Payments REST API"
|
8
|
+
s.authors = ["cybersource"]
|
9
|
+
s.email = ""
|
10
|
+
s.files = Dir.glob("{lib}/**/*")
|
11
|
+
|
12
|
+
s.required_ruby_version = '>= 2.2.2'
|
13
|
+
s.required_rubygems_version = '>= 1.3.6'
|
14
|
+
|
15
|
+
s.add_runtime_dependency 'activesupport', '~> 5.2', '>= 5.2.0'
|
16
|
+
s.add_runtime_dependency 'json', '~> 2.1.0', '>= 1.8.1'
|
17
|
+
s.add_runtime_dependency 'interface','~> 1.0', '>= 1.0.4'
|
18
|
+
s.add_runtime_dependency 'jwt', '~> 2.1.0'
|
19
|
+
|
20
|
+
s.add_development_dependency 'rspec', '~> 2.1'
|
21
|
+
s.add_development_dependency 'simplecov'
|
22
|
+
s.add_development_dependency 'rubocop', '~> 0.57.2'
|
23
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
require_relative '../../util/Constants.rb'
|
2
|
+
require_relative '.././payloadDigest/digest.rb'
|
3
|
+
require 'openssl'
|
4
|
+
# This function returns value for paramter Signature which is then passed to Signature header
|
5
|
+
# paramter 'Signature' is calucated based on below key values and then signed with SECRET KEY -
|
6
|
+
# host: Sandbox (apitest.cybersource.com) or Production (api.cybersource.com) hostname
|
7
|
+
# date: "HTTP-date" format as defined by RFC7231.
|
8
|
+
# (request-target): Should be in format of httpMethod: path
|
9
|
+
# Example: "post /pts/v2/payments"
|
10
|
+
# Digest: Only needed for POST calls.
|
11
|
+
# digestString = BASE64( HMAC-SHA256 ( Payload ));
|
12
|
+
# Digest: “SHA-256=“ + digestString;
|
13
|
+
# v-c-merchant-id: set value to Cybersource Merchant ID
|
14
|
+
# This ID can be found on EBC portal*/
|
15
|
+
class SignatureParameter
|
16
|
+
def generateSignatureParameter(merchantconfig_obj, gmtdatetime, log_obj)
|
17
|
+
request_type = merchantconfig_obj.requestType.upcase
|
18
|
+
merchantSecretKey = merchantconfig_obj.merchantSecretKey
|
19
|
+
signatureString = Constants::HOST + ': ' + merchantconfig_obj.requestHost
|
20
|
+
signatureString << "\n"+ Constants::DATE + ': ' + gmtdatetime
|
21
|
+
signatureString << "\n(request-target): "
|
22
|
+
if request_type == Constants::GET_REQUEST_TYPE || request_type == Constants::DELETE_REQUEST_TYPE
|
23
|
+
targetUrl=gettargetUrlForGetDelete(request_type,merchantconfig_obj)
|
24
|
+
signatureString << targetUrl + "\n"
|
25
|
+
elsif request_type == Constants::POST_REQUEST_TYPE || request_type == Constants::PUT_REQUEST_TYPE
|
26
|
+
targetUrl=gettargetUrlForPutPost(request_type,merchantconfig_obj)
|
27
|
+
signatureString << targetUrl + "\n"
|
28
|
+
payload = merchantconfig_obj.requestJsonData
|
29
|
+
digest = DigestGeneration.new.generateDigest(payload, log_obj)
|
30
|
+
digest_payload = Constants::SHA256 + digest
|
31
|
+
signatureString << Constants::DIGEST + ': ' + digest_payload + "\n"
|
32
|
+
end
|
33
|
+
signatureString << Constants::V_C_MERCHANT_ID + ': ' + merchantconfig_obj.merchantId
|
34
|
+
encodedSignatureString = signatureString.force_encoding(Encoding::UTF_8)
|
35
|
+
decodedKey = Base64.decode64(merchantSecretKey)
|
36
|
+
base64EncodedSignature = Base64.strict_encode64(OpenSSL::HMAC.digest('sha256', decodedKey, encodedSignatureString))
|
37
|
+
return base64EncodedSignature
|
38
|
+
rescue StandardError => err
|
39
|
+
log_obj.logger.error(err.message)
|
40
|
+
log_obj.logger.error(err.backtrace)
|
41
|
+
puts 'Check log for more details.'
|
42
|
+
exit!
|
43
|
+
end
|
44
|
+
def gettargetUrlForGetDelete(request_type, merchantconfig_obj)
|
45
|
+
targetUrlForGetDelete = ''
|
46
|
+
if request_type == Constants::DELETE_REQUEST_TYPE
|
47
|
+
targetUrlForGetDelete = Constants::DELETE_REQUEST_TYPE_LOWER + ' ' + merchantconfig_obj.requestTarget
|
48
|
+
elsif request_type == Constants::GET_REQUEST_TYPE
|
49
|
+
targetUrlForGetDelete = Constants::GET_REQUEST_TYPE_LOWER + ' ' + merchantconfig_obj.requestTarget
|
50
|
+
end
|
51
|
+
return targetUrlForGetDelete
|
52
|
+
end
|
53
|
+
def gettargetUrlForPutPost(request_type, merchantconfig_obj)
|
54
|
+
targetUrlForPutPost = ''
|
55
|
+
if request_type == Constants::POST_REQUEST_TYPE
|
56
|
+
targetUrlForPutPost = Constants::POST_REQUEST_TYPE_LOWER + ' ' + merchantconfig_obj.requestTarget
|
57
|
+
elsif request_type == Constants::PUT_REQUEST_TYPE
|
58
|
+
targetUrlForPutPost = Constants::PUT_REQUEST_TYPE_LOWER + ' ' + merchantconfig_obj.requestTarget
|
59
|
+
end
|
60
|
+
return targetUrlForPutPost
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'base64'
|
2
|
+
require_relative '../../core/ITokenGeneration.rb'
|
3
|
+
require_relative '../../util/Constants.rb'
|
4
|
+
require_relative '../../util/ApiException.rb'
|
5
|
+
require_relative '.././payloadDigest/digest.rb'
|
6
|
+
require_relative '.././http/GetSignatureParameter.rb'
|
7
|
+
public
|
8
|
+
# SignatureHeader return SignatureHeader Value that contains following paramters
|
9
|
+
# * keyid -- Merchant ID obtained from EBC portal
|
10
|
+
# * algorithm -- Should have value as "HmacSHA256"
|
11
|
+
# * headers -- List of all header name passed in the Signature paramter below
|
12
|
+
# String getHeaders = "host date (request-target)" + " " + "v-c-merchant-id";
|
13
|
+
# String postHeaders = "host date (request-target) digest v-c-merchant-id";
|
14
|
+
# Note: Digest is not passed for GET calls
|
15
|
+
# * signature -- Signature header has paramter called signature
|
16
|
+
# Paramter 'Signature' must contain all the paramters mentioned in header above in given order
|
17
|
+
class GenerateHttpSignature
|
18
|
+
# Generates Signature based on the requestType
|
19
|
+
def getToken(merchantconfig_obj, gmtdatetime, log_obj)
|
20
|
+
request_type = merchantconfig_obj.requestType.upcase
|
21
|
+
signatureHeaderValue =''
|
22
|
+
signatureHeaderValue << Constants::KEY_ID + merchantconfig_obj.merchantKeyId + "\""
|
23
|
+
# Algorithm should be always HmacSHA256 for http signature
|
24
|
+
signatureHeaderValue << ', ' + Constants::ALGORITHM + Constants::SIGNATURE_ALGORITHM + "\""
|
25
|
+
# Headers - list is choosen based on HTTP method
|
26
|
+
signatureheader=getsignatureHeader(request_type)
|
27
|
+
signatureHeaderValue << ', ' + Constants::HEADERS_PARAM + signatureheader + "\""
|
28
|
+
# Get Value for parameter 'Signature' to be passed to Signature Header
|
29
|
+
signature_value = SignatureParameter.new.generateSignatureParameter(merchantconfig_obj, gmtdatetime, log_obj)
|
30
|
+
signatureHeaderValue << ', ' + Constants::SIGNATURE_PARAM + signature_value + "\""
|
31
|
+
return signatureHeaderValue
|
32
|
+
rescue StandardError => err
|
33
|
+
ApiException.new.apiexception(err,log_obj)
|
34
|
+
exit!
|
35
|
+
end
|
36
|
+
def getsignatureHeader(request_type)
|
37
|
+
headers = ''
|
38
|
+
if request_type == Constants::POST_REQUEST_TYPE
|
39
|
+
headers = 'host date (request-target) digest ' + Constants::V_C_MERCHANT_ID
|
40
|
+
elsif request_type == Constants::GET_REQUEST_TYPE || request_type == Constants::DELETE_REQUEST_TYPE
|
41
|
+
headers = 'host date (request-target)' + ' ' + Constants::V_C_MERCHANT_ID
|
42
|
+
elsif request_type == Constants::PUT_REQUEST_TYPE
|
43
|
+
headers = 'host date (request-target) digest ' + Constants::V_C_MERCHANT_ID
|
44
|
+
else
|
45
|
+
raise StandardError.new(Constants::ERROR_PREFIX + Constants::INVALID_REQUEST_TYPE_METHOD)
|
46
|
+
end
|
47
|
+
return headers
|
48
|
+
end
|
49
|
+
implements TokenInterface
|
50
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
require 'base64'
|
2
|
+
require 'openssl'
|
3
|
+
require 'jwt'
|
4
|
+
require 'json'
|
5
|
+
require 'active_support'
|
6
|
+
require_relative '../../core/ITokenGeneration.rb'
|
7
|
+
require_relative '../../util/Constants.rb'
|
8
|
+
require_relative '../../util/ApiException.rb'
|
9
|
+
require_relative '../../util/Cache.rb'
|
10
|
+
require_relative '../../authentication/payloadDigest/digest.rb'
|
11
|
+
public
|
12
|
+
#JWT Token-generated based on the Request type
|
13
|
+
class GenerateJwtToken
|
14
|
+
def getToken(merchantconfig_obj,gmtDatetime,log_obj)
|
15
|
+
jwtBody = ''
|
16
|
+
request_type = merchantconfig_obj.requestType.upcase
|
17
|
+
filePath = merchantconfig_obj.keysDirectory + '/' + merchantconfig_obj.keyFilename + '.p12'
|
18
|
+
if (!File.exist?(filePath))
|
19
|
+
raise Constants::ERROR_PREFIX + Constants::FILE_NOT_FOUND + filePath
|
20
|
+
end
|
21
|
+
p12File = File.binread(filePath)
|
22
|
+
jwtBody=getJwtBody(request_type, gmtDatetime, merchantconfig_obj, log_obj)
|
23
|
+
claimSet = JSON.parse(jwtBody)
|
24
|
+
p12FilePath = OpenSSL::PKCS12.new(p12File, merchantconfig_obj.keyPass)
|
25
|
+
# Generating certificate.
|
26
|
+
cacheObj = ActiveSupport::Cache::MemoryStore.new
|
27
|
+
x5Cert = Cache.new.fetchCachedCertificate(filePath, p12File, merchantconfig_obj.keyPass, cacheObj)
|
28
|
+
# Generating Public key.
|
29
|
+
publicKey = OpenSSL::PKey::RSA.new(p12FilePath.key.public_key)
|
30
|
+
#Generating Private Key
|
31
|
+
privateKey = OpenSSL::PKey::RSA.new(p12FilePath.key)
|
32
|
+
# JWT token-Generates using RS256 algorithm only
|
33
|
+
x5clist = [x5Cert]
|
34
|
+
customHeaders = {}
|
35
|
+
customHeaders['v-c-merchant-id'] = merchantconfig_obj.keyAlias
|
36
|
+
customHeaders['x5c'] = x5clist
|
37
|
+
# Generating JWT token
|
38
|
+
token = JWT.encode(claimSet, privateKey, 'RS256', customHeaders)
|
39
|
+
return token
|
40
|
+
rescue StandardError => err
|
41
|
+
if err.message.include? 'PKCS12_parse: mac verify failure'
|
42
|
+
ApiException.new.customerror(Constants::ERROR_PREFIX + Constants::INCORRECT_KEY_PASS,log_obj)
|
43
|
+
exit!
|
44
|
+
else
|
45
|
+
ApiException.new.apiexception(err,log_obj)
|
46
|
+
exit!
|
47
|
+
end
|
48
|
+
end
|
49
|
+
def getJwtBody(request_type, gmtDatetime, merchantconfig_obj,log_obj)
|
50
|
+
if request_type == Constants::POST_REQUEST_TYPE || request_type == Constants::PUT_REQUEST_TYPE
|
51
|
+
payload = merchantconfig_obj.requestJsonData
|
52
|
+
# Note: Digest is not passed for GET calls
|
53
|
+
digest = DigestGeneration.new.generateDigest(payload, log_obj)
|
54
|
+
jwtBody = "{\n \"digest\":\"" + digest + "\", \"digestAlgorithm\":\"SHA-256\", \"iat\":\"" + gmtDatetime + "\"}"
|
55
|
+
elsif request_type == Constants::GET_REQUEST_TYPE || request_type == Constants::DELETE_REQUEST_TYPE
|
56
|
+
jwtBody = "{\n \"iat\":\"" + gmtDatetime + "\"\n} \n\n"
|
57
|
+
else
|
58
|
+
raise StandardError.new(Constants::ERROR_PREFIX + Constants::INVALID_REQUEST_TYPE_METHOD)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
implements TokenInterface
|
62
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'digest'
|
2
|
+
public
|
3
|
+
# This method return Digest value which is SHA-256
|
4
|
+
# hash of payload that is BASE64 encoded
|
5
|
+
class DigestGeneration
|
6
|
+
def generateDigest(payload, log_obj)
|
7
|
+
digest = Digest::SHA256.base64digest(payload)
|
8
|
+
return digest
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require_relative '../authentication/http/HttpSignatureHeader.rb'
|
2
|
+
require_relative '../authentication/jwt/JwtToken.rb'
|
3
|
+
require_relative '../util/Constants.rb'
|
4
|
+
require_relative '../util/ApiException.rb'
|
5
|
+
public
|
6
|
+
# This function calls for the generation of Signature message depending on the authentication type.
|
7
|
+
class Authorization
|
8
|
+
def getToken(merchantconfig_obj, gmtdatetime, log_obj)
|
9
|
+
authenticationType = merchantconfig_obj.authenticationType.upcase
|
10
|
+
if merchantconfig_obj.requestType.to_s.empty?
|
11
|
+
raise StandardError.new(Constants::ERROR_PREFIX + Constants::REQUEST_TYPE_EMPTY)
|
12
|
+
end
|
13
|
+
if authenticationType == Constants::AUTH_TYPE_HTTP
|
14
|
+
token = GenerateHttpSignature.new.getToken(merchantconfig_obj, gmtdatetime, log_obj)
|
15
|
+
elsif authenticationType == Constants::AUTH_TYPE_JWT
|
16
|
+
token = GenerateJwtToken.new.getToken(merchantconfig_obj, gmtdatetime, log_obj)
|
17
|
+
elsif authenticationType != Constants::AUTH_TYPE_HTTP || authenticationType != Constants::AUTH_TYPE_JWT
|
18
|
+
raise StandardError.ner(Constants::ERROR_PREFIX + Constants::AUTH_ERROR)
|
19
|
+
end
|
20
|
+
rescue StandardError => err
|
21
|
+
ApiException.new.apiexception(err,log_obj)
|
22
|
+
exit!
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require_relative '../util/ApiException.rb'
|
2
|
+
require 'logger'
|
3
|
+
public
|
4
|
+
# Logger Class
|
5
|
+
class Log
|
6
|
+
def initialize(logDirectory, logFilename, logSize, enableLog)
|
7
|
+
#log
|
8
|
+
if enableLog == true
|
9
|
+
filename = logDirectory + '/' + logFilename + '.log'
|
10
|
+
datetime = DateTime.now
|
11
|
+
if File.exist?(filename) && File.size(filename) >= logSize
|
12
|
+
updatedFileName = logDirectory + '/' + logFilename + '_' + datetime.strftime('%Y%m%d%H%M%S') + '.log'
|
13
|
+
File.rename(filename, updatedFileName)
|
14
|
+
end
|
15
|
+
@logger = Logger.new(STDOUT)
|
16
|
+
@logger = Logger.new(filename, logSize)
|
17
|
+
@logger.datetime_format = datetime.strftime('%Y-%m-%d %H:%M:%S')
|
18
|
+
else
|
19
|
+
@logger = Logger.new(false)
|
20
|
+
end
|
21
|
+
rescue StandardError => err
|
22
|
+
puts err
|
23
|
+
exit!
|
24
|
+
end
|
25
|
+
attr_accessor :logger
|
26
|
+
end
|
@@ -0,0 +1,181 @@
|
|
1
|
+
require_relative './Logger.rb'
|
2
|
+
require_relative '../util/Constants.rb'
|
3
|
+
require_relative '../Util/ApiException.rb'
|
4
|
+
public
|
5
|
+
# This fuction has all the merchantConfig properties getters and setters methods
|
6
|
+
class Merchantconfig
|
7
|
+
def initialize(cybsPropertyObj)
|
8
|
+
# Common Parameters
|
9
|
+
@merchantId = cybsPropertyObj['merchantID']
|
10
|
+
@runEnvironment = cybsPropertyObj['runEnvironment']
|
11
|
+
@authenticationType = cybsPropertyObj['authenticationType']
|
12
|
+
@logDirectory = cybsPropertyObj['logDirectory']
|
13
|
+
@logSize = cybsPropertyObj['logSize']
|
14
|
+
@enableLog = cybsPropertyObj['enableLog']
|
15
|
+
@proxyAddress = cybsPropertyObj['proxyAddress']
|
16
|
+
@proxyPort = cybsPropertyObj['proxyPort']
|
17
|
+
@getId = ''
|
18
|
+
@requestHost = ''
|
19
|
+
@requestTarget = ''
|
20
|
+
@requestJsonData = ''
|
21
|
+
# HTTP Parameters
|
22
|
+
@merchantSecretKey = cybsPropertyObj['merchantsecretKey']
|
23
|
+
@merchantKeyId = cybsPropertyObj['merchantKeyId']
|
24
|
+
# JWT Parameters
|
25
|
+
@keysDirectory = cybsPropertyObj['keysDirectory']
|
26
|
+
@keyAlias = cybsPropertyObj['keyAlias']
|
27
|
+
@keyPass = cybsPropertyObj['keyPass']
|
28
|
+
@keyFilename = cybsPropertyObj['keyFilename']
|
29
|
+
@logFilename = cybsPropertyObj['logFilename']
|
30
|
+
validateMerchantDetails()
|
31
|
+
logAllProperties(cybsPropertyObj)
|
32
|
+
end
|
33
|
+
#fall back logic
|
34
|
+
def validateMerchantDetails()
|
35
|
+
logmessage=''
|
36
|
+
if @enableLog.to_s.empty?
|
37
|
+
@enableLog = true
|
38
|
+
elsif @enableLog.instance_of? Fixnum
|
39
|
+
@enableLog = @enableLog.to_s
|
40
|
+
end
|
41
|
+
if @logSize.to_s.empty?
|
42
|
+
@logSize = Constants::DEFAULT_LOG_SIZE
|
43
|
+
elsif !@logSize.instance_of? Fixnum
|
44
|
+
@logSize=@logSize.to_i
|
45
|
+
end
|
46
|
+
if @logDirectory.to_s.empty? || !Dir.exist?(@logDirectory)
|
47
|
+
@logDirectory = Constants::DEFAULT_LOG_DIRECTORY
|
48
|
+
unless Dir.exist?(@logDirectory)
|
49
|
+
Dir.mkdir(Constants::DEFAULT_LOG_DIRECTORY)
|
50
|
+
end
|
51
|
+
logmessage = Constants::WARNING_PREFIX + Constants::INVALID_LOG_DIRECTORY + File.expand_path(@logDirectory)
|
52
|
+
end
|
53
|
+
if @logFilename.to_s.empty?
|
54
|
+
@logFilename = Constants::DEFAULT_LOGFILE_NAME
|
55
|
+
elsif !@logFilename.instance_of? String
|
56
|
+
@logFilename=@logFilename.to_s
|
57
|
+
end
|
58
|
+
@log_obj = Log.new @logDirectory,@logFilename,@logSize,@enableLog
|
59
|
+
@log_obj.logger.info('START> =======================================')
|
60
|
+
if !logmessage.to_s.empty?
|
61
|
+
ApiException.new.apiwarning(logmessage,log_obj)
|
62
|
+
end
|
63
|
+
if @merchantId.to_s.empty?
|
64
|
+
err = raise StandardError.new(Constants::ERROR_PREFIX + Constants::MERCHANT_ID_NULL)
|
65
|
+
ApiException.new.apiexception(err,log_obj)
|
66
|
+
elsif !@merchantId.instance_of? String
|
67
|
+
@merchantId=@merchantId.to_s
|
68
|
+
end
|
69
|
+
if @authenticationType.to_s.empty?
|
70
|
+
err = raise StandardError.new(Constants::ERROR_PREFIX + Constants::AUTH_TYPE_MANDATORY)
|
71
|
+
ApiException.new.apiexception(err,log_obj)
|
72
|
+
end
|
73
|
+
if !@authenticationType.instance_of? String
|
74
|
+
err = raise StandardError.new(Constants::ERROR_PREFIX+ Constants::AUTH_ERROR)
|
75
|
+
ApiException.new.apiexception(err,log_obj)
|
76
|
+
end
|
77
|
+
if !@runEnvironment.to_s.empty?
|
78
|
+
if !@runEnvironment.instance_of? String
|
79
|
+
@requestHost = @runEnvironment.to_s
|
80
|
+
elsif @runEnvironment.upcase == Constants::RUN_ENV_PROD
|
81
|
+
@requestHost = Constants::PRODUCTION_URL
|
82
|
+
elsif @runEnvironment.upcase == Constants::RUN_ENV_SANDBOX
|
83
|
+
@requestHost = Constants::SANDBOX_URL
|
84
|
+
else
|
85
|
+
@requestHost = @runEnvironment
|
86
|
+
end
|
87
|
+
elsif @runEnvironment.to_s.empty?
|
88
|
+
err = raise StandardError.new(Constants::ERROR_PREFIX + Constants::RUN_ENVIRONMENT)
|
89
|
+
ApiException.new.apiexception(err,log_obj)
|
90
|
+
end
|
91
|
+
if @authenticationType.upcase == Constants::AUTH_TYPE_JWT
|
92
|
+
if @keyAlias.to_s.empty?
|
93
|
+
@keyAlias = @merchantId
|
94
|
+
ApiException.new.apiwarning(Constants::WARNING_PREFIX + Constants::KEY_ALIAS_NULL_EMPTY, log_obj)
|
95
|
+
elsif !@keyAlias.instance_of? String
|
96
|
+
@keyAlias=@keyAlias.to_s
|
97
|
+
elsif @keyAlias != @merchantId
|
98
|
+
@keyAlias = @merchantId
|
99
|
+
ApiException.new.apiwarning(Constants::WARNING_PREFIX + Constants::INCORRECT_KEY_ALIAS, log_obj)
|
100
|
+
end
|
101
|
+
if @keyPass.to_s.empty?
|
102
|
+
@keyPass = @merchantId
|
103
|
+
ApiException.new.apiwarning(Constants::WARNING_PREFIX + Constants::KEY_PASS_NULL, log_obj)
|
104
|
+
elsif !@keyPass.instance_of? String
|
105
|
+
@keyPass=@keyPass.to_s
|
106
|
+
end
|
107
|
+
if @keysDirectory.to_s.empty?
|
108
|
+
@keysDirectory = Constants::DEFAULT_KEY_DIRECTORY
|
109
|
+
ApiException.new.apiwarning(Constants::WARNING_PREFIX + Constants::KEY_DIRECTORY_EMPTY + @keysDirectory, log_obj)
|
110
|
+
elsif !@keysDirectory.instance_of? String
|
111
|
+
@keysDirectory=@keysDirectory.to_s
|
112
|
+
end
|
113
|
+
if @keyFilename.to_s.empty?
|
114
|
+
@keyFilename = @merchantId
|
115
|
+
ApiException.new.apiwarning(Constants::WARNING_PREFIX + Constants::KEY_FILE_NAME_NULL_EMPTY, log_obj)
|
116
|
+
elsif !@keyFilename.instance_of? String
|
117
|
+
@keyFilename=@keyFilename.to_s
|
118
|
+
end
|
119
|
+
end
|
120
|
+
if @authenticationType.upcase == Constants::AUTH_TYPE_HTTP
|
121
|
+
if @merchantKeyId.to_s.empty?
|
122
|
+
err = raise StandardError.new(Constants::ERROR_PREFIX+ Constants::MERCHANT_KEY_ID_MANDATORY)
|
123
|
+
ApiException.new.apiexception(err,log_obj)
|
124
|
+
elsif !@merchantKeyId.instance_of? String
|
125
|
+
@merchantKeyId=@merchantKeyId.to_s
|
126
|
+
end
|
127
|
+
if @merchantSecretKey.to_s.empty?
|
128
|
+
err = raise StandardError.new(Constants::ERROR_PREFIX+ Constants::MERCHANT_SECRET_KEY_MANDATORY)
|
129
|
+
ApiException.new.apiexception(err,log_obj)
|
130
|
+
elsif !@merchantSecretKey.instance_of? String
|
131
|
+
@merchantSecretKey=@merchantSecretKey.to_s
|
132
|
+
end
|
133
|
+
end
|
134
|
+
if !@proxyAddress.instance_of? String
|
135
|
+
@proxyAddress=@proxyAddress.to_s
|
136
|
+
end
|
137
|
+
if !@proxyPort.instance_of? String
|
138
|
+
@proxyPort=@proxyPort.to_s
|
139
|
+
end
|
140
|
+
end
|
141
|
+
def logAllProperties(propertyObj)
|
142
|
+
merchantConfig = ''
|
143
|
+
hiddenProperties = (Constants::HIDDEN_MERCHANT_PROPERTIES).split(',')
|
144
|
+
hiddenPropArray = Array.new
|
145
|
+
hiddenProperties.each do |value|
|
146
|
+
hiddenPropArray << value.strip
|
147
|
+
end
|
148
|
+
hiddenPropArray.each do |prop|
|
149
|
+
propertyObj.each do |key, value|
|
150
|
+
if key == prop
|
151
|
+
propertyObj.delete(key)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
155
|
+
@log_obj.logger.info('MERCHCFG >' + propertyObj.to_s)
|
156
|
+
end
|
157
|
+
|
158
|
+
# getter and setter methods
|
159
|
+
attr_accessor :merchantId
|
160
|
+
attr_accessor :merchantSecretKey
|
161
|
+
attr_accessor :merchantKeyId
|
162
|
+
attr_accessor :authenticationType
|
163
|
+
attr_accessor :keysDirectory
|
164
|
+
attr_accessor :requestHost
|
165
|
+
attr_accessor :keyAlias
|
166
|
+
attr_accessor :keyPass
|
167
|
+
attr_accessor :keyFilename
|
168
|
+
attr_accessor :requestJsonData
|
169
|
+
attr_accessor :requestUrl
|
170
|
+
attr_accessor :requestType
|
171
|
+
attr_accessor :getId
|
172
|
+
attr_accessor :logDirectory
|
173
|
+
attr_accessor :logFilename
|
174
|
+
attr_accessor :enableLog
|
175
|
+
attr_accessor :logSize
|
176
|
+
attr_accessor :logger
|
177
|
+
attr_accessor :proxyAddress
|
178
|
+
attr_accessor :proxyPort
|
179
|
+
attr_accessor :requestTarget
|
180
|
+
attr_accessor :log_obj
|
181
|
+
end
|