connect-sdk-ruby 1.36.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/connect-sdk-ruby.gemspec +1 -1
- data/examples/merchant/captures/get_capture_example.rb +1 -1
- data/examples/merchant/disputes/cancel_dispute_example.rb +1 -1
- data/examples/merchant/disputes/get_dispute_example.rb +1 -1
- data/examples/merchant/disputes/submit_dispute_example.rb +1 -1
- data/examples/merchant/disputes/upload_dispute_file_example.rb +30 -0
- data/examples/merchant/{products/get_payment_product_public_key_example.rb → files/get_file_example.rb} +7 -1
- data/examples/merchant/hostedcheckouts/create_hosted_checkout_example.rb +1 -1
- data/examples/merchant/hostedcheckouts/get_hosted_checkout_example.rb +1 -1
- data/examples/merchant/hostedmandatemanagements/create_hosted_mandate_management_example.rb +1 -1
- data/examples/merchant/hostedmandatemanagements/get_hosted_mandate_management_example.rb +1 -1
- data/examples/merchant/mandates/block_mandate_example.rb +1 -1
- data/examples/merchant/mandates/create_mandate_example.rb +1 -1
- data/examples/merchant/mandates/create_mandate_with_reference_example.rb +1 -1
- data/examples/merchant/mandates/get_mandate_example.rb +1 -1
- data/examples/merchant/mandates/revoke_mandate_example.rb +1 -1
- data/examples/merchant/mandates/unblock_mandate_example.rb +1 -1
- data/examples/merchant/payments/approve_payment_example.rb +1 -1
- data/examples/merchant/payments/cancel_approval_payment_example.rb +1 -1
- data/examples/merchant/payments/cancel_payment_example.rb +1 -1
- data/examples/merchant/payments/capture_payment_example.rb +1 -1
- data/examples/merchant/payments/complete_payment_example.rb +1 -1
- data/examples/merchant/payments/create_payment_dispute_example.rb +1 -1
- data/examples/merchant/payments/create_payment_example.rb +3 -3
- data/examples/merchant/payments/find_payments_example.rb +1 -1
- data/examples/merchant/payments/get_payment_captures_example.rb +1 -1
- data/examples/merchant/payments/get_payment_disputes_example.rb +1 -1
- data/examples/merchant/payments/get_payment_example.rb +1 -1
- data/examples/merchant/payments/get_refunds_example.rb +1 -1
- data/examples/merchant/payments/get_third_party_status_example.rb +1 -1
- data/examples/merchant/payments/process_challenged_payment_example.rb +1 -1
- data/examples/merchant/payments/refund_payment_example.rb +2 -2
- data/examples/merchant/payments/tokenize_payment_example.rb +1 -1
- data/examples/merchant/payouts/approve_payout_example.rb +1 -1
- data/examples/merchant/payouts/cancel_approval_payout_example.rb +1 -1
- data/examples/merchant/payouts/cancel_payout_example.rb +1 -1
- data/examples/merchant/payouts/create_payout_example.rb +2 -2
- data/examples/merchant/payouts/find_payouts_example.rb +1 -1
- data/examples/merchant/payouts/get_payout_example.rb +1 -1
- data/examples/merchant/productgroups/get_device_fingerprint_for_groups_example.rb +1 -1
- data/examples/merchant/productgroups/get_payment_product_group_example.rb +1 -1
- data/examples/merchant/productgroups/get_payment_product_groups_example.rb +1 -1
- data/examples/merchant/products/get_customer_details_example.rb +1 -1
- data/examples/merchant/products/get_device_fingerprint_example.rb +1 -1
- data/examples/merchant/products/get_directory_example.rb +1 -1
- data/examples/merchant/products/get_networks_example.rb +1 -1
- data/examples/merchant/products/get_payment_product_example.rb +1 -1
- data/examples/merchant/products/get_payment_products_example.rb +1 -1
- data/examples/merchant/refunds/approve_refund_example.rb +1 -1
- data/examples/merchant/refunds/cancel_approval_refund_example.rb +1 -1
- data/examples/merchant/refunds/cancel_refund_example.rb +1 -1
- data/examples/merchant/refunds/find_refunds_example.rb +1 -1
- data/examples/merchant/refunds/get_refund_example.rb +1 -1
- data/examples/merchant/riskassessments/risk_assessment_bank_account_example.rb +1 -1
- data/examples/merchant/riskassessments/risk_assessment_cards_example.rb +1 -1
- data/examples/merchant/services/convert_amount_example.rb +1 -1
- data/examples/merchant/services/convert_bank_account_example.rb +1 -1
- data/examples/merchant/services/get_privacy_policy_example.rb +1 -1
- data/examples/merchant/services/iin_details_example.rb +1 -1
- data/examples/merchant/services/test_connection_example.rb +1 -1
- data/examples/merchant/sessions/create_session_example.rb +1 -1
- data/examples/merchant/tokens/approve_sepa_direct_debit_token_example.rb +1 -1
- data/examples/merchant/tokens/create_token_example.rb +1 -1
- data/examples/merchant/tokens/delete_token_example.rb +1 -1
- data/examples/merchant/tokens/get_token_example.rb +1 -1
- data/examples/merchant/tokens/update_token_example.rb +1 -1
- data/lib/ingenico/connect/sdk.rb +3 -1
- data/lib/ingenico/connect/sdk/api_exception.rb +12 -14
- data/lib/ingenico/connect/sdk/api_resource.rb +14 -13
- data/lib/ingenico/connect/sdk/authenticator.rb +5 -4
- data/lib/ingenico/connect/sdk/call_context.rb +6 -6
- data/lib/ingenico/connect/sdk/client.rb +12 -11
- data/lib/ingenico/connect/sdk/communication_exception.rb +2 -1
- data/lib/ingenico/connect/sdk/communicator.rb +331 -128
- data/lib/ingenico/connect/sdk/communicator_configuration.rb +21 -39
- data/lib/ingenico/connect/sdk/connection.rb +16 -6
- data/lib/ingenico/connect/sdk/data_object.rb +2 -13
- data/lib/ingenico/connect/sdk/declined_payment_exception.rb +1 -1
- data/lib/ingenico/connect/sdk/declined_payout_exception.rb +1 -1
- data/lib/ingenico/connect/sdk/declined_refund_exception.rb +1 -1
- data/lib/ingenico/connect/sdk/defaultimpl/authorization_type.rb +2 -1
- data/lib/ingenico/connect/sdk/defaultimpl/default_authenticator.rb +9 -7
- data/lib/ingenico/connect/sdk/defaultimpl/default_connection.rb +212 -68
- data/lib/ingenico/connect/sdk/defaultimpl/default_marshaller.rb +2 -2
- data/lib/ingenico/connect/sdk/domain/capture/capture.rb +12 -15
- data/lib/ingenico/connect/sdk/domain/capture/capture_output.rb +43 -60
- data/lib/ingenico/connect/sdk/domain/capture/capture_status_output.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/capture/captures_response.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/definitions/abstract_order_status.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/definitions/abstract_payment_method_specific_input.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/definitions/additional_order_input_airline_data.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/definitions/address.rb +25 -24
- data/lib/ingenico/connect/sdk/domain/definitions/airline_data.rb +76 -79
- data/lib/ingenico/connect/sdk/domain/definitions/airline_flight_leg.rb +62 -61
- data/lib/ingenico/connect/sdk/domain/definitions/airline_passenger.rb +13 -12
- data/lib/ingenico/connect/sdk/domain/definitions/amount_of_money.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/definitions/bank_account.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/definitions/bank_account_bban.rb +19 -18
- data/lib/ingenico/connect/sdk/domain/definitions/bank_account_iban.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/definitions/card.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/definitions/card_essentials.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/definitions/card_fraud_results.rb +15 -18
- data/lib/ingenico/connect/sdk/domain/definitions/card_without_cvv.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/definitions/company_information.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/definitions/contact_details_base.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/definitions/customer_base.rb +12 -13
- data/lib/ingenico/connect/sdk/domain/definitions/fraud_fields.rb +70 -75
- data/lib/ingenico/connect/sdk/domain/definitions/fraud_fields_shipping_details.rb +14 -13
- data/lib/ingenico/connect/sdk/domain/definitions/fraud_results.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/definitions/fraud_results_retail_decisions.rb +10 -9
- data/lib/ingenico/connect/sdk/domain/definitions/fraugster_results.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/definitions/key_value_pair.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/definitions/order_status_output.rb +17 -18
- data/lib/ingenico/connect/sdk/domain/definitions/payment_product_filter.rb +9 -12
- data/lib/ingenico/connect/sdk/domain/definitions/personal_name_base.rb +10 -9
- data/lib/ingenico/connect/sdk/domain/definitions/redirect_data_base.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/definitions/result_do_risk_assessment.rb +15 -18
- data/lib/ingenico/connect/sdk/domain/definitions/retail_decisions_cc_fraud_check_output.rb +10 -9
- data/lib/ingenico/connect/sdk/domain/definitions/validation_bank_account_check.rb +10 -9
- data/lib/ingenico/connect/sdk/domain/definitions/validation_bank_account_output.rb +17 -18
- data/lib/ingenico/connect/sdk/domain/dispute/create_dispute_request.rb +17 -18
- data/lib/ingenico/connect/sdk/domain/dispute/dispute.rb +18 -21
- data/lib/ingenico/connect/sdk/domain/dispute/dispute_creation_detail.rb +10 -9
- data/lib/ingenico/connect/sdk/domain/dispute/dispute_output.rb +32 -39
- data/lib/ingenico/connect/sdk/domain/dispute/dispute_reference.rb +16 -15
- data/lib/ingenico/connect/sdk/domain/dispute/dispute_status_output.rb +13 -12
- data/lib/ingenico/connect/sdk/domain/dispute/disputes_response.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/dispute/upload_dispute_file_response.rb +39 -0
- data/lib/ingenico/connect/sdk/domain/errors/api_error.rb +22 -21
- data/lib/ingenico/connect/sdk/domain/errors/error_response.rb +8 -9
- data/lib/ingenico/connect/sdk/domain/file/hosted_file.rb +13 -12
- data/lib/ingenico/connect/sdk/domain/hostedcheckout/create_hosted_checkout_request.rb +45 -66
- data/lib/ingenico/connect/sdk/domain/hostedcheckout/create_hosted_checkout_response.rb +17 -18
- data/lib/ingenico/connect/sdk/domain/hostedcheckout/created_payment_output.rb +23 -28
- data/lib/ingenico/connect/sdk/domain/hostedcheckout/displayed_data.rb +11 -12
- data/lib/ingenico/connect/sdk/domain/hostedcheckout/get_hosted_checkout_response.rb +8 -9
- data/lib/ingenico/connect/sdk/domain/hostedcheckout/hosted_checkout_specific_input.rb +29 -30
- data/lib/ingenico/connect/sdk/domain/hostedcheckout/mobile_payment_method_specific_input_hosted_checkout.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/hostedcheckout/mobile_payment_product320_specific_input_hosted_checkout.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/hostedcheckout/payment_product_filters_hosted_checkout.rb +12 -15
- data/lib/ingenico/connect/sdk/domain/hostedmandatemanagement/create_hosted_mandate_management_request.rb +9 -12
- data/lib/ingenico/connect/sdk/domain/hostedmandatemanagement/create_hosted_mandate_management_response.rb +10 -9
- data/lib/ingenico/connect/sdk/domain/hostedmandatemanagement/get_hosted_mandate_management_response.rb +8 -9
- data/lib/ingenico/connect/sdk/domain/hostedmandatemanagement/hosted_mandate_info.rb +20 -21
- data/lib/ingenico/connect/sdk/domain/hostedmandatemanagement/hosted_mandate_management_specific_input.rb +13 -12
- data/lib/ingenico/connect/sdk/domain/mandates/create_mandate_base.rb +23 -24
- data/lib/ingenico/connect/sdk/domain/mandates/create_mandate_response.rb +9 -12
- data/lib/ingenico/connect/sdk/domain/mandates/create_mandate_with_return_url.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/mandates/get_mandate_response.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/mandates/mandate_address.rb +16 -15
- data/lib/ingenico/connect/sdk/domain/mandates/mandate_contact_details.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/mandates/mandate_customer.rb +20 -27
- data/lib/ingenico/connect/sdk/domain/mandates/mandate_merchant_action.rb +8 -9
- data/lib/ingenico/connect/sdk/domain/mandates/mandate_personal_information.rb +8 -9
- data/lib/ingenico/connect/sdk/domain/mandates/mandate_personal_name.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/mandates/mandate_response.rb +20 -21
- data/lib/ingenico/connect/sdk/domain/metadata/shopping_cart_extension.rb +8 -8
- data/lib/ingenico/connect/sdk/domain/payment/abstract_bank_transfer_payment_method_specific_input.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/abstract_card_payment_method_specific_input.rb +44 -45
- data/lib/ingenico/connect/sdk/domain/payment/abstract_e_invoice_payment_method_specific_input.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/abstract_payment_method_specific_output.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/abstract_redirect_payment_method_specific_input.rb +16 -15
- data/lib/ingenico/connect/sdk/domain/payment/abstract_redirect_payment_product840_specific_input.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/abstract_sepa_direct_debit_payment_product771_specific_input.rb +5 -4
- data/lib/ingenico/connect/sdk/domain/payment/abstract_three_d_secure.rb +21 -24
- data/lib/ingenico/connect/sdk/domain/payment/additional_order_input.rb +20 -25
- data/lib/ingenico/connect/sdk/domain/payment/address_personal.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/payment/amount_breakdown.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/payment/approve_payment_card_payment_method_specific_output.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/approve_payment_mobile_payment_method_specific_output.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/approve_payment_payment_method_specific_input.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/payment/approve_payment_request.rb +16 -21
- data/lib/ingenico/connect/sdk/domain/payment/browser_data.rb +22 -21
- data/lib/ingenico/connect/sdk/domain/payment/cancel_approval_payment_response.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/payment/cancel_payment_card_payment_method_specific_output.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/cancel_payment_mobile_payment_method_specific_output.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/cancel_payment_response.rb +13 -18
- data/lib/ingenico/connect/sdk/domain/payment/capture_payment_request.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/payment/card_payment_method_specific_input.rb +21 -26
- data/lib/ingenico/connect/sdk/domain/payment/card_payment_method_specific_input_base.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/payment/card_payment_method_specific_output.rb +19 -24
- data/lib/ingenico/connect/sdk/domain/payment/card_recurrence_details.rb +10 -9
- data/lib/ingenico/connect/sdk/domain/payment/cash_payment_method_specific_input.rb +30 -43
- data/lib/ingenico/connect/sdk/domain/payment/cash_payment_product1503_specific_input.rb +6 -5
- data/lib/ingenico/connect/sdk/domain/payment/cash_payment_product1504_specific_input.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/cash_payment_product1521_specific_input.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/cash_payment_product1522_specific_input.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/cash_payment_product1523_specific_input.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/cash_payment_product1524_specific_input.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/cash_payment_product1526_specific_input.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/complete_payment_card_payment_method_specific_input.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/payment/complete_payment_request.rb +13 -18
- data/lib/ingenico/connect/sdk/domain/payment/contact_details.rb +13 -12
- data/lib/ingenico/connect/sdk/domain/payment/create_payment_request.rb +52 -75
- data/lib/ingenico/connect/sdk/domain/payment/create_payment_result.rb +13 -18
- data/lib/ingenico/connect/sdk/domain/payment/customer.rb +38 -49
- data/lib/ingenico/connect/sdk/domain/payment/customer_account.rb +40 -45
- data/lib/ingenico/connect/sdk/domain/payment/customer_account_authentication.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/payment/customer_approve_payment.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/customer_device.rb +26 -27
- data/lib/ingenico/connect/sdk/domain/payment/customer_payment_activity.rb +10 -9
- data/lib/ingenico/connect/sdk/domain/payment/decrypted_payment_data.rb +22 -21
- data/lib/ingenico/connect/sdk/domain/payment/device_render_options.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/payment/e_invoice_payment_method_specific_input.rb +8 -9
- data/lib/ingenico/connect/sdk/domain/payment/e_invoice_payment_method_specific_output.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/payment/e_invoice_payment_product9000_specific_input.rb +8 -9
- data/lib/ingenico/connect/sdk/domain/payment/e_invoice_payment_product9000_specific_output.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/external_cardholder_authentication_data.rb +25 -24
- data/lib/ingenico/connect/sdk/domain/payment/find_payments_response.rb +14 -15
- data/lib/ingenico/connect/sdk/domain/payment/gift_card_purchase.rb +8 -9
- data/lib/ingenico/connect/sdk/domain/payment/hosted_checkout_specific_output.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/payment/invoice_payment_method_specific_input.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/level3_summary_data.rb +14 -13
- data/lib/ingenico/connect/sdk/domain/payment/line_item.rb +18 -25
- data/lib/ingenico/connect/sdk/domain/payment/line_item_invoice_data.rb +16 -15
- data/lib/ingenico/connect/sdk/domain/payment/line_item_level3_interchange_information.rb +25 -24
- data/lib/ingenico/connect/sdk/domain/payment/merchant.rb +11 -12
- data/lib/ingenico/connect/sdk/domain/payment/merchant_action.rb +27 -36
- data/lib/ingenico/connect/sdk/domain/payment/mobile_payment_data.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/payment/mobile_payment_method_specific_input.rb +17 -18
- data/lib/ingenico/connect/sdk/domain/payment/mobile_payment_method_specific_output.rb +19 -24
- data/lib/ingenico/connect/sdk/domain/payment/mobile_three_d_secure_challenge_parameters.rb +13 -12
- data/lib/ingenico/connect/sdk/domain/payment/non_sepa_direct_debit_payment_method_specific_input.rb +27 -30
- data/lib/ingenico/connect/sdk/domain/payment/non_sepa_direct_debit_payment_method_specific_output.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/payment/non_sepa_direct_debit_payment_product705_specific_input.rb +11 -12
- data/lib/ingenico/connect/sdk/domain/payment/non_sepa_direct_debit_payment_product730_specific_input.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/payment/order.rb +35 -50
- data/lib/ingenico/connect/sdk/domain/payment/order_approve_payment.rb +13 -18
- data/lib/ingenico/connect/sdk/domain/payment/order_invoice_data.rb +14 -15
- data/lib/ingenico/connect/sdk/domain/payment/order_line_details.rb +34 -33
- data/lib/ingenico/connect/sdk/domain/payment/order_output.rb +9 -12
- data/lib/ingenico/connect/sdk/domain/payment/order_references.rb +14 -15
- data/lib/ingenico/connect/sdk/domain/payment/order_references_approve_payment.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/order_type_information.rb +10 -9
- data/lib/ingenico/connect/sdk/domain/payment/payment.rb +16 -21
- data/lib/ingenico/connect/sdk/domain/payment/payment_account_on_file.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/payment/payment_approval_response.rb +18 -25
- data/lib/ingenico/connect/sdk/domain/payment/payment_creation_output.rb +10 -9
- data/lib/ingenico/connect/sdk/domain/payment/payment_creation_references.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/payment/payment_error_response.rb +12 -15
- data/lib/ingenico/connect/sdk/domain/payment/payment_output.rb +43 -60
- data/lib/ingenico/connect/sdk/domain/payment/payment_product3201_specific_output.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/payment/payment_product771_specific_output.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/payment_product836_specific_output.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/payment_product840_customer_account.rb +31 -30
- data/lib/ingenico/connect/sdk/domain/payment/payment_product840_specific_output.rb +13 -18
- data/lib/ingenico/connect/sdk/domain/payment/payment_product863_third_party_data.rb +22 -21
- data/lib/ingenico/connect/sdk/domain/payment/payment_references.rb +19 -18
- data/lib/ingenico/connect/sdk/domain/payment/payment_status_output.rb +10 -9
- data/lib/ingenico/connect/sdk/domain/payment/personal_information.rb +11 -12
- data/lib/ingenico/connect/sdk/domain/payment/personal_name.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/protection_eligibility.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_method_specific_input.rb +36 -49
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_method_specific_input_base.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_method_specific_output.rb +24 -33
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_product809_specific_input.rb +8 -7
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_product816_specific_input.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_product840_specific_input.rb +8 -7
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_product861_specific_input.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_product863_specific_input.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_product882_specific_input.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/redirection_data.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/payment/refund_e_wallet_method_specific_output.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/payment/refund_method_specific_output.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/payment/refund_mobile_method_specific_output.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/refund_output.rb +27 -36
- data/lib/ingenico/connect/sdk/domain/payment/refund_payment_product840_customer_account.rb +10 -9
- data/lib/ingenico/connect/sdk/domain/payment/refund_payment_product840_specific_output.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/payment/sdk_data_input.rb +26 -27
- data/lib/ingenico/connect/sdk/domain/payment/sdk_data_output.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/seller.rb +29 -30
- data/lib/ingenico/connect/sdk/domain/payment/sepa_direct_debit_payment_method_specific_input.rb +23 -24
- data/lib/ingenico/connect/sdk/domain/payment/sepa_direct_debit_payment_method_specific_input_base.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/payment/sepa_direct_debit_payment_method_specific_output.rb +9 -12
- data/lib/ingenico/connect/sdk/domain/payment/sepa_direct_debit_payment_product771_specific_input.rb +8 -9
- data/lib/ingenico/connect/sdk/domain/payment/sepa_direct_debit_payment_product771_specific_input_base.rb +8 -9
- data/lib/ingenico/connect/sdk/domain/payment/shipping.rb +26 -27
- data/lib/ingenico/connect/sdk/domain/payment/shopping_cart.rb +22 -27
- data/lib/ingenico/connect/sdk/domain/payment/third_party_data.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/payment/third_party_status_response.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payment/three_d_secure.rb +9 -12
- data/lib/ingenico/connect/sdk/domain/payment/three_d_secure_data.rb +10 -9
- data/lib/ingenico/connect/sdk/domain/payment/three_d_secure_results.rb +27 -30
- data/lib/ingenico/connect/sdk/domain/payment/tokenize_payment_request.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payout/approve_payout_request.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/payout/bank_transfer_payout_method_specific_input.rb +22 -27
- data/lib/ingenico/connect/sdk/domain/payout/card_payout_method_specific_input.rb +11 -12
- data/lib/ingenico/connect/sdk/domain/payout/create_payout_request.rb +44 -57
- data/lib/ingenico/connect/sdk/domain/payout/find_payouts_response.rb +14 -15
- data/lib/ingenico/connect/sdk/domain/payout/payout_customer.rb +20 -27
- data/lib/ingenico/connect/sdk/domain/payout/payout_error_response.rb +12 -15
- data/lib/ingenico/connect/sdk/domain/payout/payout_references.rb +10 -9
- data/lib/ingenico/connect/sdk/domain/payout/payout_result.rb +12 -15
- data/lib/ingenico/connect/sdk/domain/product/abstract_indicator.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/product/account_on_file.rb +15 -18
- data/lib/ingenico/connect/sdk/domain/product/account_on_file_attribute.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/product/account_on_file_display_hints.rb +8 -9
- data/lib/ingenico/connect/sdk/domain/product/boleto_bancario_requiredness_validator.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/product/device_fingerprint_request.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/product/device_fingerprint_response.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/product/directory.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/product/directory_entry.rb +14 -15
- data/lib/ingenico/connect/sdk/domain/product/fixed_list_validator.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/product/get_customer_details_request.rb +8 -9
- data/lib/ingenico/connect/sdk/domain/product/get_customer_details_response.rb +31 -30
- data/lib/ingenico/connect/sdk/domain/product/label_template_element.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/product/length_validator.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/product/payment_product.rb +71 -84
- data/lib/ingenico/connect/sdk/domain/product/payment_product302_specific_data.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/product/payment_product320_specific_data.rb +8 -9
- data/lib/ingenico/connect/sdk/domain/product/payment_product863_specific_data.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/product/payment_product_display_hints.rb +10 -9
- data/lib/ingenico/connect/sdk/domain/product/payment_product_field.rb +18 -21
- data/lib/ingenico/connect/sdk/domain/product/payment_product_field_data_restrictions.rb +8 -9
- data/lib/ingenico/connect/sdk/domain/product/payment_product_field_display_element.rb +13 -12
- data/lib/ingenico/connect/sdk/domain/product/payment_product_field_display_hints.rb +33 -36
- data/lib/ingenico/connect/sdk/domain/product/payment_product_field_form_element.rb +8 -9
- data/lib/ingenico/connect/sdk/domain/product/payment_product_field_tooltip.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/product/payment_product_field_validators.rb +41 -60
- data/lib/ingenico/connect/sdk/domain/product/payment_product_group.rb +19 -24
- data/lib/ingenico/connect/sdk/domain/product/payment_product_groups.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/product/payment_product_networks_response.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/product/payment_products.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/product/range_validator.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/product/regular_expression_validator.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/product/value_mapping_element.rb +12 -13
- data/lib/ingenico/connect/sdk/domain/refund/approve_refund_request.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/refund/bank_account_bban_refund.rb +10 -9
- data/lib/ingenico/connect/sdk/domain/refund/bank_refund_method_specific_input.rb +12 -15
- data/lib/ingenico/connect/sdk/domain/refund/find_refunds_response.rb +14 -15
- data/lib/ingenico/connect/sdk/domain/refund/refund_customer.rb +16 -21
- data/lib/ingenico/connect/sdk/domain/refund/refund_error_response.rb +12 -15
- data/lib/ingenico/connect/sdk/domain/refund/refund_references.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/refund/refund_request.rb +20 -27
- data/lib/ingenico/connect/sdk/domain/refund/refund_result.rb +12 -15
- data/lib/ingenico/connect/sdk/domain/refund/refunds_response.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/riskassessments/contact_details_risk_assessment.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/riskassessments/customer_account_risk_assessment.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/riskassessments/customer_device_risk_assessment.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/riskassessments/customer_risk_assessment.rb +35 -46
- data/lib/ingenico/connect/sdk/domain/riskassessments/merchant_risk_assessment.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/riskassessments/order_risk_assessment.rb +17 -24
- data/lib/ingenico/connect/sdk/domain/riskassessments/personal_information_risk_assessment.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/riskassessments/risk_assessment.rb +16 -21
- data/lib/ingenico/connect/sdk/domain/riskassessments/risk_assessment_bank_account.rb +9 -12
- data/lib/ingenico/connect/sdk/domain/riskassessments/risk_assessment_card.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/riskassessments/risk_assessment_response.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/riskassessments/shipping_risk_assessment.rb +11 -12
- data/lib/ingenico/connect/sdk/domain/services/bank_data.rb +13 -12
- data/lib/ingenico/connect/sdk/domain/services/bank_details.rb +9 -12
- data/lib/ingenico/connect/sdk/domain/services/bank_details_response.rb +17 -24
- data/lib/ingenico/connect/sdk/domain/services/convert_amount.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/services/get_iin_details_request.rb +8 -9
- data/lib/ingenico/connect/sdk/domain/services/get_iin_details_response.rb +14 -15
- data/lib/ingenico/connect/sdk/domain/services/get_privacy_policy_response.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/services/iin_detail.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/services/payment_context.rb +11 -12
- data/lib/ingenico/connect/sdk/domain/services/swift.rb +31 -30
- data/lib/ingenico/connect/sdk/domain/services/test_connection.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/sessions/payment_product_filters_client_session.rb +9 -12
- data/lib/ingenico/connect/sdk/domain/sessions/session_request.rb +9 -12
- data/lib/ingenico/connect/sdk/domain/sessions/session_response.rb +20 -21
- data/lib/ingenico/connect/sdk/domain/token/abstract_token.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/token/create_token_request.rb +20 -27
- data/lib/ingenico/connect/sdk/domain/token/create_token_response.rb +7 -6
- data/lib/ingenico/connect/sdk/domain/token/creditor.rb +34 -33
- data/lib/ingenico/connect/sdk/domain/token/customer_token.rb +9 -12
- data/lib/ingenico/connect/sdk/domain/token/customer_token_with_contact_details.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/token/debtor.rb +34 -33
- data/lib/ingenico/connect/sdk/domain/token/mandate_approval.rb +10 -9
- data/lib/ingenico/connect/sdk/domain/token/mandate_non_sepa_direct_debit.rb +9 -12
- data/lib/ingenico/connect/sdk/domain/token/mandate_sepa_direct_debit.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/token/mandate_sepa_direct_debit_with_mandate_id.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/token/mandate_sepa_direct_debit_without_creditor.rb +22 -27
- data/lib/ingenico/connect/sdk/domain/token/personal_information_token.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/token/token_card.rb +9 -12
- data/lib/ingenico/connect/sdk/domain/token/token_card_data.rb +11 -12
- data/lib/ingenico/connect/sdk/domain/token/token_e_wallet.rb +9 -12
- data/lib/ingenico/connect/sdk/domain/token/token_e_wallet_data.rb +4 -3
- data/lib/ingenico/connect/sdk/domain/token/token_non_sepa_direct_debit.rb +9 -12
- data/lib/ingenico/connect/sdk/domain/token/token_non_sepa_direct_debit_payment_product705_specific_data.rb +8 -9
- data/lib/ingenico/connect/sdk/domain/token/token_non_sepa_direct_debit_payment_product730_specific_data.rb +5 -6
- data/lib/ingenico/connect/sdk/domain/token/token_response.rb +23 -30
- data/lib/ingenico/connect/sdk/domain/token/token_sepa_direct_debit.rb +9 -12
- data/lib/ingenico/connect/sdk/domain/token/token_sepa_direct_debit_without_creditor.rb +9 -12
- data/lib/ingenico/connect/sdk/domain/token/update_token_request.rb +20 -27
- data/lib/ingenico/connect/sdk/endpoint_configuration.rb +12 -20
- data/lib/ingenico/connect/sdk/factory.rb +34 -32
- data/lib/ingenico/connect/sdk/idempotence_exception.rb +3 -3
- data/lib/ingenico/connect/sdk/logging/communicator_logger.rb +5 -2
- data/lib/ingenico/connect/sdk/logging/log_message_builder.rb +25 -13
- data/lib/ingenico/connect/sdk/logging/logging_util.rb +14 -14
- data/lib/ingenico/connect/sdk/logging/request_log_message_builder.rb +4 -5
- data/lib/ingenico/connect/sdk/logging/response_log_message_builder.rb +7 -6
- data/lib/ingenico/connect/sdk/logging/ruby_communicator_logger.rb +5 -4
- data/lib/ingenico/connect/sdk/logging/stdout_communicator_logger.rb +2 -1
- data/lib/ingenico/connect/sdk/marshaller.rb +8 -3
- data/lib/ingenico/connect/sdk/merchant/captures/captures_client.rb +17 -17
- data/lib/ingenico/connect/sdk/merchant/disputes/disputes_client.rb +80 -47
- data/lib/ingenico/connect/sdk/merchant/disputes/upload_file_request.rb +27 -0
- data/lib/ingenico/connect/sdk/merchant/files/files_client.rb +55 -0
- data/lib/ingenico/connect/sdk/merchant/hostedcheckouts/hostedcheckouts_client.rb +31 -31
- data/lib/ingenico/connect/sdk/merchant/hostedmandatemanagements/hostedmandatemanagements_client.rb +31 -31
- data/lib/ingenico/connect/sdk/merchant/mandates/mandates_client.rb +92 -92
- data/lib/ingenico/connect/sdk/merchant/merchant_client.rb +37 -30
- data/lib/ingenico/connect/sdk/merchant/payments/find_payments_params.rb +12 -11
- data/lib/ingenico/connect/sdk/merchant/payments/payments_client.rb +248 -248
- data/lib/ingenico/connect/sdk/merchant/payouts/find_payouts_params.rb +10 -9
- data/lib/ingenico/connect/sdk/merchant/payouts/payouts_client.rb +90 -90
- data/lib/ingenico/connect/sdk/merchant/productgroups/find_productgroups_params.rb +17 -13
- data/lib/ingenico/connect/sdk/merchant/productgroups/get_productgroup_params.rb +17 -13
- data/lib/ingenico/connect/sdk/merchant/productgroups/productgroups_client.rb +48 -48
- data/lib/ingenico/connect/sdk/merchant/products/directory_params.rb +6 -5
- data/lib/ingenico/connect/sdk/merchant/products/find_products_params.rb +17 -13
- data/lib/ingenico/connect/sdk/merchant/products/get_product_params.rb +19 -15
- data/lib/ingenico/connect/sdk/merchant/products/networks_params.rb +10 -9
- data/lib/ingenico/connect/sdk/merchant/products/products_client.rb +96 -127
- data/lib/ingenico/connect/sdk/merchant/refunds/find_refunds_params.rb +12 -11
- data/lib/ingenico/connect/sdk/merchant/refunds/refunds_client.rb +74 -74
- data/lib/ingenico/connect/sdk/merchant/riskassessments/riskassessments_client.rb +30 -30
- data/lib/ingenico/connect/sdk/merchant/services/convert_amount_params.rb +8 -7
- data/lib/ingenico/connect/sdk/merchant/services/privacypolicy_params.rb +6 -5
- data/lib/ingenico/connect/sdk/merchant/services/services_client.rb +71 -71
- data/lib/ingenico/connect/sdk/merchant/sessions/sessions_client.rb +16 -16
- data/lib/ingenico/connect/sdk/merchant/tokens/delete_token_params.rb +4 -3
- data/lib/ingenico/connect/sdk/merchant/tokens/tokens_client.rb +76 -76
- data/lib/ingenico/connect/sdk/meta_data_provider.rb +19 -20
- data/lib/ingenico/connect/sdk/modules.rb +5 -4
- data/lib/ingenico/connect/sdk/multipart_form_data_object.rb +44 -0
- data/lib/ingenico/connect/sdk/multipart_form_data_request.rb +9 -0
- data/lib/ingenico/connect/sdk/not_found_exception.rb +4 -7
- data/lib/ingenico/connect/sdk/param_request.rb +3 -25
- data/lib/ingenico/connect/sdk/proxy_configuration.rb +16 -17
- data/lib/ingenico/connect/sdk/request_header.rb +22 -3
- data/lib/ingenico/connect/sdk/request_param.rb +3 -2
- data/lib/ingenico/connect/sdk/response_exception.rb +24 -27
- data/lib/ingenico/connect/sdk/response_header.rb +49 -2
- data/lib/ingenico/connect/sdk/session.rb +11 -10
- data/lib/ingenico/connect/sdk/uploadable_file.rb +30 -0
- data/lib/ingenico/connect/sdk/webhooks/api_version_mismatch_exception.rb +3 -3
- data/lib/ingenico/connect/sdk/webhooks/in_memory_secret_key_store.rb +5 -5
- data/lib/ingenico/connect/sdk/webhooks/secret_key_not_available_exception.rb +2 -0
- data/lib/ingenico/connect/sdk/webhooks/secret_key_store.rb +2 -2
- data/lib/ingenico/connect/sdk/webhooks/signature_validation_exception.rb +1 -1
- data/lib/ingenico/connect/sdk/webhooks/webhooks_event.rb +19 -25
- data/lib/ingenico/connect/sdk/webhooks/webhooks_helper.rb +11 -10
- data/spec/integration/multipart_form_data_spec.rb +214 -0
- data/spec/lib/defaultimpl/default_connection_idempotence_spec.rb +7 -7
- data/spec/lib/defaultimpl/default_connection_logger_spec.rb +0 -4
- data/spec/lib/defaultimpl/default_connection_spec.rb +48 -25
- data/spec/lib/logging/header_obfuscator_spec.rb +1 -1
- data/spec/lib/logging/logging_util_spec.rb +7 -7
- data/spec/lib/logging/obfuscator_spec.rb +4 -4
- data/spec/lib/logging/ruby_communicator_logger_spec.rb +8 -8
- data/spec/lib/logging/stdout_communicator_logger_spec.rb +1 -1
- data/spec/lib/logging/value_obfuscator_spec.rb +1 -1
- data/spec/lib/payments_client_spec.rb +8 -9
- metadata +12 -7
- data/lib/ingenico/connect/sdk/domain/publickey/public_key.rb +0 -38
- data/lib/ingenico/connect/sdk/response.rb +0 -59
- data/spec/lib/requestparams/param_request_spec.rb +0 -57
@@ -16,12 +16,12 @@ module Ingenico::Connect::SDK
|
|
16
16
|
end
|
17
17
|
|
18
18
|
# Creates a new ValueObfuscator.
|
19
|
-
#
|
20
|
-
#
|
21
|
-
# keep_start_count
|
22
|
-
#
|
23
|
-
# keep_end_count
|
24
|
-
#
|
19
|
+
#
|
20
|
+
# @param fixed_length [Integer] if greater than 0, all values that will be obfuscated will be replaced with that number of asterisks.
|
21
|
+
# @param keep_start_count [Integer] the number of characters to not obfuscate at the end of any value.
|
22
|
+
# This parameter is only used if _fixed_length_ = 0.
|
23
|
+
# @param keep_end_count [Integer] the number of characters to not obfuscate at the start of any value.
|
24
|
+
# This parameter is only used if _fixed_length_ = 0.
|
25
25
|
def initialize(fixed_length, keep_start_count, keep_end_count)
|
26
26
|
@mask_character = '*'
|
27
27
|
@fixed_length = fixed_length
|
@@ -171,9 +171,9 @@ module Ingenico::Connect::SDK
|
|
171
171
|
super(name)
|
172
172
|
end
|
173
173
|
|
174
|
-
def with_fixed_length(name,
|
174
|
+
def with_fixed_length(name, fixed_length)
|
175
175
|
raise ArgumentError unless name.is_a? String
|
176
|
-
super(name,
|
176
|
+
super(name, fixed_length)
|
177
177
|
end
|
178
178
|
|
179
179
|
def build
|
@@ -187,7 +187,7 @@ module Ingenico::Connect::SDK
|
|
187
187
|
def initialize(obfuscators)
|
188
188
|
# case sensitive
|
189
189
|
super(obfuscators, false)
|
190
|
-
@
|
190
|
+
@property_pattern = build_property_pattern(obfuscators.keys)
|
191
191
|
end
|
192
192
|
|
193
193
|
private
|
@@ -216,12 +216,12 @@ module Ingenico::Connect::SDK
|
|
216
216
|
return nil if body.nil?
|
217
217
|
return '' if body.empty?
|
218
218
|
|
219
|
-
body.gsub(@
|
219
|
+
body.gsub(@property_pattern) do
|
220
220
|
m = Regexp.last_match
|
221
|
-
|
221
|
+
property_name = m[2]
|
222
222
|
value = m[4] || m[5]
|
223
223
|
# copy value 'cause it's part of m[0]
|
224
|
-
m[0].sub(value, obfuscate_value(
|
224
|
+
m[0].sub(value, obfuscate_value(property_name, value.dup))
|
225
225
|
end
|
226
226
|
end
|
227
227
|
|
@@ -239,9 +239,9 @@ module Ingenico::Connect::SDK
|
|
239
239
|
super(property)
|
240
240
|
end
|
241
241
|
|
242
|
-
def with_fixed_length(property,
|
242
|
+
def with_fixed_length(property, fixed_length)
|
243
243
|
raise ArgumentError unless property.is_a? String
|
244
|
-
super(property,
|
244
|
+
super(property, fixed_length)
|
245
245
|
end
|
246
246
|
|
247
247
|
def with_keep_start_count(key, count)
|
@@ -12,17 +12,17 @@ module Ingenico::Connect::SDK
|
|
12
12
|
|
13
13
|
# Constructs and returns a log message based on the request data. The log message is a string.
|
14
14
|
def get_message
|
15
|
-
|
15
|
+
msg_template_without_body = "Outgoing request (requestId='%s'):\n" +
|
16
16
|
" method: '%s'\n" +
|
17
17
|
" uri: '%s'\n" +
|
18
18
|
" headers: '%s'"
|
19
|
-
|
19
|
+
msg_template_with_body = msg_template_without_body + "\n" +
|
20
20
|
" content-type: '%s'\n" +
|
21
21
|
" body: '%s'"
|
22
22
|
|
23
|
-
return sprintf(
|
23
|
+
return sprintf(msg_template_without_body, @request_id, empty_if_null(@method),
|
24
24
|
format_uri, @headers) if @body.nil?
|
25
|
-
sprintf(
|
25
|
+
sprintf(msg_template_with_body, @request_id, empty_if_null(@method),
|
26
26
|
format_uri, @headers, empty_if_null(@content_type), @body)
|
27
27
|
end
|
28
28
|
|
@@ -37,7 +37,6 @@ module Ingenico::Connect::SDK
|
|
37
37
|
end
|
38
38
|
# @uri.path + '?' + empty_if_null(@uri.query)
|
39
39
|
end
|
40
|
-
|
41
40
|
end
|
42
41
|
end
|
43
42
|
end
|
@@ -5,9 +5,10 @@ module Ingenico::Connect::SDK
|
|
5
5
|
|
6
6
|
# Class that converts data about a response into a properly formatted log message.
|
7
7
|
# Formats request id, status code, headers, body and time between request and response into a helpful message.
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
8
|
+
#
|
9
|
+
# @param request_id [String] identifier of the request corresponding to this response.
|
10
|
+
# @param status_code [Integer] HTTP status code of the response.
|
11
|
+
# @param duration [Float] time elapsed between request and response.
|
11
12
|
def initialize(request_id, status_code, duration=-1)
|
12
13
|
super(request_id)
|
13
14
|
@status_code = status_code
|
@@ -16,7 +17,7 @@ module Ingenico::Connect::SDK
|
|
16
17
|
|
17
18
|
# Constructs and returns a log message based on the request data. The log message is a string.
|
18
19
|
def get_message
|
19
|
-
|
20
|
+
msg_template = "Incoming response (requestId='%s'" +
|
20
21
|
((@duration < 0) ? "" : ", %.3f ms") +
|
21
22
|
"):\n" +
|
22
23
|
" status-code: '%s'\n" +
|
@@ -24,9 +25,9 @@ module Ingenico::Connect::SDK
|
|
24
25
|
" content-type: '%s'\n" +
|
25
26
|
" body: '%s'"
|
26
27
|
|
27
|
-
return sprintf(
|
28
|
+
return sprintf(msg_template, @request_id, @status_code, @headers,
|
28
29
|
empty_if_null(@content_type), empty_if_null(@body)) if @duration < 0
|
29
|
-
sprintf(
|
30
|
+
sprintf(msg_template, @request_id, @duration, @status_code, @headers,
|
30
31
|
empty_if_null(@content_type), empty_if_null(@body))
|
31
32
|
end
|
32
33
|
end
|
@@ -8,9 +8,10 @@ module Ingenico::Connect::SDK
|
|
8
8
|
class RubyCommunicatorLogger < CommunicatorLogger
|
9
9
|
|
10
10
|
# Creates a new RubyCommunicatorLogger instance.
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
11
|
+
#
|
12
|
+
# @param logger [Logger] the logger to log messages to. Messages to log will be provided using logger#log(message level, message)
|
13
|
+
# @param log_level [String] log level to use for non-error messages.
|
14
|
+
# @param error_level [String] error logging level to use.
|
14
15
|
def initialize(logger, log_level, error_level=false)
|
15
16
|
# implement the interface
|
16
17
|
error_level ||= log_level
|
@@ -27,7 +28,7 @@ module Ingenico::Connect::SDK
|
|
27
28
|
def log(msg, thrown=false)
|
28
29
|
# use Ruby Logger
|
29
30
|
if thrown
|
30
|
-
@logger.log(@errorLevel) { msg + $RS + thrown.backtrace.join($RS) }
|
31
|
+
@logger.log(@errorLevel) { msg + $RS + thrown.to_s + $RS + thrown.backtrace.join($RS) }
|
31
32
|
else
|
32
33
|
@logger.log(@logLevel, msg)
|
33
34
|
end
|
@@ -19,7 +19,8 @@ module Ingenico::Connect::SDK
|
|
19
19
|
|
20
20
|
# Logs a single error or non-error message to $stdout.
|
21
21
|
def log(msg, thrown=false)
|
22
|
-
$stdout.puts
|
22
|
+
$stdout.puts get_date_prefix + msg
|
23
|
+
$stdout.puts thrown.to_s if thrown
|
23
24
|
$stdout.puts thrown.backtrace.join($RS) if thrown
|
24
25
|
end
|
25
26
|
|
@@ -3,15 +3,20 @@ module Ingenico::Connect::SDK
|
|
3
3
|
# Class responsible for marshalling and unmarshalling objects to and from JSON
|
4
4
|
class Marshaller
|
5
5
|
|
6
|
-
# Marshals _request_object_ to JSON format by calling #
|
6
|
+
# Marshals _request_object_ to JSON format by calling #to_h on it.
|
7
|
+
#
|
8
|
+
# @param request_object [Ingenico::Connect::SDK::DataObject] the object to format
|
9
|
+
# @return [String] _request_object_ converted to JSON
|
7
10
|
def marshal(request_object)
|
8
11
|
raise NotImplementedError
|
9
12
|
end
|
10
13
|
|
11
14
|
# Unmarshals a JSON string into an object of type _type_.
|
12
15
|
# The new object is initialized by calling .new_from_hash with contents of the JSON as a Hash object.
|
13
|
-
#
|
14
|
-
#
|
16
|
+
#
|
17
|
+
# @param response_json [String] The JSON to unmarshal
|
18
|
+
# @param type [Type] The class of the object that will be instantiated using _type.new_from_hash_
|
19
|
+
# @return The JSON unmarshalled to the given type
|
15
20
|
def unmarshal(response_json, type)
|
16
21
|
raise NotImplementedError
|
17
22
|
end
|
@@ -14,30 +14,30 @@ module Ingenico::Connect::SDK
|
|
14
14
|
# Captures client. Thread-safe.
|
15
15
|
class CapturesClient < Ingenico::Connect::SDK::ApiResource
|
16
16
|
|
17
|
-
# parent
|
18
|
-
# path_context
|
17
|
+
# @param parent [Ingenico::Connect::SDK::ApiResource]
|
18
|
+
# @param path_context [Hash]
|
19
19
|
def initialize(parent, path_context)
|
20
20
|
super(parent, path_context)
|
21
21
|
end
|
22
22
|
|
23
|
-
# Resource
|
24
|
-
# capture_id
|
25
|
-
# context
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
29
|
-
#
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
23
|
+
# Resource /!{merchantId}/captures/!{captureId} - {https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/ruby/captures/get.html Get capture}
|
24
|
+
# @param capture_id [String]
|
25
|
+
# @param context [Ingenico::Connect::SDK::CallContext]
|
26
|
+
# @return [Ingenico::Connect::SDK::Domain::Capture::CaptureResponse]
|
27
|
+
# @raise [Ingenico::Connect::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
|
28
|
+
# @raise [Ingenico::Connect::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
|
29
|
+
# @raise [Ingenico::Connect::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
|
30
|
+
# @raise [Ingenico::Connect::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
|
31
|
+
# or there was a conflict (HTTP status code 404, 409 or 410)
|
32
|
+
# @raise [Ingenico::Connect::SDK::GlobalCollectException] if something went wrong at the Ingenico ePayments platform,
|
33
|
+
# the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
|
34
|
+
# or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
|
35
|
+
# @raise [Ingenico::Connect::SDK::ApiException]if the Ingenico ePayments platform returned any other error
|
36
36
|
def get(capture_id, context=nil)
|
37
37
|
path_context = {
|
38
|
-
'captureId' => capture_id,
|
38
|
+
'captureId'.freeze => capture_id,
|
39
39
|
}
|
40
|
-
uri = instantiate_uri('/
|
40
|
+
uri = instantiate_uri('/v1/{merchantId}/captures/{captureId}', path_context)
|
41
41
|
return @communicator.get(
|
42
42
|
uri,
|
43
43
|
client_headers,
|
@@ -5,6 +5,7 @@
|
|
5
5
|
require 'ingenico/connect/sdk/api_resource'
|
6
6
|
require 'ingenico/connect/sdk/response_exception'
|
7
7
|
require 'ingenico/connect/sdk/domain/dispute/dispute_response'
|
8
|
+
require 'ingenico/connect/sdk/domain/dispute/upload_dispute_file_response'
|
8
9
|
require 'ingenico/connect/sdk/domain/errors/error_response'
|
9
10
|
|
10
11
|
module Ingenico::Connect::SDK
|
@@ -14,30 +15,30 @@ module Ingenico::Connect::SDK
|
|
14
15
|
# Disputes client. Thread-safe.
|
15
16
|
class DisputesClient < Ingenico::Connect::SDK::ApiResource
|
16
17
|
|
17
|
-
# parent
|
18
|
-
# path_context
|
18
|
+
# @param parent [Ingenico::Connect::SDK::ApiResource]
|
19
|
+
# @param path_context [Hash]
|
19
20
|
def initialize(parent, path_context)
|
20
21
|
super(parent, path_context)
|
21
22
|
end
|
22
23
|
|
23
|
-
# Resource
|
24
|
-
# dispute_id
|
25
|
-
# context
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
29
|
-
#
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
24
|
+
# Resource /!{merchantId}/disputes/!{disputeId} - {https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/ruby/disputes/get.html Get dispute}
|
25
|
+
# @param dispute_id [String]
|
26
|
+
# @param context [Ingenico::Connect::SDK::CallContext]
|
27
|
+
# @return [Ingenico::Connect::SDK::Domain::Dispute::DisputeResponse]
|
28
|
+
# @raise [Ingenico::Connect::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
|
29
|
+
# @raise [Ingenico::Connect::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
|
30
|
+
# @raise [Ingenico::Connect::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
|
31
|
+
# @raise [Ingenico::Connect::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
|
32
|
+
# or there was a conflict (HTTP status code 404, 409 or 410)
|
33
|
+
# @raise [Ingenico::Connect::SDK::GlobalCollectException] if something went wrong at the Ingenico ePayments platform,
|
34
|
+
# the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
|
35
|
+
# or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
|
36
|
+
# @raise [Ingenico::Connect::SDK::ApiException]if the Ingenico ePayments platform returned any other error
|
36
37
|
def get(dispute_id, context=nil)
|
37
38
|
path_context = {
|
38
|
-
'disputeId' => dispute_id,
|
39
|
+
'disputeId'.freeze => dispute_id,
|
39
40
|
}
|
40
|
-
uri = instantiate_uri('/
|
41
|
+
uri = instantiate_uri('/v1/{merchantId}/disputes/{disputeId}', path_context)
|
41
42
|
return @communicator.get(
|
42
43
|
uri,
|
43
44
|
client_headers,
|
@@ -50,24 +51,24 @@ module Ingenico::Connect::SDK
|
|
50
51
|
raise create_exception(e.status_code, e.body, error_object, context)
|
51
52
|
end
|
52
53
|
|
53
|
-
# Resource
|
54
|
-
# dispute_id
|
55
|
-
# context
|
56
|
-
#
|
57
|
-
#
|
58
|
-
#
|
59
|
-
#
|
60
|
-
#
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
#
|
54
|
+
# Resource /!{merchantId}/disputes/!{disputeId}/submit - {https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/ruby/disputes/submit.html Submit dispute}
|
55
|
+
# @param dispute_id [String]
|
56
|
+
# @param context [Ingenico::Connect::SDK::CallContext]
|
57
|
+
# @return [Ingenico::Connect::SDK::Domain::Dispute::DisputeResponse]
|
58
|
+
# @raise [Ingenico::Connect::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
|
59
|
+
# @raise [Ingenico::Connect::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
|
60
|
+
# @raise [Ingenico::Connect::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
|
61
|
+
# @raise [Ingenico::Connect::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
|
62
|
+
# or there was a conflict (HTTP status code 404, 409 or 410)
|
63
|
+
# @raise [Ingenico::Connect::SDK::GlobalCollectException] if something went wrong at the Ingenico ePayments platform,
|
64
|
+
# the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
|
65
|
+
# or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
|
66
|
+
# @raise [Ingenico::Connect::SDK::ApiException]if the Ingenico ePayments platform returned any other error
|
66
67
|
def submit(dispute_id, context=nil)
|
67
68
|
path_context = {
|
68
|
-
'disputeId' => dispute_id,
|
69
|
+
'disputeId'.freeze => dispute_id,
|
69
70
|
}
|
70
|
-
uri = instantiate_uri('/
|
71
|
+
uri = instantiate_uri('/v1/{merchantId}/disputes/{disputeId}/submit', path_context)
|
71
72
|
return @communicator.post(
|
72
73
|
uri,
|
73
74
|
client_headers,
|
@@ -81,24 +82,24 @@ module Ingenico::Connect::SDK
|
|
81
82
|
raise create_exception(e.status_code, e.body, error_object, context)
|
82
83
|
end
|
83
84
|
|
84
|
-
# Resource
|
85
|
-
# dispute_id
|
86
|
-
# context
|
87
|
-
#
|
88
|
-
#
|
89
|
-
#
|
90
|
-
#
|
91
|
-
#
|
92
|
-
#
|
93
|
-
#
|
94
|
-
#
|
95
|
-
#
|
96
|
-
#
|
85
|
+
# Resource /!{merchantId}/disputes/!{disputeId}/cancel - {https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/ruby/disputes/cancel.html Cancel dispute}
|
86
|
+
# @param dispute_id [String]
|
87
|
+
# @param context [Ingenico::Connect::SDK::CallContext]
|
88
|
+
# @return [Ingenico::Connect::SDK::Domain::Dispute::DisputeResponse]
|
89
|
+
# @raise [Ingenico::Connect::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
|
90
|
+
# @raise [Ingenico::Connect::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
|
91
|
+
# @raise [Ingenico::Connect::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
|
92
|
+
# @raise [Ingenico::Connect::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
|
93
|
+
# or there was a conflict (HTTP status code 404, 409 or 410)
|
94
|
+
# @raise [Ingenico::Connect::SDK::GlobalCollectException] if something went wrong at the Ingenico ePayments platform,
|
95
|
+
# the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
|
96
|
+
# or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
|
97
|
+
# @raise [Ingenico::Connect::SDK::ApiException]if the Ingenico ePayments platform returned any other error
|
97
98
|
def cancel(dispute_id, context=nil)
|
98
99
|
path_context = {
|
99
|
-
'disputeId' => dispute_id,
|
100
|
+
'disputeId'.freeze => dispute_id,
|
100
101
|
}
|
101
|
-
uri = instantiate_uri('/
|
102
|
+
uri = instantiate_uri('/v1/{merchantId}/disputes/{disputeId}/cancel', path_context)
|
102
103
|
return @communicator.post(
|
103
104
|
uri,
|
104
105
|
client_headers,
|
@@ -111,6 +112,38 @@ module Ingenico::Connect::SDK
|
|
111
112
|
error_object = @communicator.marshaller.unmarshal(e.body, error_type)
|
112
113
|
raise create_exception(e.status_code, e.body, error_object, context)
|
113
114
|
end
|
115
|
+
|
116
|
+
# Resource /!{merchantId}/disputes/!{disputeId} - {https://epayments-api.developer-ingenico.com/fileserviceapi/v1/en_US/ruby/disputes/uploadFile.html Upload File}
|
117
|
+
# @param dispute_id [String]
|
118
|
+
# @param body [Ingenico::Connect::SDK::Merchant::Disputes::UploadFileRequest]
|
119
|
+
# @param context [Ingenico::Connect::SDK::CallContext]
|
120
|
+
# @return [Ingenico::Connect::SDK::Domain::Dispute::UploadDisputeFileResponse]
|
121
|
+
# @raise [Ingenico::Connect::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
|
122
|
+
# @raise [Ingenico::Connect::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
|
123
|
+
# @raise [Ingenico::Connect::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
|
124
|
+
# @raise [Ingenico::Connect::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
|
125
|
+
# or there was a conflict (HTTP status code 404, 409 or 410)
|
126
|
+
# @raise [Ingenico::Connect::SDK::GlobalCollectException] if something went wrong at the Ingenico ePayments platform,
|
127
|
+
# the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
|
128
|
+
# or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
|
129
|
+
# @raise [Ingenico::Connect::SDK::ApiException]if the Ingenico ePayments platform returned any other error
|
130
|
+
def upload_file(dispute_id, body, context=nil)
|
131
|
+
path_context = {
|
132
|
+
'disputeId'.freeze => dispute_id,
|
133
|
+
}
|
134
|
+
uri = instantiate_uri('/files/v1/{merchantId}/disputes/{disputeId}', path_context)
|
135
|
+
return @communicator.post(
|
136
|
+
uri,
|
137
|
+
client_headers,
|
138
|
+
nil,
|
139
|
+
body,
|
140
|
+
Ingenico::Connect::SDK::Domain::Dispute::UploadDisputeFileResponse,
|
141
|
+
context)
|
142
|
+
rescue ResponseException => e
|
143
|
+
error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse
|
144
|
+
error_object = @communicator.marshaller.unmarshal(e.body, error_type)
|
145
|
+
raise create_exception(e.status_code, e.body, error_object, context)
|
146
|
+
end
|
114
147
|
end
|
115
148
|
end
|
116
149
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#
|
2
|
+
# This class was auto-generated from the API references found at
|
3
|
+
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
|
4
|
+
#
|
5
|
+
require 'ingenico/connect/sdk/multipart_form_data_object'
|
6
|
+
require 'ingenico/connect/sdk/multipart_form_data_request'
|
7
|
+
|
8
|
+
module Ingenico::Connect::SDK
|
9
|
+
module Merchant
|
10
|
+
module Disputes
|
11
|
+
|
12
|
+
# Multipart/form-data parameters for {https://epayments-api.developer-ingenico.com/fileserviceapi/v1/en_US/ruby/disputes/uploadFile.html Upload File}
|
13
|
+
# @attr [Ingenico::Connect::SDK::UploadableFile] file
|
14
|
+
class UploadFileRequest < Ingenico::Connect::SDK::MultipartFormDataRequest
|
15
|
+
|
16
|
+
attr_accessor :file
|
17
|
+
|
18
|
+
# @return [Array<Ingenico::Connect::SDK::MultipartFormDataObject>] representing the attributes of this class
|
19
|
+
def to_multipart_form_data_object
|
20
|
+
result = MultipartFormDataObject.new
|
21
|
+
result.add_file('file', @file) unless @file.nil?
|
22
|
+
result
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
#
|
2
|
+
# This class was auto-generated from the API references found at
|
3
|
+
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
|
4
|
+
#
|
5
|
+
require 'ingenico/connect/sdk/api_resource'
|
6
|
+
require 'ingenico/connect/sdk/response_exception'
|
7
|
+
require 'ingenico/connect/sdk/domain/errors/error_response'
|
8
|
+
|
9
|
+
module Ingenico::Connect::SDK
|
10
|
+
module Merchant
|
11
|
+
module Files
|
12
|
+
|
13
|
+
# Files client. Thread-safe.
|
14
|
+
class FilesClient < Ingenico::Connect::SDK::ApiResource
|
15
|
+
|
16
|
+
# @param parent [Ingenico::Connect::SDK::ApiResource]
|
17
|
+
# @param path_context [Hash]
|
18
|
+
def initialize(parent, path_context)
|
19
|
+
super(parent, path_context)
|
20
|
+
end
|
21
|
+
|
22
|
+
# Resource /!{merchantId}/files/!{fileId} - {https://epayments-api.developer-ingenico.com/fileserviceapi/v1/en_US/ruby/files/getFile.html Retrieve File}
|
23
|
+
# @param file_id [String]
|
24
|
+
# @param context [Ingenico::Connect::SDK::CallContext]
|
25
|
+
# @yield [Array<Ingenico::Connect::SDK::ResponseHeader>, IO] The response headers and body.
|
26
|
+
# @raise [Ingenico::Connect::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
|
27
|
+
# @raise [Ingenico::Connect::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
|
28
|
+
# @raise [Ingenico::Connect::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
|
29
|
+
# @raise [Ingenico::Connect::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
|
30
|
+
# or there was a conflict (HTTP status code 404, 409 or 410)
|
31
|
+
# @raise [Ingenico::Connect::SDK::GlobalCollectException] if something went wrong at the Ingenico ePayments platform,
|
32
|
+
# the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
|
33
|
+
# or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
|
34
|
+
# @raise [Ingenico::Connect::SDK::ApiException]if the Ingenico ePayments platform returned any other error
|
35
|
+
def get_file(file_id, context=nil)
|
36
|
+
path_context = {
|
37
|
+
'fileId'.freeze => file_id,
|
38
|
+
}
|
39
|
+
uri = instantiate_uri('/files/v1/{merchantId}/files/{fileId}', path_context)
|
40
|
+
@communicator.get_with_binary_response(
|
41
|
+
uri,
|
42
|
+
client_headers,
|
43
|
+
nil,
|
44
|
+
context) do |headers, response_body|
|
45
|
+
yield headers, response_body
|
46
|
+
end
|
47
|
+
rescue ResponseException => e
|
48
|
+
error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse
|
49
|
+
error_object = @communicator.marshaller.unmarshal(e.body, error_type)
|
50
|
+
raise create_exception(e.status_code, e.body, error_object, context)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|