cybersource_rest_client 0.0.30 → 0.0.34
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/lib/AuthenticationSDK/authentication/oauth/OAuthToken.rb +15 -0
- data/lib/AuthenticationSDK/core/Authorization.rb +4 -1
- data/lib/AuthenticationSDK/core/MerchantConfig.rb +93 -19
- data/lib/AuthenticationSDK/util/Constants.rb +77 -75
- data/lib/cybersource_rest_client/api/o_auth_api.rb +104 -0
- data/lib/cybersource_rest_client/api/payments_api.rb +2 -2
- data/lib/cybersource_rest_client/api/refund_api.rb +4 -4
- data/lib/cybersource_rest_client/api/void_api.rb +4 -4
- data/lib/cybersource_rest_client/api_client.rb +31 -8
- data/lib/cybersource_rest_client/configuration.rb +2 -2
- data/lib/cybersource_rest_client/models/access_token_response.rb +244 -0
- data/lib/cybersource_rest_client/models/add_negative_list_request.rb +1 -1
- data/lib/cybersource_rest_client/models/bad_request_error.rb +192 -0
- data/lib/cybersource_rest_client/models/create_access_token_request.rb +254 -0
- data/lib/cybersource_rest_client/models/fraud_marking_action_request.rb +1 -1
- data/lib/cybersource_rest_client/models/inline_response_400_2.rb +1 -1
- data/lib/cybersource_rest_client/models/invoicing_v2_invoice_settings_get200_response.rb +1 -1
- data/lib/cybersource_rest_client/models/invoicing_v2_invoices_all_get200_response.rb +1 -1
- data/lib/cybersource_rest_client/models/invoicing_v2_invoices_all_get200_response_customer_information.rb +20 -4
- data/lib/cybersource_rest_client/models/invoicing_v2_invoices_all_get200_response_invoices.rb +1 -1
- data/lib/cybersource_rest_client/models/invoicing_v2_invoices_all_get400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/invoicing_v2_invoices_all_get404_response.rb +1 -1
- data/lib/cybersource_rest_client/models/invoicing_v2_invoices_all_get502_response.rb +1 -1
- data/lib/cybersource_rest_client/models/invoicing_v2_invoices_get200_response.rb +2 -2
- data/lib/cybersource_rest_client/models/invoicing_v2_invoices_post201_response.rb +2 -2
- data/lib/cybersource_rest_client/models/invoicing_v2_invoices_post202_response.rb +1 -1
- data/lib/cybersource_rest_client/models/invoicingv2invoices_customer_information.rb +20 -4
- data/lib/cybersource_rest_client/models/kms_v2_keys_asym_deletes_post200_response.rb +1 -1
- data/lib/cybersource_rest_client/models/kms_v2_keys_asym_get200_response.rb +1 -1
- data/lib/cybersource_rest_client/models/kms_v2_keys_asym_post201_response.rb +1 -1
- data/lib/cybersource_rest_client/models/kms_v2_keys_sym_deletes_post200_response.rb +1 -1
- data/lib/cybersource_rest_client/models/kms_v2_keys_sym_get200_response.rb +1 -1
- data/lib/cybersource_rest_client/models/kms_v2_keys_sym_post201_response.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v1_transaction_batches_get200_response.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v1_transaction_batches_get400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v1_transaction_batches_get500_response.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response.rb +3 -3
- data/lib/cybersource_rest_client/models/pts_v2_incremental_authorization_patch201_response.rb +3 -3
- data/lib/cybersource_rest_client/models/pts_v2_incremental_authorization_patch201_response_error_information.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_incremental_authorization_patch201_response_processor_information.rb +6 -0
- data/lib/cybersource_rest_client/models/pts_v2_incremental_authorization_patch400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_captures_post201_response.rb +3 -3
- data/lib/cybersource_rest_client/models/pts_v2_payments_captures_post400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response.rb +13 -4
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_consumer_authentication_information.rb +11 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_error_information.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_order_information.rb +13 -4
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_order_information_reward_points_details.rb +270 -0
- data/lib/cybersource_rest_client/models/{pts_v2_payments_post201_response_payment_information_card.rb → pts_v2_payments_post201_response_payment_account_information.rb} +8 -9
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_account_information_card.rb +242 -0
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_tokenized_card.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processing_information.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information.rb +9 -13
- data/lib/cybersource_rest_client/models/pts_v2_payments_post400_response.rb +2 -2
- data/lib/cybersource_rest_client/models/pts_v2_payments_post502_response.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response.rb +3 -3
- data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post201_response.rb +3 -3
- data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_voids_post201_response.rb +2 -2
- data/lib/cybersource_rest_client/models/pts_v2_payments_voids_post400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_error_information.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_merchant_information_merchant_descriptor.rb +6 -0
- data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_order_information_amount_details.rb +2 -2
- data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_recipient_information_card.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payouts_post400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/ptsv2credits_processing_information.rb +2 -2
- data/lib/cybersource_rest_client/models/ptsv2payments_client_reference_information.rb +1 -1
- data/lib/cybersource_rest_client/models/ptsv2payments_consumer_authentication_information.rb +27 -1
- data/lib/cybersource_rest_client/models/ptsv2payments_merchant_information_merchant_descriptor.rb +6 -0
- data/lib/cybersource_rest_client/models/ptsv2payments_order_information_amount_details.rb +2 -2
- data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_card.rb +4 -4
- data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_fluid_data.rb +3 -3
- data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_tokenized_card.rb +1 -1
- data/lib/cybersource_rest_client/models/ptsv2payments_point_of_sale_information.rb +38 -38
- data/lib/cybersource_rest_client/models/ptsv2payments_processing_information.rb +16 -6
- data/lib/cybersource_rest_client/models/ptsv2payments_risk_information.rb +15 -4
- data/lib/cybersource_rest_client/models/ptsv2payments_risk_information_auxiliary_data.rb +207 -0
- data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_payment_information_card.rb +1 -1
- data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_processing_information.rb +15 -5
- data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information_card.rb +4 -4
- data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_processing_information.rb +1 -1
- data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_client_reference_information.rb +17 -1
- data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_processing_information.rb +1 -1
- data/lib/cybersource_rest_client/models/ptsv2payouts_merchant_information_merchant_descriptor.rb +6 -0
- data/lib/cybersource_rest_client/models/ptsv2payouts_payment_information_card.rb +4 -4
- data/lib/cybersource_rest_client/models/resource_not_found_error.rb +192 -0
- data/lib/cybersource_rest_client/models/risk_v1_address_verifications_post201_response.rb +3 -3
- data/lib/cybersource_rest_client/models/risk_v1_authentication_results_post201_response.rb +3 -3
- data/lib/cybersource_rest_client/models/risk_v1_authentication_setups_post201_response.rb +2 -2
- data/lib/cybersource_rest_client/models/risk_v1_authentications_post201_response.rb +3 -3
- data/lib/cybersource_rest_client/models/risk_v1_authentications_post400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/risk_v1_authentications_post400_response_1.rb +1 -1
- data/lib/cybersource_rest_client/models/risk_v1_decisions_post201_response.rb +3 -3
- data/lib/cybersource_rest_client/models/risk_v1_decisions_post400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/risk_v1_decisions_post400_response_1.rb +1 -1
- data/lib/cybersource_rest_client/models/risk_v1_export_compliance_inquiries_post201_response.rb +3 -3
- data/lib/cybersource_rest_client/models/risk_v1_update_post201_response.rb +2 -2
- data/lib/cybersource_rest_client/models/riskv1authenticationresults_consumer_authentication_information.rb +1 -1
- data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information_card.rb +3 -3
- data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information_tokenized_card.rb +1 -1
- data/lib/cybersource_rest_client/models/riskv1authentications_payment_information_card.rb +3 -3
- data/lib/cybersource_rest_client/models/riskv1authentications_payment_information_tokenized_card.rb +1 -1
- data/lib/cybersource_rest_client/models/riskv1authenticationsetups_payment_information_card.rb +3 -3
- data/lib/cybersource_rest_client/models/riskv1authenticationsetups_payment_information_fluid_data.rb +3 -3
- data/lib/cybersource_rest_client/models/riskv1authenticationsetups_payment_information_tokenized_card.rb +1 -1
- data/lib/cybersource_rest_client/models/riskv1authenticationsetups_processing_information.rb +1 -1
- data/lib/cybersource_rest_client/models/riskv1decisions_client_reference_information.rb +17 -1
- data/lib/cybersource_rest_client/models/riskv1decisions_device_information.rb +1 -11
- data/lib/cybersource_rest_client/models/riskv1decisions_payment_information_card.rb +3 -3
- data/lib/cybersource_rest_client/models/riskv1decisions_payment_information_tokenized_card.rb +1 -1
- data/lib/cybersource_rest_client/models/riskv1decisions_risk_information.rb +15 -4
- data/lib/cybersource_rest_client/models/riskv1liststypeentries_client_reference_information.rb +224 -0
- data/lib/cybersource_rest_client/models/riskv1liststypeentries_payment_information_card.rb +1 -1
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response.rb +3 -3
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_consumer_authentication_information.rb +13 -4
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_consumer_authentication_information_strong_authentication.rb +254 -0
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_order_information_amount_details.rb +2 -2
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_card.rb +5 -5
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processing_information.rb +2 -2
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processing_information_authorization_options.rb +13 -4
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processor_information.rb +8 -12
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_risk_information.rb +1 -1
- data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response.rb +1 -1
- data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_merchant_information.rb +1 -1
- data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_order_information_bill_to.rb +17 -1
- data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_payment_information_card.rb +3 -3
- data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_processing_information.rb +2 -2
- data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_processor_information.rb +6 -0
- data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_transaction_summaries.rb +2 -2
- data/lib/cybersource_rest_client/models/tss_v2_transactions_post400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/unauthorized_client_error.rb +192 -0
- data/lib/cybersource_rest_client/models/validate_export_compliance_request.rb +1 -1
- data/lib/cybersource_rest_client/models/vas_v2_payments_post201_response.rb +2 -2
- data/lib/cybersource_rest_client/models/vas_v2_payments_post400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/vas_v2_tax_void200_response.rb +2 -2
- data/lib/cybersource_rest_client/models/vas_v2_tax_voids_post400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/verify_customer_address_request.rb +1 -1
- data/lib/cybersource_rest_client.rb +12 -1
- metadata +113 -93
- data/lib/AuthenticationSDK/resource/TRRReports.json +0 -12
- data/lib/AuthenticationSDK/resource/cybs.yml +0 -31
- data/lib/AuthenticationSDK/resource/request.json +0 -54
- data/lib/AuthenticationSDK/resource/request_capture.json +0 -11
- data/lib/AuthenticationSDK/resource/testrest.p12 +0 -0
- data/lib/AuthenticationSDK/spec/Authorization_spec.rb +0 -274
- data/lib/AuthenticationSDK/spec/MerchantConfigData.rb +0 -59
- data/lib/AuthenticationSDK/spec/MerchantConfig_spec.rb +0 -116
- data/lib/AuthenticationSDK/spec/PostRequestData.json +0 -54
- data/lib/AuthenticationSDK/spec/PutRequestData.json +0 -12
- data/lib/AuthenticationSDK/spec/ResponseCodeMessage_spec.rb +0 -60
- data/lib/AuthenticationSDK/spec/spec_helper.rb +0 -12
|
@@ -21,7 +21,7 @@ module CyberSource
|
|
|
21
21
|
@api_client.set_configuration(config)
|
|
22
22
|
end
|
|
23
23
|
# Process a Payment
|
|
24
|
-
# A payment authorizes the amount for the transaction. There are a number of supported payment feature, such as E-commerce and Card Present - Credit Card/Debit Card, Echeck, e-Wallets, Level II/III Data, etc.. A payment response includes the status of the request. It also includes processor-specific information when the request is successful and errors if unsuccessful. See the [Payments Developer Guides Page](https://developer.cybersource.com/api/developer-guides/dita-payments/GettingStarted.html). Authorization can be requested with Capture, Decision Manager, Payer Authentication(3ds), and Token Creation. Find more on [Authorization with Add-On Features page.]
|
|
24
|
+
# A payment authorizes the amount for the transaction. There are a number of supported payment feature, such as E-commerce and Card Present - Credit Card/Debit Card, Echeck, e-Wallets, Level II/III Data, etc.. A payment response includes the status of the request. It also includes processor-specific information when the request is successful and errors if unsuccessful. See the [Payments Developer Guides Page](https://developer.cybersource.com/api/developer-guides/dita-payments/GettingStarted.html). Authorization can be requested with Capture, Decision Manager, Payer Authentication(3ds), and Token Creation. Find more on [Authorization with Add-On Features page.](https://developer.cybersource.com/api/authorization-add-ons.html)
|
|
25
25
|
# @param create_payment_request
|
|
26
26
|
# @param [Hash] opts the optional parameters
|
|
27
27
|
# @return [PtsV2PaymentsPost201Response]
|
|
@@ -31,7 +31,7 @@ module CyberSource
|
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
# Process a Payment
|
|
34
|
-
# A payment authorizes the amount for the transaction. There are a number of supported payment feature, such as E-commerce and Card Present - Credit Card/Debit Card, Echeck, e-Wallets, Level II/III Data, etc.. A payment response includes the status of the request. It also includes processor-specific information when the request is successful and errors if unsuccessful. See the [Payments Developer Guides Page](https://developer.cybersource.com/api/developer-guides/dita-payments/GettingStarted.html). Authorization can be requested with Capture, Decision Manager, Payer Authentication(3ds), and Token Creation. Find more on [Authorization with Add-On Features page.]
|
|
34
|
+
# A payment authorizes the amount for the transaction. There are a number of supported payment feature, such as E-commerce and Card Present - Credit Card/Debit Card, Echeck, e-Wallets, Level II/III Data, etc.. A payment response includes the status of the request. It also includes processor-specific information when the request is successful and errors if unsuccessful. See the [Payments Developer Guides Page](https://developer.cybersource.com/api/developer-guides/dita-payments/GettingStarted.html). Authorization can be requested with Capture, Decision Manager, Payer Authentication(3ds), and Token Creation. Find more on [Authorization with Add-On Features page.](https://developer.cybersource.com/api/authorization-add-ons.html)
|
|
35
35
|
# @param create_payment_request
|
|
36
36
|
# @param [Hash] opts the optional parameters
|
|
37
37
|
# @return [Array<(PtsV2PaymentsPost201Response, Fixnum, Hash)>] PtsV2PaymentsPost201Response data, response status code and response headers
|
|
@@ -21,7 +21,7 @@ module CyberSource
|
|
|
21
21
|
@api_client.set_configuration(config)
|
|
22
22
|
end
|
|
23
23
|
# Refund a Capture
|
|
24
|
-
# Refund a capture API is only used, if you have requested Capture independenlty using [/pts/v2/payments/{id}/captures](https://developer.cybersource.com/api-reference-assets/index.html#payments_capture) API call Include the capture ID in the POST request to refund the captured amount.
|
|
24
|
+
# Refund a capture API is only used, if you have requested Capture independenlty using [/pts/v2/payments/{id}/captures](https://developer.cybersource.com/api-reference-assets/index.html#payments_capture) API call. Include the capture ID in the POST request to refund the captured amount.
|
|
25
25
|
# @param refund_capture_request
|
|
26
26
|
# @param id The capture ID. This ID is returned from a previous capture request.
|
|
27
27
|
# @param [Hash] opts the optional parameters
|
|
@@ -32,7 +32,7 @@ module CyberSource
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
# Refund a Capture
|
|
35
|
-
# Refund a capture API is only used, if you have requested Capture independenlty using [/pts/v2/payments/{id}/captures](https://developer.cybersource.com/api-reference-assets/index.html#payments_capture) API call Include the capture ID in the POST request to refund the captured amount.
|
|
35
|
+
# Refund a capture API is only used, if you have requested Capture independenlty using [/pts/v2/payments/{id}/captures](https://developer.cybersource.com/api-reference-assets/index.html#payments_capture) API call. Include the capture ID in the POST request to refund the captured amount.
|
|
36
36
|
# @param refund_capture_request
|
|
37
37
|
# @param id The capture ID. This ID is returned from a previous capture request.
|
|
38
38
|
# @param [Hash] opts the optional parameters
|
|
@@ -92,7 +92,7 @@ module CyberSource
|
|
|
92
92
|
return data, status_code, headers
|
|
93
93
|
end
|
|
94
94
|
# Refund a Payment
|
|
95
|
-
# Refund a Payment API is only used, if you have requested Authorization and Capture together in [/pts/v2/payments](https://developer.cybersource.com/api-reference-assets/index.html#payments_payments) API call.
|
|
95
|
+
# Refund a Payment API is only used, if you have requested Authorization and Capture together in [/pts/v2/payments](https://developer.cybersource.com/api-reference-assets/index.html#payments_payments) API call. Include the payment ID in the POST request to refund the payment amount.
|
|
96
96
|
# @param refund_payment_request
|
|
97
97
|
# @param id The payment ID. This ID is returned from a previous payment request.
|
|
98
98
|
# @param [Hash] opts the optional parameters
|
|
@@ -103,7 +103,7 @@ module CyberSource
|
|
|
103
103
|
end
|
|
104
104
|
|
|
105
105
|
# Refund a Payment
|
|
106
|
-
# Refund a Payment API is only used, if you have requested Authorization and Capture together in [/pts/v2/payments](https://developer.cybersource.com/api-reference-assets/index.html#payments_payments) API call.
|
|
106
|
+
# Refund a Payment API is only used, if you have requested Authorization and Capture together in [/pts/v2/payments](https://developer.cybersource.com/api-reference-assets/index.html#payments_payments) API call. Include the payment ID in the POST request to refund the payment amount.
|
|
107
107
|
# @param refund_payment_request
|
|
108
108
|
# @param id The payment ID. This ID is returned from a previous payment request.
|
|
109
109
|
# @param [Hash] opts the optional parameters
|
|
@@ -86,7 +86,7 @@ module CyberSource
|
|
|
86
86
|
return data, status_code, headers
|
|
87
87
|
end
|
|
88
88
|
# Void a Capture
|
|
89
|
-
# Refund a capture API is only used, if you have requested Capture independenlty using [/pts/v2/payments/{id}/captures](https://developer.cybersource.com/api-reference-assets/index.html#payments_capture) API call.
|
|
89
|
+
# Refund a capture API is only used, if you have requested Capture independenlty using [/pts/v2/payments/{id}/captures](https://developer.cybersource.com/api-reference-assets/index.html#payments_capture) API call. Include the capture ID in the POST request to cancel the capture.
|
|
90
90
|
# @param void_capture_request
|
|
91
91
|
# @param id The capture ID returned from a previous capture request.
|
|
92
92
|
# @param [Hash] opts the optional parameters
|
|
@@ -97,7 +97,7 @@ module CyberSource
|
|
|
97
97
|
end
|
|
98
98
|
|
|
99
99
|
# Void a Capture
|
|
100
|
-
# Refund a capture API is only used, if you have requested Capture independenlty using [/pts/v2/payments/{id}/captures](https://developer.cybersource.com/api-reference-assets/index.html#payments_capture) API call.
|
|
100
|
+
# Refund a capture API is only used, if you have requested Capture independenlty using [/pts/v2/payments/{id}/captures](https://developer.cybersource.com/api-reference-assets/index.html#payments_capture) API call. Include the capture ID in the POST request to cancel the capture.
|
|
101
101
|
# @param void_capture_request
|
|
102
102
|
# @param id The capture ID returned from a previous capture request.
|
|
103
103
|
# @param [Hash] opts the optional parameters
|
|
@@ -228,7 +228,7 @@ module CyberSource
|
|
|
228
228
|
return data, status_code, headers
|
|
229
229
|
end
|
|
230
230
|
# Void a Payment
|
|
231
|
-
# Void a Payment API is only used, if you have requested Authorization and Capture together in [/pts/v2/payments](https://developer.cybersource.com/api-reference-assets/index.html#payments_payments) API call.
|
|
231
|
+
# Void a Payment API is only used, if you have requested Authorization and Capture together in [/pts/v2/payments](https://developer.cybersource.com/api-reference-assets/index.html#payments_payments) API call. Include the payment ID in the POST request to cancel the payment.
|
|
232
232
|
# @param void_payment_request
|
|
233
233
|
# @param id The payment ID returned from a previous payment request.
|
|
234
234
|
# @param [Hash] opts the optional parameters
|
|
@@ -239,7 +239,7 @@ module CyberSource
|
|
|
239
239
|
end
|
|
240
240
|
|
|
241
241
|
# Void a Payment
|
|
242
|
-
# Void a Payment API is only used, if you have requested Authorization and Capture together in [/pts/v2/payments](https://developer.cybersource.com/api-reference-assets/index.html#payments_payments) API call.
|
|
242
|
+
# Void a Payment API is only used, if you have requested Authorization and Capture together in [/pts/v2/payments](https://developer.cybersource.com/api-reference-assets/index.html#payments_payments) API call. Include the payment ID in the POST request to cancel the payment.
|
|
243
243
|
# @param void_payment_request
|
|
244
244
|
# @param id The payment ID returned from a previous payment request.
|
|
245
245
|
# @param [Hash] opts the optional parameters
|
|
@@ -15,7 +15,7 @@ require 'json'
|
|
|
15
15
|
require 'logger'
|
|
16
16
|
require 'tempfile'
|
|
17
17
|
require 'typhoeus'
|
|
18
|
-
require 'uri'
|
|
18
|
+
require 'addressable/uri'
|
|
19
19
|
|
|
20
20
|
module CyberSource
|
|
21
21
|
class ApiClient
|
|
@@ -39,7 +39,6 @@ module CyberSource
|
|
|
39
39
|
@config = config
|
|
40
40
|
@user_agent = "Swagger-Codegen/#{VERSION}/ruby"
|
|
41
41
|
@default_headers = {
|
|
42
|
-
'Content-Type' => 'application/json',
|
|
43
42
|
'User-Agent' => @user_agent
|
|
44
43
|
}
|
|
45
44
|
|
|
@@ -113,17 +112,27 @@ module CyberSource
|
|
|
113
112
|
body_params = opts[:body] || {}
|
|
114
113
|
query_params = opts[:query_params] || {}
|
|
115
114
|
if !query_params.empty?
|
|
116
|
-
query_params = URI.
|
|
115
|
+
query_params = Addressable::URI.form_encode(query_params)
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
headers = opts[:header_params]
|
|
119
|
+
if $merchantconfig_obj.authenticationType.upcase != Constants::AUTH_TYPE_MUTUAL_AUTH
|
|
120
|
+
headers = CallAuthenticationHeader(http_method, path, body_params, headers, query_params)
|
|
117
121
|
end
|
|
118
|
-
headers = CallAuthenticationHeader(http_method, path, body_params, opts[:header_params], query_params)
|
|
119
122
|
http_method = http_method.to_sym.downcase
|
|
120
|
-
header_params =
|
|
123
|
+
header_params = headers.merge(@default_headers)
|
|
121
124
|
form_params = opts[:form_params] || {}
|
|
122
125
|
|
|
123
126
|
|
|
124
127
|
# set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
|
|
125
128
|
_verify_ssl_host = @config.verify_ssl_host ? 2 : 0
|
|
126
129
|
|
|
130
|
+
# client cert
|
|
131
|
+
if $merchantconfig_obj.enableClientCert
|
|
132
|
+
@config.cert_file = File.join($merchantconfig_obj.clientCertDirectory, $merchantconfig_obj.sslClientCert)
|
|
133
|
+
@config.key_file = File.join($merchantconfig_obj.clientCertDirectory, $merchantconfig_obj.privateKey)
|
|
134
|
+
end
|
|
135
|
+
|
|
127
136
|
req_opts = {
|
|
128
137
|
:method => http_method,
|
|
129
138
|
:headers => header_params,
|
|
@@ -133,6 +142,7 @@ module CyberSource
|
|
|
133
142
|
:ssl_verifypeer => @config.verify_ssl,
|
|
134
143
|
:ssl_verifyhost => _verify_ssl_host,
|
|
135
144
|
:sslcert => @config.cert_file,
|
|
145
|
+
:sslkeypasswd => $merchantconfig_obj.sslKeyPassword || "",
|
|
136
146
|
:sslkey => @config.key_file,
|
|
137
147
|
:verbose => @config.debugging
|
|
138
148
|
}
|
|
@@ -208,9 +218,13 @@ module CyberSource
|
|
|
208
218
|
token = "Bearer " + token
|
|
209
219
|
header_params['Authorization'] = token
|
|
210
220
|
end
|
|
211
|
-
|
|
212
|
-
|
|
221
|
+
if $merchantconfig_obj.authenticationType.upcase == Constants::AUTH_TYPE_OAUTH
|
|
222
|
+
token = "Bearer " + token
|
|
223
|
+
header_params['Authorization'] = token
|
|
213
224
|
end
|
|
225
|
+
# header_params.each do |key, value|
|
|
226
|
+
# log_obj.logger.info("#{key} : #{value}")
|
|
227
|
+
# end
|
|
214
228
|
return header_params
|
|
215
229
|
end
|
|
216
230
|
def get_query_param(path, query_params)
|
|
@@ -359,7 +373,7 @@ module CyberSource
|
|
|
359
373
|
def build_request_url(path)
|
|
360
374
|
# Add leading and trailing slashes to path
|
|
361
375
|
path = "/#{path}".gsub(/\/+/, '/')
|
|
362
|
-
URI.encode(@config.base_url + path)
|
|
376
|
+
Addressable::URI.encode(@config.base_url + path)
|
|
363
377
|
end
|
|
364
378
|
|
|
365
379
|
# Builds the HTTP request body
|
|
@@ -382,6 +396,15 @@ module CyberSource
|
|
|
382
396
|
data[key] = value.to_s
|
|
383
397
|
end
|
|
384
398
|
end
|
|
399
|
+
JSON.parse(body).each do |key, value|
|
|
400
|
+
case value
|
|
401
|
+
when ::File, ::Array, nil
|
|
402
|
+
# let typhoeus handle File, Array and nil parameters
|
|
403
|
+
data[key] = value
|
|
404
|
+
else
|
|
405
|
+
data[key] = value.to_s
|
|
406
|
+
end
|
|
407
|
+
end
|
|
385
408
|
elsif body
|
|
386
409
|
data = body.is_a?(String) ? body : body.to_json
|
|
387
410
|
else
|
|
@@ -10,7 +10,7 @@ Swagger Codegen version: 2.2.3
|
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
13
|
-
require 'uri'
|
|
13
|
+
require 'addressable/uri'
|
|
14
14
|
|
|
15
15
|
module CyberSource
|
|
16
16
|
class Configuration
|
|
@@ -175,7 +175,7 @@ module CyberSource
|
|
|
175
175
|
|
|
176
176
|
def base_url
|
|
177
177
|
url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
|
|
178
|
-
URI.encode(url)
|
|
178
|
+
Addressable::URI.encode(url)
|
|
179
179
|
end
|
|
180
180
|
|
|
181
181
|
# Gets API key (with prefix if set).
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#OAuth2 API
|
|
3
|
+
|
|
4
|
+
#OAuth2 Token Service (OAuth2)
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: v3
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.2.3
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
|
|
15
|
+
module CyberSource
|
|
16
|
+
class AccessTokenResponse
|
|
17
|
+
# Created JWT token.
|
|
18
|
+
attr_accessor :access_token
|
|
19
|
+
|
|
20
|
+
# Bearer.
|
|
21
|
+
attr_accessor :token_type
|
|
22
|
+
|
|
23
|
+
# Newly created JWT token for initial request or if refresh token expired, else the same refresh token as in the request.
|
|
24
|
+
attr_accessor :refresh_token
|
|
25
|
+
|
|
26
|
+
# Number of seconds left till the access token gets expired.
|
|
27
|
+
attr_accessor :expires_in
|
|
28
|
+
|
|
29
|
+
# List of permissions for APIs.
|
|
30
|
+
attr_accessor :scope
|
|
31
|
+
|
|
32
|
+
# Number of seconds left till the refresh token gets expired.
|
|
33
|
+
attr_accessor :refresh_token_expires_in
|
|
34
|
+
|
|
35
|
+
# Successful response can be returned only if client status is active.
|
|
36
|
+
attr_accessor :client_status
|
|
37
|
+
|
|
38
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
39
|
+
def self.attribute_map
|
|
40
|
+
{
|
|
41
|
+
:'access_token' => :'access_token',
|
|
42
|
+
:'token_type' => :'token_type',
|
|
43
|
+
:'refresh_token' => :'refresh_token',
|
|
44
|
+
:'expires_in' => :'expires_in',
|
|
45
|
+
:'scope' => :'scope',
|
|
46
|
+
:'refresh_token_expires_in' => :'refresh_token_expires_in',
|
|
47
|
+
:'client_status' => :'client_status'
|
|
48
|
+
}
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Attribute type mapping.
|
|
52
|
+
def self.swagger_types
|
|
53
|
+
{
|
|
54
|
+
:'access_token' => :'String',
|
|
55
|
+
:'token_type' => :'String',
|
|
56
|
+
:'refresh_token' => :'String',
|
|
57
|
+
:'expires_in' => :'Integer',
|
|
58
|
+
:'scope' => :'String',
|
|
59
|
+
:'refresh_token_expires_in' => :'Integer',
|
|
60
|
+
:'client_status' => :'String'
|
|
61
|
+
}
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Initializes the object
|
|
65
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
66
|
+
def initialize(attributes = {})
|
|
67
|
+
return unless attributes.is_a?(Hash)
|
|
68
|
+
|
|
69
|
+
# convert string to symbol for hash key
|
|
70
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
71
|
+
|
|
72
|
+
if attributes.has_key?(:'access_token')
|
|
73
|
+
self.access_token = attributes[:'access_token']
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
if attributes.has_key?(:'token_type')
|
|
77
|
+
self.token_type = attributes[:'token_type']
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
if attributes.has_key?(:'refresh_token')
|
|
81
|
+
self.refresh_token = attributes[:'refresh_token']
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if attributes.has_key?(:'expires_in')
|
|
85
|
+
self.expires_in = attributes[:'expires_in']
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.has_key?(:'scope')
|
|
89
|
+
self.scope = attributes[:'scope']
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if attributes.has_key?(:'refresh_token_expires_in')
|
|
93
|
+
self.refresh_token_expires_in = attributes[:'refresh_token_expires_in']
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
if attributes.has_key?(:'client_status')
|
|
97
|
+
self.client_status = attributes[:'client_status']
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
102
|
+
# @return Array for valid properties with the reasons
|
|
103
|
+
def list_invalid_properties
|
|
104
|
+
invalid_properties = Array.new
|
|
105
|
+
invalid_properties
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Check to see if the all the properties in the model are valid
|
|
109
|
+
# @return true if the model is valid
|
|
110
|
+
def valid?
|
|
111
|
+
true
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Checks equality by comparing each attribute.
|
|
115
|
+
# @param [Object] Object to be compared
|
|
116
|
+
def ==(o)
|
|
117
|
+
return true if self.equal?(o)
|
|
118
|
+
self.class == o.class &&
|
|
119
|
+
access_token == o.access_token &&
|
|
120
|
+
token_type == o.token_type &&
|
|
121
|
+
refresh_token == o.refresh_token &&
|
|
122
|
+
expires_in == o.expires_in &&
|
|
123
|
+
scope == o.scope &&
|
|
124
|
+
refresh_token_expires_in == o.refresh_token_expires_in &&
|
|
125
|
+
client_status == o.client_status
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# @see the `==` method
|
|
129
|
+
# @param [Object] Object to be compared
|
|
130
|
+
def eql?(o)
|
|
131
|
+
self == o
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Calculates hash code according to all attributes.
|
|
135
|
+
# @return [Fixnum] Hash code
|
|
136
|
+
def hash
|
|
137
|
+
[access_token, token_type, refresh_token, expires_in, scope, refresh_token_expires_in, client_status].hash
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Builds the object from hash
|
|
141
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
142
|
+
# @return [Object] Returns the model itself
|
|
143
|
+
def build_from_hash(attributes)
|
|
144
|
+
return nil unless attributes.is_a?(Hash)
|
|
145
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
146
|
+
if type =~ /\AArray<(.*)>/i
|
|
147
|
+
# check to ensure the input is an array given that the the attribute
|
|
148
|
+
# is documented as an array but the input is not
|
|
149
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
150
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
151
|
+
end
|
|
152
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
153
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
154
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
self
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Deserializes the data based on type
|
|
161
|
+
# @param string type Data type
|
|
162
|
+
# @param string value Value to be deserialized
|
|
163
|
+
# @return [Object] Deserialized data
|
|
164
|
+
def _deserialize(type, value)
|
|
165
|
+
case type.to_sym
|
|
166
|
+
when :DateTime
|
|
167
|
+
DateTime.parse(value)
|
|
168
|
+
when :Date
|
|
169
|
+
Date.parse(value)
|
|
170
|
+
when :String
|
|
171
|
+
value.to_s
|
|
172
|
+
when :Integer
|
|
173
|
+
value.to_i
|
|
174
|
+
when :Float
|
|
175
|
+
value.to_f
|
|
176
|
+
when :BOOLEAN
|
|
177
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
178
|
+
true
|
|
179
|
+
else
|
|
180
|
+
false
|
|
181
|
+
end
|
|
182
|
+
when :Object
|
|
183
|
+
# generic object (usually a Hash), return directly
|
|
184
|
+
value
|
|
185
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
186
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
187
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
188
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
189
|
+
k_type = Regexp.last_match[:k_type]
|
|
190
|
+
v_type = Regexp.last_match[:v_type]
|
|
191
|
+
{}.tap do |hash|
|
|
192
|
+
value.each do |k, v|
|
|
193
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
194
|
+
end
|
|
195
|
+
end
|
|
196
|
+
else # model
|
|
197
|
+
temp_model = CyberSource.const_get(type).new
|
|
198
|
+
temp_model.build_from_hash(value)
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Returns the string representation of the object
|
|
203
|
+
# @return [String] String presentation of the object
|
|
204
|
+
def to_s
|
|
205
|
+
to_hash.to_s
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
209
|
+
# @return [Hash] Returns the object in the form of hash
|
|
210
|
+
def to_body
|
|
211
|
+
to_hash
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# Returns the object in the form of hash
|
|
215
|
+
# @return [Hash] Returns the object in the form of hash
|
|
216
|
+
def to_hash
|
|
217
|
+
hash = {}
|
|
218
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
219
|
+
value = self.send(attr)
|
|
220
|
+
next if value.nil?
|
|
221
|
+
hash[param] = _to_hash(value)
|
|
222
|
+
end
|
|
223
|
+
hash
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# Outputs non-array value in the form of hash
|
|
227
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
228
|
+
# @param [Object] value Any valid value
|
|
229
|
+
# @return [Hash] Returns the value in the form of hash
|
|
230
|
+
def _to_hash(value)
|
|
231
|
+
if value.is_a?(Array)
|
|
232
|
+
value.compact.map { |v| _to_hash(v) }
|
|
233
|
+
elsif value.is_a?(Hash)
|
|
234
|
+
{}.tap do |hash|
|
|
235
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
236
|
+
end
|
|
237
|
+
elsif value.respond_to? :to_hash
|
|
238
|
+
value.to_hash
|
|
239
|
+
else
|
|
240
|
+
value
|
|
241
|
+
end
|
|
242
|
+
end
|
|
243
|
+
end
|
|
244
|
+
end
|
|
@@ -43,7 +43,7 @@ module CyberSource
|
|
|
43
43
|
{
|
|
44
44
|
:'order_information' => :'Riskv1liststypeentriesOrderInformation',
|
|
45
45
|
:'payment_information' => :'Riskv1liststypeentriesPaymentInformation',
|
|
46
|
-
:'client_reference_information' => :'
|
|
46
|
+
:'client_reference_information' => :'Riskv1liststypeentriesClientReferenceInformation',
|
|
47
47
|
:'device_information' => :'Riskv1liststypeentriesDeviceInformation',
|
|
48
48
|
:'risk_information' => :'Riskv1liststypeentriesRiskInformation',
|
|
49
49
|
:'buyer_information' => :'Riskv1liststypeentriesBuyerInformation'
|