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
@@ -3,31 +3,9 @@ module Ingenico::Connect::SDK
|
|
3
3
|
# Class that represents the URL request parameters.
|
4
4
|
# Contains a method to add a name and value pair to a parameter array as a {Ingenico::Connect::SDK::RequestParam}.
|
5
5
|
class ParamRequest
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
# Adds a {Ingenico::Connect::SDK::RequestParam} object to the _request_parameters_ array
|
10
|
-
# where RequestParam.name = name and RequestParam.value = value.
|
11
|
-
# Allows Strings, Integers, booleans and arrays of these to be converted to RequestParams.
|
12
|
-
# If _value_ is an array, one RequestParam instance will be added for each element in the array.
|
13
|
-
# An array containing another array is explicitly disallowed and will raise an error.
|
14
|
-
def add_parameter(request_parameters, name, value)
|
15
|
-
add_param(request_parameters, name, value)
|
16
|
-
end
|
17
|
-
|
18
|
-
private
|
19
|
-
|
20
|
-
def add_param(request_parameters, name, value, allow_collection = true)
|
21
|
-
if value.is_a?(String) || value.is_a?(Integer) || value.class == TrueClass ||
|
22
|
-
value.class == FalseClass
|
23
|
-
request_parameters.push(RequestParam.new(name, value.to_s))
|
24
|
-
elsif allow_collection && value.class == Array
|
25
|
-
value.each { |element|
|
26
|
-
add_param(request_parameters, name, element, false)
|
27
|
-
}
|
28
|
-
elsif !value.nil?
|
29
|
-
raise ArgumentError.new("Unsupported request parameter type: #{value.class}")
|
30
|
-
end
|
6
|
+
# @return [Array<Ingenico::Connect::SDK::RequestParam>]
|
7
|
+
def to_request_parameters
|
8
|
+
raise NotImplementedError
|
31
9
|
end
|
32
10
|
end
|
33
11
|
end
|
@@ -1,18 +1,25 @@
|
|
1
1
|
module Ingenico::Connect::SDK
|
2
2
|
|
3
|
-
# Contains the
|
3
|
+
# Contains the URL, username and password of a proxy.
|
4
|
+
#
|
5
|
+
# @attr [String] scheme Proxy scheme (http or https)
|
6
|
+
# @attr [String] host Proxy hostname
|
7
|
+
# @attr [Integer] port Proxy port
|
8
|
+
# @attr [String] username Proxy authentication username
|
9
|
+
# @attr [String] password Proxy authentication password
|
4
10
|
class ProxyConfiguration
|
5
11
|
|
6
12
|
# Initialize a new ProxyConfiguration from the parameter hash.
|
7
13
|
# In order to be complete either host, port and scheme, or an address is required.
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
14
|
+
#
|
15
|
+
# @param args [Hash] the parameters to initialize the proxy configuration with
|
16
|
+
# @option args [String] :host host part of the URL to the proxy.
|
17
|
+
# @option args [Integer] :port port the proxy will be accessed through.
|
18
|
+
# @option args [String] :scheme HTTP scheme used to communicate with the proxy (http or https).
|
19
|
+
# @option args [String] :address full URI to the proxy excluding username and password.
|
13
20
|
# If given this uri takes precedence over individual host, port and scheme.
|
14
|
-
# username
|
15
|
-
# password
|
21
|
+
# @option args [String] :username username used in authentication to the proxy.
|
22
|
+
# @option args [String] :password password used to authenticate to the proxy.
|
16
23
|
def initialize(args)
|
17
24
|
|
18
25
|
host = args[:host]
|
@@ -38,22 +45,14 @@ module Ingenico::Connect::SDK
|
|
38
45
|
@scheme = scheme
|
39
46
|
end
|
40
47
|
|
41
|
-
# proxy scheme (http or https)
|
42
48
|
attr_accessor :scheme
|
43
|
-
|
44
|
-
# proxy hostname
|
45
49
|
attr_accessor :host
|
46
|
-
|
47
|
-
# proxy port
|
48
50
|
attr_accessor :port
|
49
51
|
|
50
|
-
# proxy authentication username
|
51
52
|
attr_accessor :username
|
52
|
-
|
53
|
-
# proxy authentication password
|
54
53
|
attr_accessor :password
|
55
54
|
|
56
|
-
#
|
55
|
+
# @return [String] a URL string representation of the proxy, excluding authentication.
|
57
56
|
def proxy_uri
|
58
57
|
"#{scheme}://#{host}:#{port}"
|
59
58
|
end
|
@@ -2,6 +2,9 @@ module Ingenico::Connect::SDK
|
|
2
2
|
|
3
3
|
# Represents HTTP request headers
|
4
4
|
# Each header is immutable has a #name and #value attribute
|
5
|
+
#
|
6
|
+
# @attr_reader [String] name HTTP header name
|
7
|
+
# @attr_reader [String] value HTTP header value
|
5
8
|
class RequestHeader
|
6
9
|
|
7
10
|
# Create a new header using the name and value given as parameters.
|
@@ -13,15 +16,31 @@ module Ingenico::Connect::SDK
|
|
13
16
|
@value = normalize_value(value)
|
14
17
|
end
|
15
18
|
|
16
|
-
# HTTP header name
|
17
19
|
attr_reader :name
|
18
|
-
# HTTP header value
|
19
20
|
attr_reader :value
|
20
21
|
|
21
22
|
def to_s
|
22
23
|
"#{name}:#{value}"
|
23
24
|
end
|
24
25
|
|
26
|
+
# Return the {Ingenico::Connect::SDK::ResponseHeader} that goes by the given _header_name_,
|
27
|
+
# If this Response does not contain a header with the given name, return _nil_ instead
|
28
|
+
def self.get_header(headers, header_name)
|
29
|
+
selected_headers = headers.select { |h| h.name == header_name }
|
30
|
+
if selected_headers.nil? || selected_headers.length == 0
|
31
|
+
return nil
|
32
|
+
else
|
33
|
+
return selected_headers[0]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
# Returns the header value of the header that goes by the given _header_name_,
|
38
|
+
# If this response does not contain a header with the given name, return _nil_ instead
|
39
|
+
def self.get_header_value(headers, header_name)
|
40
|
+
header = get_header(headers, header_name)
|
41
|
+
return (if header.nil? then nil else header.value end)
|
42
|
+
end
|
43
|
+
|
25
44
|
private
|
26
45
|
|
27
46
|
def normalize_value(value)
|
@@ -32,7 +51,7 @@ module Ingenico::Connect::SDK
|
|
32
51
|
# This will ensure that:
|
33
52
|
# - no line ends with whitespace, because this causes authentication failures
|
34
53
|
# - each line starts with a single whitespace, so it is a valid header value
|
35
|
-
value.gsub(/[\s&&[^\r\n]]*(\r?\n)[\s&&[^\r\n]]*/, '\1 ')
|
54
|
+
value.gsub(/[\s&&[^\r\n]]*(\r?\n)[\s&&[^\r\n]]*/, '\1 ')
|
36
55
|
end
|
37
56
|
end
|
38
57
|
end
|
@@ -2,6 +2,9 @@ module Ingenico::Connect::SDK
|
|
2
2
|
|
3
3
|
# Represents a URL request parameter.
|
4
4
|
# Each parameter is immutable and has a #name and #value attribute.
|
5
|
+
#
|
6
|
+
# @attr_reader [String] name Parameter name
|
7
|
+
# @attr_reader [String] value Parameter value
|
5
8
|
class RequestParam
|
6
9
|
|
7
10
|
def initialize(name, value)
|
@@ -12,9 +15,7 @@ module Ingenico::Connect::SDK
|
|
12
15
|
@value = value
|
13
16
|
end
|
14
17
|
|
15
|
-
# parameter name
|
16
18
|
attr_reader :name
|
17
|
-
# parameter value
|
18
19
|
attr_reader :value
|
19
20
|
|
20
21
|
def to_s
|
@@ -1,52 +1,49 @@
|
|
1
1
|
module Ingenico::Connect::SDK
|
2
2
|
|
3
3
|
# Exception used internally in the SDK to indicate an error response was received from the Ingenico ePayments platform.
|
4
|
+
#
|
5
|
+
# @attr_reader [Integer] status_code HTTP status code that was returned by the Ingenico ePayments platform
|
6
|
+
# @attr_reader [String] body HTTP message body that was returned by the Ingenico ePayments platform
|
7
|
+
# @attr_reader [Array<Ingenico:Connect:SDK:ResponseHeader>] headers HTTP headers used in the response from the Ingenico ePayments platform
|
4
8
|
class ResponseException < RuntimeError
|
5
9
|
|
6
|
-
def initialize(
|
10
|
+
def initialize(status_code, headers, body)
|
7
11
|
super('the Ingenico ePayments platform returned an error response')
|
8
|
-
@
|
12
|
+
@status_code = status_code
|
13
|
+
@headers = if headers.nil? or headers.empty?
|
14
|
+
{}
|
15
|
+
else
|
16
|
+
headers.inject({}) do |hash, header|
|
17
|
+
hash[header.name.downcase.to_sym] = header.dup.freeze
|
18
|
+
hash
|
19
|
+
end
|
20
|
+
end.freeze
|
21
|
+
@body = body
|
9
22
|
end
|
10
23
|
|
11
|
-
|
12
|
-
attr_reader :
|
13
|
-
|
14
|
-
# HTTP status code that was returned by the Ingenico ePayments platform
|
15
|
-
def status_code
|
16
|
-
@response.status_code
|
17
|
-
end
|
18
|
-
|
19
|
-
# string HTTP message body that was returned by the Ingenico ePayments platform
|
20
|
-
def body
|
21
|
-
@response.body
|
22
|
-
end
|
23
|
-
|
24
|
-
# List of {Ingenico::Connect::SDK::ResponseHeader} that represent the HTTP headers used in the response from the Ingenico ePayments platform
|
25
|
-
def headers
|
26
|
-
@response.headers
|
27
|
-
end
|
24
|
+
attr_reader :status_code
|
25
|
+
attr_reader :body
|
26
|
+
attr_reader :headers
|
28
27
|
|
29
28
|
# Returns the {Ingenico::Connect::SDK::ResponseHeader} that corresponds to the given _header_name_
|
30
29
|
# used in the HTTP response from the Ingenico ePayments platform, or *nil* if the header was not present in the response.
|
31
30
|
def get_header(header_name)
|
32
|
-
|
31
|
+
ResponseHeader.get_header(@headers, header_name)
|
33
32
|
end
|
34
33
|
|
35
34
|
# Returns the header value received that corresponds to the header named by _header_name_,
|
36
35
|
# or *nil* if _header_name_ was not a header present in the HTTP response.
|
37
36
|
def get_header_value(header_name)
|
38
|
-
|
37
|
+
ResponseHeader.get_header_value(@headers, header_name)
|
39
38
|
end
|
40
39
|
|
41
40
|
def to_s
|
42
41
|
str = super.to_s
|
43
|
-
status_code
|
44
|
-
|
45
|
-
str += '; status_code=' + status_code.to_s
|
42
|
+
if @status_code > 0
|
43
|
+
str += '; status_code=' + @status_code.to_s
|
46
44
|
end
|
47
|
-
|
48
|
-
|
49
|
-
str += "; response_body='" + response_body + "'"
|
45
|
+
if !@body.nil? && @body.length > 0
|
46
|
+
str += "; response_body='" + @body + "'"
|
50
47
|
end
|
51
48
|
str.to_s
|
52
49
|
end
|
@@ -2,6 +2,9 @@ module Ingenico::Connect::SDK
|
|
2
2
|
|
3
3
|
# Represents HTTP response headers
|
4
4
|
# Each header is immutable has a #name and #value attribute
|
5
|
+
#
|
6
|
+
# @attr_reader [String] name HTTP header name
|
7
|
+
# @attr_reader [String] value HTTP header value
|
5
8
|
class ResponseHeader
|
6
9
|
|
7
10
|
# Create a new header using the name and value given as parameters.
|
@@ -11,13 +14,57 @@ module Ingenico::Connect::SDK
|
|
11
14
|
@value = value
|
12
15
|
end
|
13
16
|
|
14
|
-
# HTTP header name
|
15
17
|
attr_reader :name
|
16
|
-
# HTTP header value
|
17
18
|
attr_reader :value
|
18
19
|
|
19
20
|
def to_s
|
20
21
|
"#{name}:#{value}"
|
21
22
|
end
|
23
|
+
|
24
|
+
# Return the {Ingenico::Connect::SDK::ResponseHeader} that goes by the given _header_name_,
|
25
|
+
# If this Response does not contain a header with the given name, return _nil_ instead
|
26
|
+
def self.get_header(headers, header_name)
|
27
|
+
selected_headers = headers.select { |h| h.name.casecmp(header_name) == 0 }
|
28
|
+
if selected_headers.nil? || selected_headers.length == 0
|
29
|
+
return nil
|
30
|
+
else
|
31
|
+
return selected_headers[0]
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# Returns the header value of the header that goes by the given _header_name_,
|
36
|
+
# If this response does not contain a header with the given name, return _nil_ instead
|
37
|
+
def self.get_header_value(headers, header_name)
|
38
|
+
header = get_header(headers, header_name)
|
39
|
+
return (if header.nil? then nil else header.value end)
|
40
|
+
end
|
41
|
+
|
42
|
+
# Returns the value of the _filename_ parameter of the _Content-Disposition_ header from
|
43
|
+
# parameter _headers_
|
44
|
+
# If this Response does not contain a header with the given name, return _nil_ instead
|
45
|
+
def self.get_disposition_filename(headers)
|
46
|
+
header_value = get_header_value(headers, "Content-Disposition")
|
47
|
+
unless header_value.nil?
|
48
|
+
if header_value =~ /(?:^|;)\s*filename\s*=\s*(.*?)\s*(?:;|$)i/
|
49
|
+
return trim_quotes($2)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
return nil
|
54
|
+
end
|
55
|
+
|
56
|
+
private
|
57
|
+
|
58
|
+
# Trims the single or double quotes at the beginning and end of parameter _filename_ if they exist
|
59
|
+
# If they don't exist, it returns the original _filename_ instead
|
60
|
+
def trim_quotes(filename)
|
61
|
+
unless filename.length < 2
|
62
|
+
if ( filename.chars.first == '\'' && filename.chars.last == '\"' ) ||
|
63
|
+
( filename.chars.first == '"' && filename.chars.last == '"' )
|
64
|
+
return filename[1...-1]
|
65
|
+
end
|
66
|
+
end
|
67
|
+
return filename
|
68
|
+
end
|
22
69
|
end
|
23
70
|
end
|
@@ -3,14 +3,19 @@ require 'uri'
|
|
3
3
|
module Ingenico::Connect::SDK
|
4
4
|
|
5
5
|
# Contains networking and authentication data needed to communicate with the Ingenico ePayments platform
|
6
|
+
#
|
7
|
+
# @attr_reader [URI::HTTP] api_endpoint The base URI to the Ingenico ePayments platform
|
8
|
+
# @attr_reader [Ingenico::Connect::SDK::Connection] connection Used to communicate with the Ingenico ePayments platform
|
9
|
+
# @attr_reader [Ingenico::Connect::SDK::Authenticator] authenticator Used for authenticating messages sent
|
10
|
+
# @attr_reader [Ingenico::Connect::SDK::MetaDataProvider] meta_data_provider Object containing information relevant for sending requests
|
6
11
|
class Session
|
7
12
|
|
8
13
|
# Construct a new Session.
|
9
|
-
#
|
10
|
-
# api_endpoint
|
11
|
-
# connection
|
12
|
-
# authenticator
|
13
|
-
# meta_data_provider
|
14
|
+
#
|
15
|
+
# @param api_endpoint [String] the base URL to the Ingenico ePayments platform
|
16
|
+
# @param connection [Ingenico::Connect::SDK::Connection] used to communicate with the Ingenico ePayments platform
|
17
|
+
# @param authenticator [Ingenico::Connect::SDK::Authenticator] used for authenticating messages sent
|
18
|
+
# @param meta_data_provider [Ingenico::Connect::SDK::MetaDataProvider] object containing information relevant for sending requests
|
14
19
|
def initialize(api_endpoint, connection, authenticator, meta_data_provider)
|
15
20
|
raise ArgumentError.new('api_endpoint is required') unless api_endpoint
|
16
21
|
raise ArgumentError.new('connection is required') unless connection
|
@@ -19,7 +24,7 @@ module Ingenico::Connect::SDK
|
|
19
24
|
|
20
25
|
uri = URI(api_endpoint)
|
21
26
|
if uri.path.length > 0 || uri.query || uri.fragment
|
22
|
-
raise ArgumentError.new("Base
|
27
|
+
raise ArgumentError.new("Base URL should not contain a path, query or fragment #{uri.to_s}")
|
23
28
|
end
|
24
29
|
@api_endpoint = uri
|
25
30
|
@connection = connection
|
@@ -27,13 +32,9 @@ module Ingenico::Connect::SDK
|
|
27
32
|
@meta_data_provider = meta_data_provider
|
28
33
|
end
|
29
34
|
|
30
|
-
# The base URI to the Ingenico ePayments platform as a {URI} object
|
31
35
|
attr_reader :api_endpoint
|
32
|
-
# An instance of the {Ingenico::Connect::SDK::Connection} class used to communicate with
|
33
36
|
attr_reader :connection
|
34
|
-
# An instance of the {Ingenico::Connect::SDK::Authenticator} class used for authenticating messages sent
|
35
37
|
attr_reader :authenticator
|
36
|
-
# An instance of the {Ingenico::Connect::SDK::MetaDataProvider} class containing information relevant for sending requests
|
37
38
|
attr_reader :meta_data_provider
|
38
39
|
end
|
39
40
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Ingenico::Connect::SDK
|
2
|
+
|
3
|
+
# A file that can be uploaded
|
4
|
+
#
|
5
|
+
# The allowed forms of content are defined by the Connection implementation
|
6
|
+
# The default implementation supports file paths and IO objects.
|
7
|
+
#
|
8
|
+
# @attr_reader [String] file_name The name of the file.
|
9
|
+
# @attr_reader [String, IO] content The file's content.
|
10
|
+
# @attr_reader [String] content_type The file's content type.
|
11
|
+
# @attr_reader [Integer] content_length The file's content length, or -1 if not known.
|
12
|
+
class UploadableFile
|
13
|
+
|
14
|
+
def initialize(file_name, content, content_type, content_length=-1)
|
15
|
+
raise ArgumentError.new("file_name is required") if file_name.nil? or !file_name.strip
|
16
|
+
raise ArgumentError.new("content is required") if content.nil?
|
17
|
+
raise ArgumentError.new("content_type is required") if content_type.nil? or !content_type.strip
|
18
|
+
|
19
|
+
@file_name = file_name
|
20
|
+
@content = content
|
21
|
+
@content_type = content_type
|
22
|
+
@content_length = [content_length, -1].max
|
23
|
+
end
|
24
|
+
|
25
|
+
attr_reader :file_name
|
26
|
+
attr_reader :content
|
27
|
+
attr_reader :content_type
|
28
|
+
attr_reader :content_length
|
29
|
+
end
|
30
|
+
end
|
@@ -2,6 +2,9 @@ module Ingenico::Connect::SDK
|
|
2
2
|
module Webhooks
|
3
3
|
# Raised when a webhooks event has an API version that is not supported by current version
|
4
4
|
# of SDK.
|
5
|
+
#
|
6
|
+
# @attr_reader [String] event_api_version The API version from the webhooks event.
|
7
|
+
# @attr_reader [String] sdk_api_version The API version that this version of the SDK supports.
|
5
8
|
class ApiVersionMismatchException < RuntimeError
|
6
9
|
|
7
10
|
def initialize(event_api_version, sdk_api_version)
|
@@ -10,10 +13,7 @@ module Ingenico::Connect::SDK
|
|
10
13
|
@sdk_api_version = sdk_api_version
|
11
14
|
end
|
12
15
|
|
13
|
-
# The API version from the webhooks event.
|
14
16
|
attr_reader :event_api_version
|
15
|
-
|
16
|
-
# The API version that this version of the SDK supports.
|
17
17
|
attr_reader :sdk_api_version
|
18
18
|
end
|
19
19
|
end
|
@@ -20,8 +20,8 @@ module Ingenico::Connect::SDK
|
|
20
20
|
|
21
21
|
# Retrieves the secret key corresponding to the given key id
|
22
22
|
#
|
23
|
-
# key_id
|
24
|
-
#
|
23
|
+
# @param key_id [String] key id of the secret key
|
24
|
+
# @raise [Ingenico::Connect::SDK::Webhooks::SecretKeyNotAvailableException] if the secret key for the given key id is not available.
|
25
25
|
def get_secret_key(key_id)
|
26
26
|
if (secret_key = @store.get(key_id)).nil?
|
27
27
|
msg = "could not find secret key for key id " + key_id
|
@@ -32,8 +32,8 @@ module Ingenico::Connect::SDK
|
|
32
32
|
|
33
33
|
# Stores the given secret key for the given key id.
|
34
34
|
#
|
35
|
-
# key_id
|
36
|
-
#
|
35
|
+
# @param key_id [String] key id of the secret key
|
36
|
+
# @param secret_key [String] the secret key to be stored
|
37
37
|
def store_secret_key(key_id, secret_key)
|
38
38
|
raise ArgumentError if key_id.nil? or key_id.strip.empty?
|
39
39
|
raise ArgumentError if secret_key.nil? or secret_key.strip.empty?
|
@@ -42,7 +42,7 @@ module Ingenico::Connect::SDK
|
|
42
42
|
|
43
43
|
# Removes the secret key for the given key id.
|
44
44
|
#
|
45
|
-
# key_id
|
45
|
+
# @param key_id [String] the key id whose corresponding secret should be removed from the store
|
46
46
|
def remove_secret_key(key_id)
|
47
47
|
@store.delete(key_id)
|
48
48
|
end
|