connect-sdk-ruby 2.44.0 → 2.46.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/create_refund_capture_example.rb +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 +1 -1
- data/examples/merchant/files/get_file_example.rb +1 -1
- data/examples/merchant/hostedcheckouts/create_hosted_checkout_example.rb +1 -1
- data/examples/merchant/hostedcheckouts/delete_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/installments/get_installments_info_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 +1 -1
- 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_device_fingerprint_details_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 +1 -1
- 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 +1 -1
- 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/create_payment_product_session_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/api_exception.rb +46 -43
- data/lib/ingenico/connect/sdk/api_resource.rb +124 -107
- data/lib/ingenico/connect/sdk/authenticator.rb +15 -12
- data/lib/ingenico/connect/sdk/authorization_exception.rb +13 -8
- data/lib/ingenico/connect/sdk/call_context.rb +24 -21
- data/lib/ingenico/connect/sdk/client.rb +3 -4
- data/lib/ingenico/connect/sdk/communication_exception.rb +14 -11
- data/lib/ingenico/connect/sdk/communicator.rb +475 -471
- data/lib/ingenico/connect/sdk/communicator_configuration.rb +79 -73
- data/lib/ingenico/connect/sdk/connection.rb +38 -33
- data/lib/ingenico/connect/sdk/data_object.rb +26 -24
- data/lib/ingenico/connect/sdk/declined_payment_exception.rb +38 -35
- data/lib/ingenico/connect/sdk/declined_payout_exception.rb +38 -35
- data/lib/ingenico/connect/sdk/declined_refund_exception.rb +37 -36
- data/lib/ingenico/connect/sdk/declined_transaction_exception.rb +15 -10
- data/lib/ingenico/connect/sdk/defaultimpl/authorization_type.rb +16 -13
- data/lib/ingenico/connect/sdk/defaultimpl/default_authenticator.rb +98 -94
- data/lib/ingenico/connect/sdk/defaultimpl/default_connection.rb +365 -347
- data/lib/ingenico/connect/sdk/defaultimpl/default_marshaller.rb +30 -25
- data/lib/ingenico/connect/sdk/defaultimpl.rb +1 -6
- data/lib/ingenico/connect/sdk/domain/capture/capture.rb +35 -32
- data/lib/ingenico/connect/sdk/domain/capture/capture_output.rb +117 -114
- data/lib/ingenico/connect/sdk/domain/capture/capture_response.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/capture/capture_status_output.rb +36 -33
- data/lib/ingenico/connect/sdk/domain/capture/captures_response.rb +24 -21
- data/lib/ingenico/connect/sdk/domain/capture.rb +5 -0
- data/lib/ingenico/connect/sdk/domain/definitions/abstract_order_status.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/definitions/abstract_payment_method_specific_input.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/definitions/additional_order_input_airline_data.rb +29 -26
- data/lib/ingenico/connect/sdk/domain/definitions/address.rb +63 -60
- data/lib/ingenico/connect/sdk/domain/definitions/airline_data.rb +200 -197
- data/lib/ingenico/connect/sdk/domain/definitions/airline_flight_leg.rb +159 -156
- data/lib/ingenico/connect/sdk/domain/definitions/airline_passenger.rb +45 -42
- data/lib/ingenico/connect/sdk/domain/definitions/amount_of_money.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/definitions/bank_account.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/definitions/bank_account_bban.rb +51 -48
- data/lib/ingenico/connect/sdk/domain/definitions/bank_account_iban.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/definitions/card.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/definitions/card_essentials.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/definitions/card_fraud_results.rb +47 -53
- data/lib/ingenico/connect/sdk/domain/definitions/card_without_cvv.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/definitions/company_information.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/definitions/contact_details_base.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/definitions/customer_base.rb +36 -33
- data/lib/ingenico/connect/sdk/domain/definitions/fraud_fields.rb +171 -168
- data/lib/ingenico/connect/sdk/domain/definitions/fraud_fields_shipping_details.rb +40 -37
- data/lib/ingenico/connect/sdk/domain/definitions/fraud_results.rb +36 -24
- data/lib/ingenico/connect/sdk/domain/definitions/fraud_results_retail_decisions.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/definitions/fraugster_results.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/definitions/in_auth.rb +52 -49
- data/lib/ingenico/connect/sdk/domain/definitions/key_value_pair.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/definitions/lodging_charge.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/definitions/lodging_data.rb +135 -132
- data/lib/ingenico/connect/sdk/domain/definitions/lodging_room.rb +69 -66
- data/lib/ingenico/connect/sdk/domain/definitions/microsoft_fraud_results.rb +57 -54
- data/lib/ingenico/connect/sdk/domain/definitions/order_status_output.rb +64 -61
- data/lib/ingenico/connect/sdk/domain/definitions/payment_product_filter.rb +34 -31
- data/lib/ingenico/connect/sdk/domain/definitions/personal_name_base.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/definitions/redirect_data_base.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/definitions/result_do_risk_assessment.rb +47 -44
- data/lib/ingenico/connect/sdk/domain/definitions/retail_decisions_cc_fraud_check_output.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/definitions/validation_bank_account_check.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/definitions/validation_bank_account_output.rb +48 -45
- data/lib/ingenico/connect/sdk/domain/definitions.rb +5 -0
- data/lib/ingenico/connect/sdk/domain/dispute/create_dispute_request.rb +46 -43
- data/lib/ingenico/connect/sdk/domain/dispute/dispute.rb +47 -44
- data/lib/ingenico/connect/sdk/domain/dispute/dispute_creation_detail.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/dispute/dispute_output.rb +75 -72
- data/lib/ingenico/connect/sdk/domain/dispute/dispute_reference.rb +52 -49
- data/lib/ingenico/connect/sdk/domain/dispute/dispute_response.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/dispute/dispute_status_output.rb +45 -42
- data/lib/ingenico/connect/sdk/domain/dispute/disputes_response.rb +24 -21
- data/lib/ingenico/connect/sdk/domain/dispute/upload_dispute_file_response.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/dispute.rb +5 -0
- data/lib/ingenico/connect/sdk/domain/errors/api_error.rb +57 -54
- data/lib/ingenico/connect/sdk/domain/errors/error_response.rb +30 -27
- data/lib/ingenico/connect/sdk/domain/errors.rb +5 -0
- data/lib/ingenico/connect/sdk/domain/file/hosted_file.rb +45 -42
- data/lib/ingenico/connect/sdk/domain/file.rb +5 -0
- data/lib/ingenico/connect/sdk/domain/hostedcheckout/create_hosted_checkout_request.rb +92 -89
- data/lib/ingenico/connect/sdk/domain/hostedcheckout/create_hosted_checkout_response.rb +48 -45
- data/lib/ingenico/connect/sdk/domain/hostedcheckout/created_payment_output.rb +62 -59
- data/lib/ingenico/connect/sdk/domain/hostedcheckout/displayed_data.rb +36 -33
- data/lib/ingenico/connect/sdk/domain/hostedcheckout/frequency.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/hostedcheckout/get_hosted_checkout_response.rb +28 -25
- data/lib/ingenico/connect/sdk/domain/hostedcheckout/hosted_checkout_specific_input.rb +77 -74
- data/lib/ingenico/connect/sdk/domain/hostedcheckout/mobile_payment_method_specific_input_hosted_checkout.rb +53 -50
- data/lib/ingenico/connect/sdk/domain/hostedcheckout/mobile_payment_product302_specific_input_hosted_checkout.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/hostedcheckout/mobile_payment_product320_specific_input_hosted_checkout.rb +34 -31
- data/lib/ingenico/connect/sdk/domain/hostedcheckout/payment_product_filters_hosted_checkout.rb +35 -32
- data/lib/ingenico/connect/sdk/domain/hostedcheckout/recurring_payments_data.rb +29 -26
- data/lib/ingenico/connect/sdk/domain/hostedcheckout/trial_information.rb +48 -45
- data/lib/ingenico/connect/sdk/domain/hostedcheckout/trial_period.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/hostedcheckout.rb +5 -0
- data/lib/ingenico/connect/sdk/domain/hostedmandatemanagement/create_hosted_mandate_management_request.rb +29 -26
- data/lib/ingenico/connect/sdk/domain/hostedmandatemanagement/create_hosted_mandate_management_response.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/hostedmandatemanagement/get_hosted_mandate_management_response.rb +28 -25
- data/lib/ingenico/connect/sdk/domain/hostedmandatemanagement/hosted_mandate_info.rb +52 -49
- data/lib/ingenico/connect/sdk/domain/hostedmandatemanagement/hosted_mandate_management_specific_input.rb +45 -42
- data/lib/ingenico/connect/sdk/domain/hostedmandatemanagement.rb +5 -0
- data/lib/ingenico/connect/sdk/domain/installments/get_installment_request.rb +46 -43
- data/lib/ingenico/connect/sdk/domain/installments/installment_display_hints.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/installments/installment_options.rb +37 -34
- data/lib/ingenico/connect/sdk/domain/installments/installment_options_response.rb +24 -21
- data/lib/ingenico/connect/sdk/domain/installments.rb +5 -0
- data/lib/ingenico/connect/sdk/domain/mandates/create_mandate_base.rb +58 -55
- data/lib/ingenico/connect/sdk/domain/mandates/create_mandate_request.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/mandates/create_mandate_response.rb +29 -26
- data/lib/ingenico/connect/sdk/domain/mandates/create_mandate_with_return_url.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/mandates/get_mandate_response.rb +22 -19
- data/lib/ingenico/connect/sdk/domain/mandates/mandate_address.rb +52 -49
- data/lib/ingenico/connect/sdk/domain/mandates/mandate_contact_details.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/mandates/mandate_customer.rb +49 -46
- data/lib/ingenico/connect/sdk/domain/mandates/mandate_merchant_action.rb +28 -25
- data/lib/ingenico/connect/sdk/domain/mandates/mandate_personal_information.rb +28 -25
- data/lib/ingenico/connect/sdk/domain/mandates/mandate_personal_name.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/mandates/mandate_redirect_data.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/mandates/mandate_response.rb +52 -49
- data/lib/ingenico/connect/sdk/domain/mandates.rb +5 -0
- data/lib/ingenico/connect/sdk/domain/metadata/shopping_cart_extension.rb +49 -42
- data/lib/ingenico/connect/sdk/domain/metadata.rb +1 -0
- data/lib/ingenico/connect/sdk/domain/payment/abstract_bank_transfer_payment_method_specific_input.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payment/abstract_card_payment_method_specific_input.rb +129 -119
- data/lib/ingenico/connect/sdk/domain/payment/abstract_cash_payment_method_specific_input.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/abstract_e_invoice_payment_method_specific_input.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payment/abstract_payment_method_specific_output.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payment/abstract_redirect_payment_method_specific_input.rb +52 -49
- data/lib/ingenico/connect/sdk/domain/payment/abstract_redirect_payment_product4101_specific_input.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/abstract_redirect_payment_product840_specific_input.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payment/abstract_sepa_direct_debit_payment_method_specific_input.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/abstract_sepa_direct_debit_payment_product771_specific_input.rb +23 -20
- data/lib/ingenico/connect/sdk/domain/payment/abstract_three_d_secure.rb +72 -69
- data/lib/ingenico/connect/sdk/domain/payment/account_funding_recipient.rb +53 -50
- data/lib/ingenico/connect/sdk/domain/payment/additional_order_input.rb +82 -79
- data/lib/ingenico/connect/sdk/domain/payment/address_personal.rb +22 -19
- data/lib/ingenico/connect/sdk/domain/payment/afr_name.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/payment/amount_breakdown.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/payment/approve_payment_card_payment_method_specific_output.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payment/approve_payment_direct_debit_payment_method_specific_input.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/approve_payment_mobile_payment_method_specific_output.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payment/approve_payment_non_sepa_direct_debit_payment_method_specific_input.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/approve_payment_payment_method_specific_input.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/payment/approve_payment_request.rb +48 -45
- data/lib/ingenico/connect/sdk/domain/payment/approve_payment_sepa_direct_debit_payment_method_specific_input.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/bank_transfer_payment_method_specific_input.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/bank_transfer_payment_method_specific_input_base.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/bank_transfer_payment_method_specific_output.rb +22 -19
- data/lib/ingenico/connect/sdk/domain/payment/browser_data.rb +57 -54
- data/lib/ingenico/connect/sdk/domain/payment/cancel_approval_payment_response.rb +22 -19
- data/lib/ingenico/connect/sdk/domain/payment/cancel_payment_card_payment_method_specific_output.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payment/cancel_payment_mobile_payment_method_specific_output.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payment/cancel_payment_response.rb +36 -33
- data/lib/ingenico/connect/sdk/domain/payment/capture_payment_request.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/payment/card_payment_method_specific_input.rb +65 -62
- data/lib/ingenico/connect/sdk/domain/payment/card_payment_method_specific_input_base.rb +22 -19
- data/lib/ingenico/connect/sdk/domain/payment/card_payment_method_specific_output.rb +60 -57
- data/lib/ingenico/connect/sdk/domain/payment/card_recurrence_details.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/payment/cash_payment_method_specific_input.rb +66 -63
- data/lib/ingenico/connect/sdk/domain/payment/cash_payment_method_specific_input_base.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/cash_payment_method_specific_output.rb +22 -19
- data/lib/ingenico/connect/sdk/domain/payment/cash_payment_product1503_specific_input.rb +24 -21
- data/lib/ingenico/connect/sdk/domain/payment/cash_payment_product1504_specific_input.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/cash_payment_product1521_specific_input.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/cash_payment_product1522_specific_input.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/cash_payment_product1523_specific_input.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/cash_payment_product1524_specific_input.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/cash_payment_product1526_specific_input.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/cash_payment_product_with_redirect_specific_input_base.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payment/complete_payment_card_payment_method_specific_input.rb +22 -19
- data/lib/ingenico/connect/sdk/domain/payment/complete_payment_request.rb +36 -33
- data/lib/ingenico/connect/sdk/domain/payment/complete_payment_response.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/contact_details.rb +45 -42
- data/lib/ingenico/connect/sdk/domain/payment/create_payment_request.rb +120 -117
- data/lib/ingenico/connect/sdk/domain/payment/create_payment_response.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/create_payment_result.rb +36 -33
- data/lib/ingenico/connect/sdk/domain/payment/customer.rb +89 -86
- data/lib/ingenico/connect/sdk/domain/payment/customer_account.rb +104 -101
- data/lib/ingenico/connect/sdk/domain/payment/customer_account_authentication.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/payment/customer_approve_payment.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payment/customer_device.rb +64 -61
- data/lib/ingenico/connect/sdk/domain/payment/customer_payment_activity.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/payment/decrypted_payment_data.rb +65 -62
- data/lib/ingenico/connect/sdk/domain/payment/device_fingerprint_details.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/payment/device_render_options.rb +38 -35
- data/lib/ingenico/connect/sdk/domain/payment/e_invoice_payment_method_specific_input.rb +28 -25
- data/lib/ingenico/connect/sdk/domain/payment/e_invoice_payment_method_specific_input_base.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/e_invoice_payment_method_specific_output.rb +30 -18
- data/lib/ingenico/connect/sdk/domain/payment/e_invoice_payment_product9000_specific_input.rb +28 -25
- data/lib/ingenico/connect/sdk/domain/payment/e_invoice_payment_product9000_specific_output.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payment/exemption_output.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/payment/external_cardholder_authentication_data.rb +83 -80
- data/lib/ingenico/connect/sdk/domain/payment/find_payments_response.rb +47 -44
- data/lib/ingenico/connect/sdk/domain/payment/g_pay_three_d_secure.rb +46 -43
- data/lib/ingenico/connect/sdk/domain/payment/gift_card_purchase.rb +28 -25
- data/lib/ingenico/connect/sdk/domain/payment/hosted_checkout_specific_output.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/payment/installments.rb +53 -50
- data/lib/ingenico/connect/sdk/domain/payment/invoice_payment_method_specific_input.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payment/invoice_payment_method_specific_output.rb +22 -19
- data/lib/ingenico/connect/sdk/domain/payment/level3_summary_data.rb +40 -37
- data/lib/ingenico/connect/sdk/domain/payment/line_item.rb +45 -42
- data/lib/ingenico/connect/sdk/domain/payment/line_item_invoice_data.rb +52 -49
- data/lib/ingenico/connect/sdk/domain/payment/line_item_level3_interchange_information.rb +63 -60
- data/lib/ingenico/connect/sdk/domain/payment/loan_recipient.rb +56 -53
- data/lib/ingenico/connect/sdk/domain/payment/merchant.rb +46 -43
- data/lib/ingenico/connect/sdk/domain/payment/merchant_action.rb +67 -64
- data/lib/ingenico/connect/sdk/domain/payment/mobile_payment_data.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/payment/mobile_payment_method_specific_input.rb +59 -56
- data/lib/ingenico/connect/sdk/domain/payment/mobile_payment_method_specific_output.rb +48 -45
- data/lib/ingenico/connect/sdk/domain/payment/mobile_payment_product320_specific_input.rb +28 -25
- data/lib/ingenico/connect/sdk/domain/payment/mobile_three_d_secure_challenge_parameters.rb +45 -42
- data/lib/ingenico/connect/sdk/domain/payment/non_sepa_direct_debit_payment_method_specific_input.rb +71 -68
- data/lib/ingenico/connect/sdk/domain/payment/non_sepa_direct_debit_payment_method_specific_output.rb +22 -19
- data/lib/ingenico/connect/sdk/domain/payment/non_sepa_direct_debit_payment_product705_specific_input.rb +34 -31
- data/lib/ingenico/connect/sdk/domain/payment/non_sepa_direct_debit_payment_product730_specific_input.rb +22 -19
- data/lib/ingenico/connect/sdk/domain/payment/order.rb +77 -74
- data/lib/ingenico/connect/sdk/domain/payment/order_approve_payment.rb +36 -33
- data/lib/ingenico/connect/sdk/domain/payment/order_invoice_data.rb +47 -44
- data/lib/ingenico/connect/sdk/domain/payment/order_line_details.rb +101 -98
- data/lib/ingenico/connect/sdk/domain/payment/order_output.rb +29 -26
- data/lib/ingenico/connect/sdk/domain/payment/order_references.rb +52 -49
- data/lib/ingenico/connect/sdk/domain/payment/order_references_approve_payment.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payment/order_type_information.rb +45 -42
- data/lib/ingenico/connect/sdk/domain/payment/payment.rb +48 -45
- data/lib/ingenico/connect/sdk/domain/payment/payment_account_on_file.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/payment/payment_approval_response.rb +45 -42
- data/lib/ingenico/connect/sdk/domain/payment/payment_creation_output.rb +45 -42
- data/lib/ingenico/connect/sdk/domain/payment/payment_creation_references.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/payment/payment_error_response.rb +37 -34
- data/lib/ingenico/connect/sdk/domain/payment/payment_output.rb +117 -114
- data/lib/ingenico/connect/sdk/domain/payment/payment_product3201_specific_output.rb +22 -19
- data/lib/ingenico/connect/sdk/domain/payment/payment_product771_specific_output.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payment/payment_product806_specific_output.rb +29 -26
- data/lib/ingenico/connect/sdk/domain/payment/payment_product836_specific_output.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payment/payment_product840_customer_account.rb +75 -72
- data/lib/ingenico/connect/sdk/domain/payment/payment_product840_specific_output.rb +49 -46
- data/lib/ingenico/connect/sdk/domain/payment/payment_product863_third_party_data.rb +57 -54
- data/lib/ingenico/connect/sdk/domain/payment/payment_references.rb +57 -54
- data/lib/ingenico/connect/sdk/domain/payment/payment_response.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/payment_status_output.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/payment/personal_identification.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/payment/personal_information.rb +47 -44
- data/lib/ingenico/connect/sdk/domain/payment/personal_name.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payment/protection_eligibility.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/payment/redirect_data.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_method_specific_input.rb +92 -89
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_method_specific_input_base.rb +29 -26
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_method_specific_output.rb +76 -73
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_product4101_specific_input.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_product4101_specific_input_base.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_product809_specific_input.rb +29 -26
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_product816_specific_input.rb +22 -19
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_product840_specific_input.rb +29 -26
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_product840_specific_input_base.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_product861_specific_input.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_product863_specific_input.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_product869_specific_input.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_product882_specific_input.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payment/redirection_data.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/payment/refund_bank_method_specific_output.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/refund_card_method_specific_output.rb +28 -25
- data/lib/ingenico/connect/sdk/domain/payment/refund_cash_method_specific_output.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/refund_e_invoice_method_specific_output.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/refund_e_wallet_method_specific_output.rb +22 -19
- data/lib/ingenico/connect/sdk/domain/payment/refund_method_specific_output.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/payment/refund_mobile_method_specific_output.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payment/refund_output.rb +69 -66
- data/lib/ingenico/connect/sdk/domain/payment/refund_payment_product840_customer_account.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/payment/refund_payment_product840_specific_output.rb +22 -19
- data/lib/ingenico/connect/sdk/domain/payment/scheme_token_data.rb +52 -49
- data/lib/ingenico/connect/sdk/domain/payment/sdk_data_input.rb +58 -64
- data/lib/ingenico/connect/sdk/domain/payment/sdk_data_output.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payment/seller.rb +102 -99
- data/lib/ingenico/connect/sdk/domain/payment/sepa_direct_debit_payment_method_specific_input.rb +64 -61
- data/lib/ingenico/connect/sdk/domain/payment/sepa_direct_debit_payment_method_specific_input_base.rb +22 -19
- data/lib/ingenico/connect/sdk/domain/payment/sepa_direct_debit_payment_method_specific_output.rb +35 -32
- data/lib/ingenico/connect/sdk/domain/payment/sepa_direct_debit_payment_product771_specific_input.rb +28 -25
- data/lib/ingenico/connect/sdk/domain/payment/sepa_direct_debit_payment_product771_specific_input_base.rb +28 -25
- data/lib/ingenico/connect/sdk/domain/payment/shipping.rb +64 -61
- data/lib/ingenico/connect/sdk/domain/payment/shopping_cart.rb +59 -56
- data/lib/ingenico/connect/sdk/domain/payment/third_party_data.rb +22 -19
- data/lib/ingenico/connect/sdk/domain/payment/third_party_status_response.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payment/three_d_secure.rb +29 -26
- data/lib/ingenico/connect/sdk/domain/payment/three_d_secure_base.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payment/three_d_secure_data.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/payment/three_d_secure_results.rb +112 -109
- data/lib/ingenico/connect/sdk/domain/payment/tokenize_payment_request.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payment/trustly_bank_account.rb +45 -42
- data/lib/ingenico/connect/sdk/domain/payment.rb +5 -0
- data/lib/ingenico/connect/sdk/domain/payout/abstract_payout_method_specific_input.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payout/approve_payout_request.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payout/bank_transfer_payout_method_specific_input.rb +56 -53
- data/lib/ingenico/connect/sdk/domain/payout/card_payout_method_specific_input.rb +47 -44
- data/lib/ingenico/connect/sdk/domain/payout/create_payout_request.rb +126 -123
- data/lib/ingenico/connect/sdk/domain/payout/find_payouts_response.rb +47 -44
- data/lib/ingenico/connect/sdk/domain/payout/payout_customer.rb +49 -46
- data/lib/ingenico/connect/sdk/domain/payout/payout_details.rb +36 -33
- data/lib/ingenico/connect/sdk/domain/payout/payout_error_response.rb +37 -34
- data/lib/ingenico/connect/sdk/domain/payout/payout_merchant.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/payout/payout_recipient.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/payout/payout_references.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/payout/payout_response.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/payout/payout_result.rb +35 -32
- data/lib/ingenico/connect/sdk/domain/payout.rb +5 -0
- data/lib/ingenico/connect/sdk/domain/product/abstract_indicator.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/product/account_on_file.rb +48 -45
- data/lib/ingenico/connect/sdk/domain/product/account_on_file_attribute.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/product/account_on_file_display_hints.rb +30 -27
- data/lib/ingenico/connect/sdk/domain/product/authentication_indicator.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/product/boleto_bancario_requiredness_validator.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/product/create_payment_product_session_request.rb +22 -19
- data/lib/ingenico/connect/sdk/domain/product/create_payment_product_session_response.rb +22 -19
- data/lib/ingenico/connect/sdk/domain/product/device_fingerprint_request.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/product/device_fingerprint_response.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/product/directory.rb +24 -21
- data/lib/ingenico/connect/sdk/domain/product/directory_entry.rb +47 -44
- data/lib/ingenico/connect/sdk/domain/product/empty_validator.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/product/fixed_list_validator.rb +24 -21
- data/lib/ingenico/connect/sdk/domain/product/get_customer_details_request.rb +30 -27
- data/lib/ingenico/connect/sdk/domain/product/get_customer_details_response.rb +75 -72
- data/lib/ingenico/connect/sdk/domain/product/label_template_element.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/product/length_validator.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/product/mobile_payment_product_session302_specific_input.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/product/mobile_payment_product_session302_specific_output.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/product/payment_product.rb +203 -193
- data/lib/ingenico/connect/sdk/domain/product/payment_product302_specific_data.rb +24 -21
- data/lib/ingenico/connect/sdk/domain/product/payment_product320_specific_data.rb +30 -27
- data/lib/ingenico/connect/sdk/domain/product/payment_product863_specific_data.rb +24 -21
- data/lib/ingenico/connect/sdk/domain/product/payment_product_display_hints.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/product/payment_product_field.rb +47 -44
- data/lib/ingenico/connect/sdk/domain/product/payment_product_field_data_restrictions.rb +28 -25
- data/lib/ingenico/connect/sdk/domain/product/payment_product_field_display_element.rb +45 -42
- data/lib/ingenico/connect/sdk/domain/product/payment_product_field_display_hints.rb +77 -74
- data/lib/ingenico/connect/sdk/domain/product/payment_product_field_form_element.rb +30 -27
- data/lib/ingenico/connect/sdk/domain/product/payment_product_field_tooltip.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/product/payment_product_field_validators.rb +92 -89
- data/lib/ingenico/connect/sdk/domain/product/payment_product_group.rb +59 -56
- data/lib/ingenico/connect/sdk/domain/product/payment_product_group_response.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/product/payment_product_groups.rb +24 -21
- data/lib/ingenico/connect/sdk/domain/product/payment_product_networks_response.rb +24 -21
- data/lib/ingenico/connect/sdk/domain/product/payment_product_response.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/product/payment_products.rb +24 -21
- data/lib/ingenico/connect/sdk/domain/product/range_validator.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/product/regular_expression_validator.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/product/value_mapping_element.rb +38 -35
- data/lib/ingenico/connect/sdk/domain/product.rb +5 -0
- data/lib/ingenico/connect/sdk/domain/refund/approve_refund_request.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/refund/bank_account_bban_refund.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/refund/bank_refund_method_specific_input.rb +35 -32
- data/lib/ingenico/connect/sdk/domain/refund/find_refunds_response.rb +47 -44
- data/lib/ingenico/connect/sdk/domain/refund/refund_customer.rb +48 -45
- data/lib/ingenico/connect/sdk/domain/refund/refund_error_response.rb +37 -34
- data/lib/ingenico/connect/sdk/domain/refund/refund_references.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/refund/refund_request.rb +49 -46
- data/lib/ingenico/connect/sdk/domain/refund/refund_response.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/refund/refund_result.rb +35 -32
- data/lib/ingenico/connect/sdk/domain/refund/refunds_response.rb +24 -21
- data/lib/ingenico/connect/sdk/domain/refund.rb +5 -0
- data/lib/ingenico/connect/sdk/domain/riskassessments/contact_details_risk_assessment.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/riskassessments/customer_account_risk_assessment.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/riskassessments/customer_device_risk_assessment.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/riskassessments/customer_risk_assessment.rb +77 -74
- data/lib/ingenico/connect/sdk/domain/riskassessments/merchant_risk_assessment.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/riskassessments/order_risk_assessment.rb +43 -40
- data/lib/ingenico/connect/sdk/domain/riskassessments/personal_information_risk_assessment.rb +22 -19
- data/lib/ingenico/connect/sdk/domain/riskassessments/personal_name_risk_assessment.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/riskassessments/risk_assessment.rb +48 -45
- data/lib/ingenico/connect/sdk/domain/riskassessments/risk_assessment_bank_account.rb +29 -26
- data/lib/ingenico/connect/sdk/domain/riskassessments/risk_assessment_card.rb +22 -19
- data/lib/ingenico/connect/sdk/domain/riskassessments/risk_assessment_response.rb +24 -21
- data/lib/ingenico/connect/sdk/domain/riskassessments/shipping_risk_assessment.rb +34 -31
- data/lib/ingenico/connect/sdk/domain/riskassessments.rb +5 -0
- data/lib/ingenico/connect/sdk/domain/services/bank_data.rb +45 -42
- data/lib/ingenico/connect/sdk/domain/services/bank_details.rb +29 -26
- data/lib/ingenico/connect/sdk/domain/services/bank_details_request.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/services/bank_details_response.rb +43 -40
- data/lib/ingenico/connect/sdk/domain/services/convert_amount.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/services/get_iin_details_request.rb +28 -25
- data/lib/ingenico/connect/sdk/domain/services/get_iin_details_response.rb +47 -44
- data/lib/ingenico/connect/sdk/domain/services/get_privacy_policy_response.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/services/iin_detail.rb +27 -24
- data/lib/ingenico/connect/sdk/domain/services/payment_context.rb +46 -43
- data/lib/ingenico/connect/sdk/domain/services/swift.rb +75 -72
- data/lib/ingenico/connect/sdk/domain/services/test_connection.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/services.rb +5 -0
- data/lib/ingenico/connect/sdk/domain/sessions/payment_product_filters_client_session.rb +29 -26
- data/lib/ingenico/connect/sdk/domain/sessions/session_request.rb +31 -28
- data/lib/ingenico/connect/sdk/domain/sessions/session_response.rb +54 -51
- data/lib/ingenico/connect/sdk/domain/sessions.rb +5 -0
- data/lib/ingenico/connect/sdk/domain/token/abstract_token.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/token/approve_token_request.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/token/contact_details_token.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/token/create_token_request.rb +55 -52
- data/lib/ingenico/connect/sdk/domain/token/create_token_response.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/token/creditor.rb +81 -78
- data/lib/ingenico/connect/sdk/domain/token/customer_token.rb +29 -26
- data/lib/ingenico/connect/sdk/domain/token/customer_token_with_contact_details.rb +22 -19
- data/lib/ingenico/connect/sdk/domain/token/debtor.rb +81 -78
- data/lib/ingenico/connect/sdk/domain/token/mandate_approval.rb +33 -30
- data/lib/ingenico/connect/sdk/domain/token/mandate_non_sepa_direct_debit.rb +29 -26
- data/lib/ingenico/connect/sdk/domain/token/mandate_sepa_direct_debit.rb +22 -19
- data/lib/ingenico/connect/sdk/domain/token/mandate_sepa_direct_debit_with_mandate_id.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/token/mandate_sepa_direct_debit_without_creditor.rb +54 -51
- data/lib/ingenico/connect/sdk/domain/token/personal_information_token.rb +22 -19
- data/lib/ingenico/connect/sdk/domain/token/personal_name_token.rb +9 -6
- data/lib/ingenico/connect/sdk/domain/token/token_card.rb +29 -26
- data/lib/ingenico/connect/sdk/domain/token/token_card_data.rb +34 -31
- data/lib/ingenico/connect/sdk/domain/token/token_e_wallet.rb +29 -26
- data/lib/ingenico/connect/sdk/domain/token/token_e_wallet_data.rb +21 -18
- data/lib/ingenico/connect/sdk/domain/token/token_non_sepa_direct_debit.rb +29 -26
- data/lib/ingenico/connect/sdk/domain/token/token_non_sepa_direct_debit_payment_product705_specific_data.rb +28 -25
- data/lib/ingenico/connect/sdk/domain/token/token_non_sepa_direct_debit_payment_product730_specific_data.rb +22 -19
- data/lib/ingenico/connect/sdk/domain/token/token_response.rb +61 -58
- data/lib/ingenico/connect/sdk/domain/token/token_sepa_direct_debit.rb +29 -26
- data/lib/ingenico/connect/sdk/domain/token/token_sepa_direct_debit_without_creditor.rb +29 -26
- data/lib/ingenico/connect/sdk/domain/token/update_token_request.rb +49 -46
- data/lib/ingenico/connect/sdk/domain/token.rb +5 -0
- data/lib/ingenico/connect/sdk/domain.rb +1 -0
- data/lib/ingenico/connect/sdk/endpoint_configuration.rb +120 -116
- data/lib/ingenico/connect/sdk/exceptions.rb +1 -8
- data/lib/ingenico/connect/sdk/factory.rb +193 -182
- data/lib/ingenico/connect/sdk/global_collect_exception.rb +15 -10
- data/lib/ingenico/connect/sdk/idempotence_exception.rb +23 -19
- data/lib/ingenico/connect/sdk/logging/communicator_logger.rb +20 -16
- data/lib/ingenico/connect/sdk/logging/log_message_builder.rb +73 -67
- data/lib/ingenico/connect/sdk/logging/logging_capable.rb +12 -12
- data/lib/ingenico/connect/sdk/logging/logging_util.rb +304 -297
- data/lib/ingenico/connect/sdk/logging/obfuscation/body_obfuscator.rb +83 -79
- data/lib/ingenico/connect/sdk/logging/obfuscation/header_obfuscator.rb +42 -38
- data/lib/ingenico/connect/sdk/logging/obfuscation/obfuscation_capable.rb +17 -12
- data/lib/ingenico/connect/sdk/logging/obfuscation/obfuscation_rule.rb +40 -36
- data/lib/ingenico/connect/sdk/logging/obfuscation.rb +1 -0
- data/lib/ingenico/connect/sdk/logging/request_log_message_builder.rb +42 -34
- data/lib/ingenico/connect/sdk/logging/response_log_message_builder.rb +35 -29
- data/lib/ingenico/connect/sdk/logging/ruby_communicator_logger.rb +51 -47
- data/lib/ingenico/connect/sdk/logging/stdout_communicator_logger.rb +26 -22
- data/lib/ingenico/connect/sdk/logging.rb +1 -14
- data/lib/ingenico/connect/sdk/marshaller.rb +22 -19
- data/lib/ingenico/connect/sdk/marshaller_syntax_exception.rb +7 -4
- data/lib/ingenico/connect/sdk/merchant/captures/captures_client.rb +75 -72
- data/lib/ingenico/connect/sdk/merchant/captures.rb +5 -0
- data/lib/ingenico/connect/sdk/merchant/disputes/disputes_client.rb +134 -131
- data/lib/ingenico/connect/sdk/merchant/disputes/upload_file_request.rb +17 -14
- data/lib/ingenico/connect/sdk/merchant/disputes.rb +5 -0
- data/lib/ingenico/connect/sdk/merchant/files/files_client.rb +43 -40
- data/lib/ingenico/connect/sdk/merchant/files.rb +5 -0
- data/lib/ingenico/connect/sdk/merchant/hostedcheckouts/hostedcheckouts_client.rb +98 -95
- data/lib/ingenico/connect/sdk/merchant/hostedcheckouts.rb +5 -0
- data/lib/ingenico/connect/sdk/merchant/hostedmandatemanagements/hostedmandatemanagements_client.rb +70 -67
- data/lib/ingenico/connect/sdk/merchant/hostedmandatemanagements.rb +5 -0
- data/lib/ingenico/connect/sdk/merchant/installments/installments_client.rb +41 -38
- data/lib/ingenico/connect/sdk/merchant/installments.rb +5 -0
- data/lib/ingenico/connect/sdk/merchant/mandates/mandates_client.rb +191 -188
- data/lib/ingenico/connect/sdk/merchant/mandates.rb +5 -0
- data/lib/ingenico/connect/sdk/merchant/merchant_client.rb +110 -107
- data/lib/ingenico/connect/sdk/merchant/payments/find_payments_params.rb +35 -32
- data/lib/ingenico/connect/sdk/merchant/payments/payments_client.rb +519 -516
- data/lib/ingenico/connect/sdk/merchant/payments.rb +5 -0
- data/lib/ingenico/connect/sdk/merchant/payouts/find_payouts_params.rb +26 -23
- data/lib/ingenico/connect/sdk/merchant/payouts/payouts_client.rb +186 -183
- data/lib/ingenico/connect/sdk/merchant/payouts.rb +5 -0
- data/lib/ingenico/connect/sdk/merchant/productgroups/find_productgroups_params.rb +49 -46
- data/lib/ingenico/connect/sdk/merchant/productgroups/get_productgroup_params.rb +49 -46
- data/lib/ingenico/connect/sdk/merchant/productgroups/productgroups_client.rb +101 -98
- data/lib/ingenico/connect/sdk/merchant/productgroups.rb +5 -0
- data/lib/ingenico/connect/sdk/merchant/products/directory_params.rb +20 -17
- data/lib/ingenico/connect/sdk/merchant/products/find_products_params.rb +49 -46
- data/lib/ingenico/connect/sdk/merchant/products/get_product_params.rb +44 -41
- data/lib/ingenico/connect/sdk/merchant/products/networks_params.rb +26 -23
- data/lib/ingenico/connect/sdk/merchant/products/products_client.rb +223 -220
- data/lib/ingenico/connect/sdk/merchant/products.rb +5 -0
- data/lib/ingenico/connect/sdk/merchant/refunds/find_refunds_params.rb +35 -32
- data/lib/ingenico/connect/sdk/merchant/refunds/refunds_client.rb +157 -154
- data/lib/ingenico/connect/sdk/merchant/refunds.rb +5 -0
- data/lib/ingenico/connect/sdk/merchant/riskassessments/riskassessments_client.rb +68 -65
- data/lib/ingenico/connect/sdk/merchant/riskassessments.rb +5 -0
- data/lib/ingenico/connect/sdk/merchant/services/convert_amount_params.rb +23 -20
- data/lib/ingenico/connect/sdk/merchant/services/privacypolicy_params.rb +20 -17
- data/lib/ingenico/connect/sdk/merchant/services/services_client.rb +145 -142
- data/lib/ingenico/connect/sdk/merchant/services.rb +5 -0
- data/lib/ingenico/connect/sdk/merchant/sessions/sessions_client.rb +41 -38
- data/lib/ingenico/connect/sdk/merchant/sessions.rb +5 -0
- data/lib/ingenico/connect/sdk/merchant/tokens/delete_token_params.rb +17 -14
- data/lib/ingenico/connect/sdk/merchant/tokens/tokens_client.rb +159 -156
- data/lib/ingenico/connect/sdk/merchant/tokens.rb +5 -0
- data/lib/ingenico/connect/sdk/merchant.rb +5 -0
- data/lib/ingenico/connect/sdk/meta_data_provider.rb +151 -146
- data/lib/ingenico/connect/sdk/multipart_form_data_object.rb +36 -33
- data/lib/ingenico/connect/sdk/multipart_form_data_request.rb +10 -6
- data/lib/ingenico/connect/sdk/not_found_exception.rb +14 -11
- data/lib/ingenico/connect/sdk/param_request.rb +11 -8
- data/lib/ingenico/connect/sdk/pooled_connection.rb +20 -15
- data/lib/ingenico/connect/sdk/proxy_configuration.rb +63 -61
- data/lib/ingenico/connect/sdk/reference_exception.rb +14 -9
- data/lib/ingenico/connect/sdk/request_header.rb +52 -44
- data/lib/ingenico/connect/sdk/request_param.rb +22 -19
- data/lib/ingenico/connect/sdk/response_exception.rb +46 -41
- data/lib/ingenico/connect/sdk/response_header.rb +63 -55
- data/lib/ingenico/connect/sdk/session.rb +34 -31
- data/lib/ingenico/connect/sdk/uploadable_file.rb +23 -20
- data/lib/ingenico/connect/sdk/validation_exception.rb +14 -9
- data/lib/ingenico/connect/sdk/webhooks/api_version_mismatch_exception.rb +19 -15
- data/lib/ingenico/connect/sdk/webhooks/in_memory_secret_key_store.rb +49 -44
- data/lib/ingenico/connect/sdk/webhooks/secret_key_not_available_exception.rb +18 -12
- data/lib/ingenico/connect/sdk/webhooks/secret_key_store.rb +15 -11
- data/lib/ingenico/connect/sdk/webhooks/signature_validation_exception.rb +17 -14
- data/lib/ingenico/connect/sdk/webhooks/signature_validator.rb +83 -0
- data/lib/ingenico/connect/sdk/webhooks/webhooks.rb +20 -15
- data/lib/ingenico/connect/sdk/webhooks/webhooks_event.rb +60 -50
- data/lib/ingenico/connect/sdk/webhooks/webhooks_helper.rb +43 -94
- data/lib/ingenico/connect/sdk/webhooks/webhooks_helper_builder.rb +22 -17
- data/lib/ingenico/connect/sdk/webhooks.rb +1 -11
- data/lib/ingenico/connect/sdk.rb +1 -30
- data/spec/integration/connection_pooling_spec.rb +1 -1
- data/spec/lib/defaultimpl/default_connection_logger_spec.rb +17 -17
- data/spec/lib/webhooks/webhooks_spec.rb +2 -1
- metadata +40 -2
@@ -1,511 +1,515 @@
|
|
1
1
|
require 'uri'
|
2
|
+
require 'ingenico/connect/sdk/communication_exception'
|
3
|
+
require 'ingenico/connect/sdk/logging/logging_capable'
|
4
|
+
require 'ingenico/connect/sdk/logging/obfuscation/obfuscation_capable'
|
5
|
+
require 'ingenico/connect/sdk/not_found_exception'
|
6
|
+
require 'ingenico/connect/sdk/pooled_connection'
|
7
|
+
require 'ingenico/connect/sdk/multipart_form_data_object'
|
8
|
+
require 'ingenico/connect/sdk/multipart_form_data_request'
|
9
|
+
require 'ingenico/connect/sdk/request_header'
|
10
|
+
require 'ingenico/connect/sdk/response_exception'
|
11
|
+
require 'ingenico/connect/sdk/response_header'
|
12
|
+
|
13
|
+
module Ingenico
|
14
|
+
module Connect
|
15
|
+
module SDK
|
16
|
+
# Class responsible for facilitating communication with the Ingenico ePayments platform.
|
17
|
+
# It combines the following classes to provide communication functionality:
|
18
|
+
#
|
19
|
+
# session:: {Ingenico::Connect::SDK::Session} that stores data for network communication and facilitates network communication
|
20
|
+
# marshaller:: {Ingenico::Connect::SDK::Marshaller} that is used to marshal and unmarshal data to and from JSON format
|
21
|
+
#
|
22
|
+
# @attr_reader [Ingenico::Connect::SDK::Marshaller] marshaller A Marshaller instance used by the communicator for serializing/deserializing to/from JSON
|
23
|
+
#
|
24
|
+
class Communicator
|
25
|
+
include Logging::LoggingCapable
|
26
|
+
include Logging::Obfuscation::ObfuscationCapable
|
27
|
+
|
28
|
+
# Creates a new Communicator based on a session and marshaller.
|
29
|
+
#
|
30
|
+
# @param session [Ingenico::Connect::SDK::Session] session that stores data for network communication and facilitates network communication
|
31
|
+
# @param marshaller [Ingenico::Connect::SDK::Marshaller] used to marshal and unmarshal data to and from JSON format
|
32
|
+
#
|
33
|
+
def initialize(session, marshaller)
|
34
|
+
raise ArgumentError('session is required') if session.nil?
|
35
|
+
raise ArgumentError('marshaller is required') if marshaller.nil?
|
36
|
+
|
37
|
+
@session = session
|
38
|
+
@marshaller = marshaller
|
39
|
+
end
|
2
40
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
# @param request_headers [Array<Ingenico::Connect::SDK::RequestHeader>] optional array of request headers
|
33
|
-
# @param request_parameters [Ingenico::Connect::SDK::ParamRequest] optional request parameters
|
34
|
-
# @param response_type [Type] the response type.
|
35
|
-
# @param context [Ingenico::Connect::SDK::CallContext] optional call context.
|
36
|
-
# @return the response of the GET request as the given response type
|
37
|
-
# @raise [Ingenico::Connect::SDK::ResponseException] if the request could not be fulfilled successfully.
|
38
|
-
# This occurs for example if the request is not authenticated correctly
|
39
|
-
# @raise [Ingenico::Connect::SDK::NotFoundException] if the requested resource is not found
|
40
|
-
# @raise [Ingenico::Connect::SDK::CommunicationException] if there is an error in communicating with the Ingenico ePayments platform.
|
41
|
-
# This occurs for example if a timeout occurs.
|
42
|
-
def get(relative_path, request_headers, request_parameters, response_type, context)
|
43
|
-
connection = @session.connection
|
44
|
-
request_parameter_list = request_parameters &&
|
45
|
-
request_parameters.to_request_parameters
|
46
|
-
uri = to_absolute_uri(relative_path, request_parameter_list)
|
47
|
-
|
48
|
-
request_headers = [] if request_headers.nil?
|
49
|
-
add_generic_headers('GET', uri, request_headers, context)
|
50
|
-
|
51
|
-
response_status_code, response_headers, response_body = nil
|
52
|
-
connection.get(uri, request_headers) do |status_code, headers, content|
|
53
|
-
response_status_code = status_code
|
54
|
-
response_headers = headers
|
55
|
-
response_body = content.read.force_encoding('UTF-8')
|
56
|
-
end
|
57
|
-
process_response(response_body, response_status_code, response_headers, response_type, relative_path, context)
|
58
|
-
end
|
41
|
+
# Performs a GET request to the Ingenico ePayments platform and returns the response as the given response type.
|
42
|
+
#
|
43
|
+
# @param relative_path [String] path relative to the session's API endpoint
|
44
|
+
# @param request_headers [Array<Ingenico::Connect::SDK::RequestHeader>] optional array of request headers
|
45
|
+
# @param request_parameters [Ingenico::Connect::SDK::ParamRequest] optional request parameters
|
46
|
+
# @param response_type [Type] the response type.
|
47
|
+
# @param context [Ingenico::Connect::SDK::CallContext] optional call context.
|
48
|
+
# @return the response of the GET request as the given response type
|
49
|
+
# @raise [Ingenico::Connect::SDK::ResponseException] if the request could not be fulfilled successfully.
|
50
|
+
# This occurs for example if the request is not authenticated correctly
|
51
|
+
# @raise [Ingenico::Connect::SDK::NotFoundException] if the requested resource is not found
|
52
|
+
# @raise [Ingenico::Connect::SDK::CommunicationException] if there is an error in communicating with the Ingenico ePayments platform.
|
53
|
+
# This occurs for example if a timeout occurs.
|
54
|
+
def get(relative_path, request_headers, request_parameters, response_type, context)
|
55
|
+
connection = @session.connection
|
56
|
+
request_parameter_list = request_parameters && request_parameters.to_request_parameters
|
57
|
+
uri = to_absolute_uri(relative_path, request_parameter_list)
|
58
|
+
|
59
|
+
request_headers = [] if request_headers.nil?
|
60
|
+
add_generic_headers('GET', uri, request_headers, context)
|
61
|
+
|
62
|
+
response_status_code, response_headers, response_body = nil
|
63
|
+
connection.get(uri, request_headers) do |status_code, headers, content|
|
64
|
+
response_status_code = status_code
|
65
|
+
response_headers = headers
|
66
|
+
response_body = content.read.force_encoding('UTF-8')
|
67
|
+
end
|
68
|
+
process_response(response_body, response_status_code, response_headers, response_type, relative_path, context)
|
69
|
+
end
|
59
70
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
71
|
+
# Performs a GET request to the Ingenico ePayments platform and yields the response as the headers and body.
|
72
|
+
#
|
73
|
+
# @param relative_path [String] Path relative to the session's API endpoint
|
74
|
+
# @param request_headers [Array<Ingenico::Connect::SDK::RequestHeader>] Optional array of request headers
|
75
|
+
# @param request_parameters [Ingenico::Connect::SDK::ParamRequest] Optional request parameters
|
76
|
+
# @param context [Ingenico::Connect::SDK::CallContext] Optional call context.
|
77
|
+
# @yield [Array<Ingenico::Connect::SDK::ResponseHeader>, IO] The response headers and body.
|
78
|
+
# @raise [Ingenico::Connect::SDK::ResponseException] if the request could not be fulfilled successfully.
|
79
|
+
# This occurs for example if the request is not authenticated correctly
|
80
|
+
# @raise [Ingenico::Connect::SDK::NotFoundException] if the requested resource is not found
|
81
|
+
# @raise [Ingenico::Connect::SDK::CommunicationException] if there is an error in communicating with the Ingenico ePayments platform.
|
82
|
+
# This occurs for example if a timeout occurs.
|
83
|
+
def get_with_binary_response(relative_path, request_headers, request_parameters, context)
|
84
|
+
connection = @session.connection
|
85
|
+
request_parameter_list = request_parameters && request_parameters.to_request_parameters
|
86
|
+
uri = to_absolute_uri(relative_path, request_parameter_list)
|
87
|
+
|
88
|
+
request_headers = [] if request_headers.nil?
|
89
|
+
add_generic_headers('GET', uri, request_headers, context)
|
90
|
+
|
91
|
+
response_status_code, response_headers, response_body = nil
|
92
|
+
connection.get(uri, request_headers) do |status_code, headers, content|
|
93
|
+
response_status_code = status_code
|
94
|
+
response_headers = headers
|
95
|
+
response_body = process_binary_response(status_code, content, headers, context) do |h, c|
|
96
|
+
yield h, c
|
97
|
+
end
|
98
|
+
end
|
99
|
+
throw_exception_if_necessary(response_body, response_status_code, response_headers, relative_path)
|
87
100
|
end
|
88
|
-
end
|
89
|
-
throw_exception_if_necessary(response_body, response_status_code, response_headers, relative_path)
|
90
|
-
end
|
91
101
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
end
|
102
|
+
# Performs a DELETE request to the Ingenico ePayments platform and returns the response as the given response type.
|
103
|
+
#
|
104
|
+
# @param relative_path [String] Path relative to the session's API endpoint
|
105
|
+
# @param request_headers [Array<Ingenico::Connect::SDK::RequestHeader>] Optional array of request headers
|
106
|
+
# @param request_parameters [Ingenico::Connect::SDK::ParamRequest] Optional request parameters
|
107
|
+
# @param response_type [Type] The response type.
|
108
|
+
# @param context [Ingenico::Connect::SDK::CallContext] Optional call context.
|
109
|
+
# @return The response of the DELETE request as the given response type
|
110
|
+
# @raise [Ingenico::Connect::SDK::ResponseException] if the request could not be fulfilled successfully.
|
111
|
+
# This occurs for example if the request is not authenticated correctly
|
112
|
+
# @raise [Ingenico::Connect::SDK::NotFoundException] if the requested resource is not found
|
113
|
+
# @raise [Ingenico::Connect::SDK::CommunicationException] if there is an error in communicating with the Ingenico ePayments platform.
|
114
|
+
# This occurs for example if a timeout occurs.
|
115
|
+
def delete(relative_path, request_headers, request_parameters, response_type, context)
|
116
|
+
connection = @session.connection
|
117
|
+
request_parameter_list = request_parameters && request_parameters.to_request_parameters
|
118
|
+
uri = to_absolute_uri(relative_path, request_parameter_list)
|
119
|
+
request_headers = [] if request_headers.nil?
|
120
|
+
add_generic_headers('DELETE', uri, request_headers, context)
|
121
|
+
|
122
|
+
response_status_code, response_headers, response_body = nil
|
123
|
+
connection.delete(uri, request_headers) do |status_code, headers, content|
|
124
|
+
response_status_code = status_code
|
125
|
+
response_headers = headers
|
126
|
+
response_body = content.read.force_encoding('UTF-8')
|
127
|
+
end
|
128
|
+
process_response(response_body, response_status_code, response_headers, response_type, relative_path, context)
|
129
|
+
end
|
121
130
|
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
131
|
+
# Performs a DELETE request to the Ingenico ePayments platform and yields the response as the headers and body.
|
132
|
+
#
|
133
|
+
# @param relative_path [String] Path relative to the session's API endpoint
|
134
|
+
# @param request_headers [Array<Ingenico::Connect::SDK::RequestHeader>] Optional array of request headers
|
135
|
+
# @param request_parameters [Ingenico::Connect::SDK::ParamRequest] Optional request parameters
|
136
|
+
# @param context [Ingenico::Connect::SDK::CallContext] Optional call context.
|
137
|
+
# @yield [Array<Ingenico::Connect::SDK::ResponseHeader>, IO] The response headers and body.
|
138
|
+
# @raise [Ingenico::Connect::SDK::ResponseException] if the request could not be fulfilled successfully.
|
139
|
+
# This occurs for example if the request is not authenticated correctly
|
140
|
+
# @raise [Ingenico::Connect::SDK::NotFoundException] if the requested resource is not found
|
141
|
+
# @raise [Ingenico::Connect::SDK::CommunicationException] if there is an error in communicating with the Ingenico ePayments platform.
|
142
|
+
# This occurs for example if a timeout occurs.
|
143
|
+
def delete_with_binary_response(relative_path, request_headers, request_parameters, context)
|
144
|
+
connection = @session.connection
|
145
|
+
request_parameter_list = request_parameters && request_parameters.to_request_parameters
|
146
|
+
uri = to_absolute_uri(relative_path, request_parameter_list)
|
147
|
+
request_headers = [] if request_headers.nil?
|
148
|
+
add_generic_headers('DELETE', uri, request_headers, context)
|
149
|
+
|
150
|
+
response_status_code, response_headers, response_body = nil
|
151
|
+
connection.delete(uri, request_headers) do |status_code, headers, content|
|
152
|
+
response_status_code = status_code
|
153
|
+
response_headers = headers
|
154
|
+
response_body = process_binary_response(status_code, content, headers, context) do |h, c|
|
155
|
+
yield h, c
|
156
|
+
end
|
157
|
+
end
|
158
|
+
throw_exception_if_necessary(response_body, response_status_code, response_headers, relative_path)
|
148
159
|
end
|
149
|
-
end
|
150
|
-
throw_exception_if_necessary(response_body, response_status_code, response_headers, relative_path)
|
151
|
-
end
|
152
160
|
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
end
|
161
|
+
# Performs a POST request to the Ingenico ePayments platform and returns the response as the given response type.
|
162
|
+
#
|
163
|
+
# @param relative_path [String] Path relative to the session's API endpoint
|
164
|
+
# @param request_headers [Array<Ingenico::Connect::SDK::RequestHeader>] Optional array of request headers
|
165
|
+
# @param request_parameters [Ingenico::Connect::SDK::ParamRequest] Optional request parameters
|
166
|
+
# @param request_body [Ingenico::Connect::SDK::DataObject, Ingenico::Connect::SDK::MultipartFormDataObject, Ingenico::Connect::SDK::MultipartFormDataRequest]
|
167
|
+
# The optional request body
|
168
|
+
# @param response_type [Type] The response type.
|
169
|
+
# @param context [Ingenico::Connect::SDK::CallContext] Optional call context.
|
170
|
+
# @return The response of the POST request as the given response type
|
171
|
+
# @raise [Ingenico::Connect::SDK::ResponseException] if the request could not be fulfilled successfully.
|
172
|
+
# This occurs for example if the request is not authenticated correctly
|
173
|
+
# @raise [Ingenico::Connect::SDK::NotFoundException] if the requested resource is not found
|
174
|
+
# @raise [Ingenico::Connect::SDK::CommunicationException] if there is an error in communicating with the Ingenico ePayments platform.
|
175
|
+
# This occurs for example if a timeout occurs.
|
176
|
+
def post(relative_path, request_headers, request_parameters, request_body, response_type, context)
|
177
|
+
connection = @session.connection
|
178
|
+
request_parameter_list = request_parameters && request_parameters.to_request_parameters
|
179
|
+
uri = to_absolute_uri(relative_path, request_parameter_list)
|
180
|
+
request_headers = [] if request_headers.nil?
|
181
|
+
|
182
|
+
body = nil
|
183
|
+
if request_body.is_a? MultipartFormDataObject
|
184
|
+
request_headers.push(RequestHeader.new('Content-Type', request_body.content_type))
|
185
|
+
body = request_body
|
186
|
+
elsif request_body.is_a? MultipartFormDataRequest
|
187
|
+
multipart = request_body.to_multipart_form_data_object
|
188
|
+
request_headers.push(RequestHeader.new('Content-Type', multipart.content_type))
|
189
|
+
body = multipart
|
190
|
+
elsif !request_body.nil?
|
191
|
+
request_headers.push(RequestHeader.new('Content-Type', 'application/json'))
|
192
|
+
body = @marshaller.marshal(request_body)
|
193
|
+
else
|
194
|
+
# Set the content-type, even though there is no body, to prevent the httpClient from
|
195
|
+
# adding a content-type header after authentication has been generated.
|
196
|
+
request_headers.push(RequestHeader.new('Content-Type', 'text/plain'))
|
197
|
+
end
|
191
198
|
|
192
|
-
|
199
|
+
add_generic_headers('POST', uri, request_headers, context)
|
193
200
|
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
end
|
202
|
-
|
203
|
-
# Performs a POST request to the Ingenico ePayments platform and yields the response as the headers and body.
|
204
|
-
#
|
205
|
-
# @param relative_path [String] Path relative to the session's API endpoint
|
206
|
-
# @param request_headers [Array<Ingenico::Connect::SDK::RequestHeader>] Optional array of request headers
|
207
|
-
# @param request_parameters [Ingenico::Connect::SDK::ParamRequest] Optional request parameters
|
208
|
-
# @param request_body [Ingenico::Connect::SDK::DataObject, Ingenico::Connect::SDK::MultipartFormDataObject, Ingenico::Connect::SDK::MultipartFormDataRequest]
|
209
|
-
# The optional request body
|
210
|
-
# @param context [Ingenico::Connect::SDK::CallContext] Optional call context.
|
211
|
-
# @yield [Array<Ingenico::Connect::SDK::ResponseHeader>, IO] The response headers and body.
|
212
|
-
# @raise [Ingenico::Connect::SDK::ResponseException] if the request could not be fulfilled successfully.
|
213
|
-
# This occurs for example if the request is not authenticated correctly
|
214
|
-
# @raise [Ingenico::Connect::SDK::NotFoundException] if the requested resource is not found
|
215
|
-
# @raise [Ingenico::Connect::SDK::CommunicationException] if there is an error in communicating with the Ingenico ePayments platform.
|
216
|
-
# This occurs for example if a timeout occurs.
|
217
|
-
def post_with_binary_response(relative_path, request_headers, request_parameters, request_body, context)
|
218
|
-
connection = @session.connection
|
219
|
-
request_parameter_list = request_parameters &&
|
220
|
-
request_parameters.to_request_parameters
|
221
|
-
uri = to_absolute_uri(relative_path, request_parameter_list)
|
222
|
-
request_headers = [] if request_headers.nil?
|
223
|
-
|
224
|
-
body = nil
|
225
|
-
if request_body.is_a? MultipartFormDataObject
|
226
|
-
request_headers.push(RequestHeader.new('Content-Type', request_body.content_type))
|
227
|
-
body = request_body
|
228
|
-
elsif request_body.is_a? MultipartFormDataRequest
|
229
|
-
multipart = request_body.to_multipart_form_data_object
|
230
|
-
request_headers.push(RequestHeader.new('Content-Type', multipart.content_type))
|
231
|
-
body = multipart
|
232
|
-
elsif !request_body.nil?
|
233
|
-
request_headers.push(RequestHeader.new('Content-Type', 'application/json'))
|
234
|
-
body = @marshaller.marshal(request_body)
|
235
|
-
else
|
236
|
-
# Set the content-type, even though there is no body, to prevent the httpClient from
|
237
|
-
# adding a content-type header after authentication has been generated.
|
238
|
-
request_headers.push(RequestHeader.new('Content-Type', 'text/plain'))
|
239
|
-
end
|
240
|
-
add_generic_headers('POST', uri, request_headers, context)
|
241
|
-
|
242
|
-
response_status_code, response_headers, response_body = nil
|
243
|
-
connection.post(uri, request_headers, body) do |status_code, headers, content|
|
244
|
-
response_status_code = status_code
|
245
|
-
response_headers = headers
|
246
|
-
response_body = process_binary_response(status_code, content, headers, context) do |h, c|
|
247
|
-
yield h, c
|
201
|
+
response_status_code, response_headers, response_body = nil
|
202
|
+
connection.post(uri, request_headers, body) do |status_code, headers, content|
|
203
|
+
response_status_code = status_code
|
204
|
+
response_headers = headers
|
205
|
+
response_body = content.read.force_encoding('UTF-8')
|
206
|
+
end
|
207
|
+
process_response(response_body, response_status_code, response_headers, response_type, relative_path, context)
|
248
208
|
end
|
249
|
-
end
|
250
|
-
throw_exception_if_necessary(response_body, response_status_code, response_headers, relative_path)
|
251
|
-
end
|
252
209
|
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
210
|
+
# Performs a POST request to the Ingenico ePayments platform and yields the response as the headers and body.
|
211
|
+
#
|
212
|
+
# @param relative_path [String] Path relative to the session's API endpoint
|
213
|
+
# @param request_headers [Array<Ingenico::Connect::SDK::RequestHeader>] Optional array of request headers
|
214
|
+
# @param request_parameters [Ingenico::Connect::SDK::ParamRequest] Optional request parameters
|
215
|
+
# @param request_body [Ingenico::Connect::SDK::DataObject, Ingenico::Connect::SDK::MultipartFormDataObject, Ingenico::Connect::SDK::MultipartFormDataRequest]
|
216
|
+
# The optional request body
|
217
|
+
# @param context [Ingenico::Connect::SDK::CallContext] Optional call context.
|
218
|
+
# @yield [Array<Ingenico::Connect::SDK::ResponseHeader>, IO] The response headers and body.
|
219
|
+
# @raise [Ingenico::Connect::SDK::ResponseException] if the request could not be fulfilled successfully.
|
220
|
+
# This occurs for example if the request is not authenticated correctly
|
221
|
+
# @raise [Ingenico::Connect::SDK::NotFoundException] if the requested resource is not found
|
222
|
+
# @raise [Ingenico::Connect::SDK::CommunicationException] if there is an error in communicating with the Ingenico ePayments platform.
|
223
|
+
# This occurs for example if a timeout occurs.
|
224
|
+
def post_with_binary_response(relative_path, request_headers, request_parameters, request_body, context)
|
225
|
+
connection = @session.connection
|
226
|
+
request_parameter_list = request_parameters && request_parameters.to_request_parameters
|
227
|
+
uri = to_absolute_uri(relative_path, request_parameter_list)
|
228
|
+
request_headers = [] if request_headers.nil?
|
229
|
+
|
230
|
+
body = nil
|
231
|
+
if request_body.is_a? MultipartFormDataObject
|
232
|
+
request_headers.push(RequestHeader.new('Content-Type', request_body.content_type))
|
233
|
+
body = request_body
|
234
|
+
elsif request_body.is_a? MultipartFormDataRequest
|
235
|
+
multipart = request_body.to_multipart_form_data_object
|
236
|
+
request_headers.push(RequestHeader.new('Content-Type', multipart.content_type))
|
237
|
+
body = multipart
|
238
|
+
elsif !request_body.nil?
|
239
|
+
request_headers.push(RequestHeader.new('Content-Type', 'application/json'))
|
240
|
+
body = @marshaller.marshal(request_body)
|
241
|
+
else
|
242
|
+
# Set the content-type, even though there is no body, to prevent the httpClient from
|
243
|
+
# adding a content-type header after authentication has been generated.
|
244
|
+
request_headers.push(RequestHeader.new('Content-Type', 'text/plain'))
|
245
|
+
end
|
246
|
+
add_generic_headers('POST', uri, request_headers, context)
|
247
|
+
|
248
|
+
response_status_code, response_headers, response_body = nil
|
249
|
+
connection.post(uri, request_headers, body) do |status_code, headers, content|
|
250
|
+
response_status_code = status_code
|
251
|
+
response_headers = headers
|
252
|
+
response_body = process_binary_response(status_code, content, headers, context) do |h, c|
|
253
|
+
yield h, c
|
254
|
+
end
|
255
|
+
end
|
256
|
+
throw_exception_if_necessary(response_body, response_status_code, response_headers, relative_path)
|
257
|
+
end
|
292
258
|
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
259
|
+
# Performs a PUT request to the Ingenico ePayments platform and returns the response as the given response type.
|
260
|
+
#
|
261
|
+
# @param relative_path [String] Path relative to the session's API endpoint
|
262
|
+
# @param request_headers [Array<Ingenico::Connect::SDK::RequestHeader>] Optional array of request headers
|
263
|
+
# @param request_parameters [Ingenico::Connect::SDK::ParamRequest] Optional request parameters
|
264
|
+
# @param request_body [Ingenico::Connect::SDK::DataObject, Ingenico::Connect::SDK::MultipartFormDataObject, Ingenico::Connect::SDK::MultipartFormDataRequest]
|
265
|
+
# The optional request body
|
266
|
+
# @param response_type [Type] The response type.
|
267
|
+
# @param context [Ingenico::Connect::SDK::CallContext] Optional call context.
|
268
|
+
# @return The response of the PUT request as the given response type
|
269
|
+
# @raise [Ingenico::Connect::SDK::ResponseException] if the request could not be fulfilled successfully.
|
270
|
+
# This occurs for example if the request is not authenticated correctly
|
271
|
+
# @raise [Ingenico::Connect::SDK::NotFoundException] if the requested resource is not found
|
272
|
+
# @raise [Ingenico::Connect::SDK::CommunicationException] if there is an error in communicating with the Ingenico ePayments platform.
|
273
|
+
# This occurs for example if a timeout occurs.
|
274
|
+
def put(relative_path, request_headers, request_parameters, request_body, response_type, context)
|
275
|
+
connection = @session.connection
|
276
|
+
request_parameter_list = request_parameters && request_parameters.to_request_parameters
|
277
|
+
uri = to_absolute_uri(relative_path, request_parameter_list)
|
278
|
+
request_headers = [] if request_headers.nil?
|
279
|
+
|
280
|
+
body = nil
|
281
|
+
if request_body.is_a? MultipartFormDataObject
|
282
|
+
request_headers.push(RequestHeader.new('Content-Type', request_body.content_type))
|
283
|
+
body = request_body
|
284
|
+
elsif request_body.is_a? MultipartFormDataRequest
|
285
|
+
multipart = request_body.to_multipart_form_data_object
|
286
|
+
request_headers.push(RequestHeader.new('Content-Type', multipart.content_type))
|
287
|
+
body = multipart
|
288
|
+
elsif !request_body.nil?
|
289
|
+
request_headers.push(RequestHeader.new('Content-Type', 'application/json'))
|
290
|
+
body = @marshaller.marshal(request_body)
|
291
|
+
else
|
292
|
+
# Set the content-type, even though there is no body, to prevent the httpClient from
|
293
|
+
# adding a content-type header after authentication has been generated.
|
294
|
+
request_headers.push(RequestHeader.new('Content-Type', 'text/plain'))
|
295
|
+
end
|
296
|
+
add_generic_headers('PUT', uri, request_headers, context)
|
301
297
|
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
# @param context [Ingenico::Connect::SDK::CallContext] Optional call context.
|
310
|
-
# @yield [Array<Ingenico::Connect::SDK::ResponseHeader>, IO] The response headers and body.
|
311
|
-
# @raise [Ingenico::Connect::SDK::ResponseException] if the request could not be fulfilled successfully.
|
312
|
-
# This occurs for example if the request is not authenticated correctly
|
313
|
-
# @raise [Ingenico::Connect::SDK::NotFoundException] if the requested resource is not found
|
314
|
-
# @raise [Ingenico::Connect::SDK::CommunicationException] if there is an error in communicating with the Ingenico ePayments platform.
|
315
|
-
# This occurs for example if a timeout occurs.
|
316
|
-
def put_with_binary_response(relative_path, request_headers, request_parameters, request_body, context)
|
317
|
-
connection = @session.connection
|
318
|
-
request_parameter_list = request_parameters &&
|
319
|
-
request_parameters.to_request_parameters
|
320
|
-
uri = to_absolute_uri(relative_path, request_parameter_list)
|
321
|
-
request_headers = [] if request_headers.nil?
|
322
|
-
|
323
|
-
body = nil
|
324
|
-
if request_body.is_a? MultipartFormDataObject
|
325
|
-
request_headers.push(RequestHeader.new('Content-Type', request_body.content_type))
|
326
|
-
body = request_body
|
327
|
-
elsif request_body.is_a? MultipartFormDataRequest
|
328
|
-
multipart = request_body.to_multipart_form_data_object
|
329
|
-
request_headers.push(RequestHeader.new('Content-Type', multipart.content_type))
|
330
|
-
body = multipart
|
331
|
-
elsif !request_body.nil?
|
332
|
-
request_headers.push(RequestHeader.new('Content-Type', 'application/json'))
|
333
|
-
body = @marshaller.marshal(request_body)
|
334
|
-
else
|
335
|
-
# Set the content-type, even though there is no body, to prevent the httpClient from
|
336
|
-
# adding a content-type header after authentication has been generated.
|
337
|
-
request_headers.push(RequestHeader.new('Content-Type', 'text/plain'))
|
338
|
-
end
|
339
|
-
add_generic_headers('PUT', uri, request_headers, context)
|
340
|
-
|
341
|
-
response_status_code, response_headers, response_body = nil
|
342
|
-
connection.put(uri, request_headers, body) do |status_code, headers, content|
|
343
|
-
response_status_code = status_code
|
344
|
-
response_headers = headers
|
345
|
-
response_body = process_binary_response(status_code, content, headers, context) do |h, c|
|
346
|
-
yield h, c
|
298
|
+
response_status_code, response_headers, response_body = nil
|
299
|
+
connection.put(uri, request_headers, body) do |status_code, headers, content|
|
300
|
+
response_status_code = status_code
|
301
|
+
response_headers = headers
|
302
|
+
response_body = content.read.force_encoding('UTF-8')
|
303
|
+
end
|
304
|
+
process_response(response_body, response_status_code, response_headers, response_type, relative_path, context)
|
347
305
|
end
|
348
|
-
end
|
349
|
-
throw_exception_if_necessary(response_body, response_status_code, response_headers, relative_path)
|
350
|
-
end
|
351
306
|
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
307
|
+
# Performs a PUT request to the Ingenico ePayments platform and yields the response as the headers and body.
|
308
|
+
#
|
309
|
+
# @param relative_path [String] Path relative to the session's API endpoint
|
310
|
+
# @param request_headers [Array<Ingenico::Connect::SDK::RequestHeader>] Optional array of request headers
|
311
|
+
# @param request_parameters [Ingenico::Connect::SDK::ParamRequest] Optional request parameters
|
312
|
+
# @param request_body [Ingenico::Connect::SDK::DataObject, Ingenico::Connect::SDK::MultipartFormDataObject, Ingenico::Connect::SDK::MultipartFormDataRequest]
|
313
|
+
# The optional request body
|
314
|
+
# @param context [Ingenico::Connect::SDK::CallContext] Optional call context.
|
315
|
+
# @yield [Array<Ingenico::Connect::SDK::ResponseHeader>, IO] The response headers and body.
|
316
|
+
# @raise [Ingenico::Connect::SDK::ResponseException] if the request could not be fulfilled successfully.
|
317
|
+
# This occurs for example if the request is not authenticated correctly
|
318
|
+
# @raise [Ingenico::Connect::SDK::NotFoundException] if the requested resource is not found
|
319
|
+
# @raise [Ingenico::Connect::SDK::CommunicationException] if there is an error in communicating with the Ingenico ePayments platform.
|
320
|
+
# This occurs for example if a timeout occurs.
|
321
|
+
def put_with_binary_response(relative_path, request_headers, request_parameters, request_body, context)
|
322
|
+
connection = @session.connection
|
323
|
+
request_parameter_list = request_parameters && request_parameters.to_request_parameters
|
324
|
+
uri = to_absolute_uri(relative_path, request_parameter_list)
|
325
|
+
request_headers = [] if request_headers.nil?
|
326
|
+
|
327
|
+
body = nil
|
328
|
+
if request_body.is_a? MultipartFormDataObject
|
329
|
+
request_headers.push(RequestHeader.new('Content-Type', request_body.content_type))
|
330
|
+
body = request_body
|
331
|
+
elsif request_body.is_a? MultipartFormDataRequest
|
332
|
+
multipart = request_body.to_multipart_form_data_object
|
333
|
+
request_headers.push(RequestHeader.new('Content-Type', multipart.content_type))
|
334
|
+
body = multipart
|
335
|
+
elsif !request_body.nil?
|
336
|
+
request_headers.push(RequestHeader.new('Content-Type', 'application/json'))
|
337
|
+
body = @marshaller.marshal(request_body)
|
338
|
+
else
|
339
|
+
# Set the content-type, even though there is no body, to prevent the httpClient from
|
340
|
+
# adding a content-type header after authentication has been generated.
|
341
|
+
request_headers.push(RequestHeader.new('Content-Type', 'text/plain'))
|
342
|
+
end
|
343
|
+
add_generic_headers('PUT', uri, request_headers, context)
|
344
|
+
|
345
|
+
response_status_code, response_headers, response_body = nil
|
346
|
+
connection.put(uri, request_headers, body) do |status_code, headers, content|
|
347
|
+
response_status_code = status_code
|
348
|
+
response_headers = headers
|
349
|
+
response_body = process_binary_response(status_code, content, headers, context) do |h, c|
|
350
|
+
yield h, c
|
351
|
+
end
|
352
|
+
end
|
353
|
+
throw_exception_if_necessary(response_body, response_status_code, response_headers, relative_path)
|
354
|
+
end
|
359
355
|
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
356
|
+
# Closes any connections idle for more than _idle_time_ seconds.
|
357
|
+
# Will not have any effect if the connection is not a pooled connection (an instance of {Ingenico::Connect::SDK::PooledConnection}).
|
358
|
+
def close_idle_connections(idle_time)
|
359
|
+
connection = @session.connection
|
360
|
+
connection.close_idle_connections(idle_time) if connection.is_a? PooledConnection
|
361
|
+
end
|
366
362
|
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
363
|
+
# Closes any connections that have expired.
|
364
|
+
# Will not have any effect if the connection is not a pooled connection (an instance of {Ingenico::Connect::SDK::PooledConnection}).
|
365
|
+
def close_expired_connections
|
366
|
+
connection = @session.connection
|
367
|
+
connection.close_expired_connections if connection.is_a? PooledConnection
|
368
|
+
end
|
373
369
|
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
370
|
+
# Sets the current body obfuscator to use.
|
371
|
+
# @param body_obfuscator [Ingenico::Connect::SDK::Logging::Obfuscation::BodyObfuscator]
|
372
|
+
def set_body_obfuscator(body_obfuscator)
|
373
|
+
connection = @session.connection
|
374
|
+
connection.set_body_obfuscator(body_obfuscator) if connection.is_a? Logging::Obfuscation::ObfuscationCapable
|
375
|
+
end
|
380
376
|
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
@session.connection.enable_logging(communicator_logger)
|
388
|
-
end
|
377
|
+
# Sets the current header obfuscator to use.
|
378
|
+
# @param header_obfuscator [Ingenico::Connect::SDK::Logging::Obfuscation::HeaderObfuscator]
|
379
|
+
def set_header_obfuscator(header_obfuscator)
|
380
|
+
connection = @session.connection
|
381
|
+
connection.set_header_obfuscator(header_obfuscator) if connection.is_a? Logging::Obfuscation::ObfuscationCapable
|
382
|
+
end
|
389
383
|
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
384
|
+
# Enables logging outgoing requests and incoming responses by registering the _communicator_logger_.
|
385
|
+
# Note that only one logger can be registered at a time and calling _enable_logging_
|
386
|
+
# a second time will override the old logger instance with the new one.
|
387
|
+
#
|
388
|
+
# @param communicator_logger [Ingenico::Connect::SDK::Logging::CommunicatorLogger] The communicator logger the requests and responses are logged to
|
389
|
+
def enable_logging(communicator_logger)
|
390
|
+
@session.connection.enable_logging(communicator_logger)
|
391
|
+
end
|
394
392
|
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
@session.connection.close
|
400
|
-
end
|
393
|
+
# Disables logging by unregistering any previous logger that might be registered.
|
394
|
+
def disable_logging
|
395
|
+
@session.connection.disable_logging
|
396
|
+
end
|
401
397
|
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
# The returned URL is a *URI* object.
|
408
|
-
#
|
409
|
-
# @param relative_path [String] The relative path of the URL.
|
410
|
-
# @param request_parameters [Array<Ingenico::Connect::SDK::RequestParam>] A list of request parameters that each have #name and #value
|
411
|
-
# which represent the parameter name and value respectively.
|
412
|
-
def to_absolute_uri(relative_path, request_parameters)
|
413
|
-
api_endpoint = @session.api_endpoint
|
414
|
-
raise RuntimeError('api_endpoint should not contain a path') unless
|
415
|
-
api_endpoint.path.nil? || api_endpoint.path.empty?
|
416
|
-
|
417
|
-
unless api_endpoint.userinfo.nil? && api_endpoint.query.nil? &&
|
418
|
-
api_endpoint.fragment.nil?
|
419
|
-
raise RuntimeError(
|
420
|
-
'api_endpoint should not contain user info, query or fragment'
|
421
|
-
)
|
422
|
-
end
|
423
|
-
absolute_path = relative_path.start_with?('/') ? relative_path : '/' + relative_path
|
424
|
-
uri = URI::HTTP.new(api_endpoint.scheme, nil, api_endpoint.host,
|
425
|
-
api_endpoint.port, nil, absolute_path, nil, nil, nil)
|
426
|
-
unless request_parameters.nil?
|
427
|
-
request_parameters.each do |nvp|
|
428
|
-
parameters = URI.decode_www_form(uri.query || '') << [nvp.name, nvp.value]
|
429
|
-
uri.query = URI.encode_www_form(parameters)
|
398
|
+
# Frees networking resources by closing the underlying network connections.
|
399
|
+
# After calling _close_, any use of the _get_, _delete_, _post_ and _put_ methods will not function
|
400
|
+
# and likely result in an error.
|
401
|
+
def close
|
402
|
+
@session.connection.close
|
430
403
|
end
|
431
|
-
end
|
432
|
-
uri
|
433
|
-
end
|
434
404
|
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
405
|
+
attr_reader :marshaller
|
406
|
+
|
407
|
+
protected
|
408
|
+
|
409
|
+
# Constructs a full URL using the base URL stored in the {Ingenico::Connect::SDK::Session} and the given relative path and request_parameters.
|
410
|
+
# The returned URL is a *URI* object.
|
411
|
+
#
|
412
|
+
# @param relative_path [String] The relative path of the URL.
|
413
|
+
# @param request_parameters [Array<Ingenico::Connect::SDK::RequestParam>] A list of request parameters that each have #name and #value
|
414
|
+
# which represent the parameter name and value respectively.
|
415
|
+
def to_absolute_uri(relative_path, request_parameters)
|
416
|
+
api_endpoint = @session.api_endpoint
|
417
|
+
raise RuntimeError('api_endpoint should not contain a path') unless api_endpoint.path.nil? || api_endpoint.path.empty?
|
418
|
+
|
419
|
+
unless api_endpoint.userinfo.nil? && api_endpoint.query.nil? &&
|
420
|
+
api_endpoint.fragment.nil?
|
421
|
+
raise RuntimeError(
|
422
|
+
'api_endpoint should not contain user info, query or fragment'
|
423
|
+
)
|
424
|
+
end
|
425
|
+
absolute_path = relative_path.start_with?('/') ? relative_path : '/' + relative_path
|
426
|
+
uri = URI::HTTP.new(api_endpoint.scheme, nil, api_endpoint.host,
|
427
|
+
api_endpoint.port, nil, absolute_path, nil, nil, nil)
|
428
|
+
unless request_parameters.nil?
|
429
|
+
request_parameters.each do |nvp|
|
430
|
+
parameters = URI.decode_www_form(uri.query || '') << [nvp.name, nvp.value]
|
431
|
+
uri.query = URI.encode_www_form(parameters)
|
432
|
+
end
|
433
|
+
end
|
434
|
+
uri
|
435
|
+
end
|
455
436
|
|
456
|
-
|
457
|
-
|
458
|
-
|
437
|
+
# Adds several standard headers to the http headers.
|
438
|
+
# This method will add the 'Date' and 'Authorization' header;
|
439
|
+
# the 'X-GCS-Idempotence-Key' header will also be added if an idempotence context is given
|
440
|
+
#
|
441
|
+
# @param http_method [String] 'GET', 'DELETE', 'POST' or 'PUT' depending on the HTTP method being used
|
442
|
+
# @param uri [URI::HTTP] The full URI to the Ingenico ePayments platform,
|
443
|
+
# including the relative path and request parameters.
|
444
|
+
# @param request_headers [Array<Ingenico::Connect::SDK::RequestHeader>] List of request headers in which which new headers will be added
|
445
|
+
# @param context [Ingenico::Connect::SDK::CallContext] object that will be used to produce
|
446
|
+
# an Idempotence header to prevent accidental request duplication.
|
447
|
+
def add_generic_headers(http_method, uri, request_headers, context = nil)
|
448
|
+
request_headers.concat(@session.meta_data_provider.meta_data_headers)
|
449
|
+
request_headers.push(RequestHeader.new('Date', get_header_date_string))
|
450
|
+
if !context.nil? && !context.idempotence_key.nil?
|
451
|
+
request_headers.push(RequestHeader.new('X-GCS-Idempotence-Key', context.idempotence_key))
|
452
|
+
end
|
453
|
+
authenticator = @session.authenticator
|
454
|
+
authentication_signature = authenticator.create_simple_authentication_signature(http_method, uri, request_headers)
|
455
|
+
request_headers.push(RequestHeader.new('Authorization', authentication_signature))
|
456
|
+
end
|
459
457
|
|
460
|
-
|
461
|
-
|
458
|
+
def get_header_date_string
|
459
|
+
Time.now.utc.strftime('%a, %d %b %Y %H:%M:%S GMT')
|
460
|
+
end
|
462
461
|
|
463
|
-
|
464
|
-
|
465
|
-
end
|
462
|
+
def process_response(body, status, headers, response_type, request_path, context)
|
463
|
+
update_context(headers, context) unless context.nil?
|
466
464
|
|
467
|
-
|
468
|
-
|
465
|
+
throw_exception_if_necessary(body, status, headers, request_path)
|
466
|
+
@marshaller.unmarshal(body, response_type)
|
467
|
+
end
|
469
468
|
|
470
|
-
|
471
|
-
|
472
|
-
''
|
473
|
-
else
|
474
|
-
body.read.force_encoding('UTF-8')
|
475
|
-
end
|
476
|
-
end
|
469
|
+
def process_binary_response(status, body, headers, context)
|
470
|
+
update_context(response.headers, context) unless context.nil?
|
477
471
|
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
end
|
472
|
+
if status < 400
|
473
|
+
yield headers, body
|
474
|
+
''
|
475
|
+
else
|
476
|
+
body.read.force_encoding('UTF-8')
|
477
|
+
end
|
478
|
+
end
|
486
479
|
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
if status_code == 404
|
492
|
-
raise NotFoundException.new(cause, 'The requested resource was not found; invalid path: ' +
|
493
|
-
request_path)
|
480
|
+
def update_context(headers, context)
|
481
|
+
idempotence_request_timestamp_value = ResponseHeader.get_header_value(headers, 'X-GCS-Idempotence-Request-Timestamp')
|
482
|
+
if idempotence_request_timestamp_value.nil?
|
483
|
+
context.idempotence_request_timestamp = nil
|
494
484
|
else
|
495
|
-
|
485
|
+
context.idempotence_request_timestamp = idempotence_request_timestamp_value
|
496
486
|
end
|
497
|
-
else
|
498
|
-
raise ResponseException.new(status_code, headers, body)
|
499
487
|
end
|
500
|
-
end
|
501
|
-
end
|
502
488
|
|
503
|
-
|
489
|
+
def throw_exception_if_necessary(body, status_code, headers, request_path)
|
490
|
+
if status_code < 200 || status_code >= 300
|
491
|
+
if !body.nil? && !is_json(headers)
|
492
|
+
cause = ResponseException.new(status_code, headers, body)
|
493
|
+
if status_code == 404
|
494
|
+
raise NotFoundException.new(cause, 'The requested resource was not found; invalid path: ' +
|
495
|
+
request_path)
|
496
|
+
else
|
497
|
+
raise CommunicationException, cause
|
498
|
+
end
|
499
|
+
else
|
500
|
+
raise ResponseException.new(status_code, headers, body)
|
501
|
+
end
|
502
|
+
end
|
503
|
+
end
|
504
|
+
|
505
|
+
private
|
504
506
|
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
507
|
+
def is_json(headers)
|
508
|
+
content_type = ResponseHeader.get_header_value(headers, 'Content-Type')
|
509
|
+
content_type.nil? || 'application/json'.casecmp(content_type) == 0 ||
|
510
|
+
content_type.downcase.start_with?('application/json')
|
511
|
+
end
|
512
|
+
end
|
509
513
|
end
|
510
514
|
end
|
511
515
|
end
|