onlinepayments-sdk-ruby 11.0.0 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AGENTS.md +25 -0
- data/README.md +152 -44
- data/Rakefile +8 -0
- data/lib/onlinepayments/sdk/api_exception.rb +5 -2
- data/lib/onlinepayments/sdk/api_resource.rb +19 -12
- data/lib/onlinepayments/sdk/authentication/authenticator.rb +2 -1
- data/lib/onlinepayments/sdk/authentication/authorization_type.rb +3 -1
- data/lib/onlinepayments/sdk/authentication/v1hmac_authenticator.rb +23 -19
- data/lib/onlinepayments/sdk/authentication.rb +2 -0
- data/lib/onlinepayments/sdk/authorization_exception.rb +2 -0
- data/lib/onlinepayments/sdk/call_context.rb +3 -7
- data/lib/onlinepayments/sdk/client.rb +4 -1
- data/lib/onlinepayments/sdk/communication/communication_exception.rb +2 -1
- data/lib/onlinepayments/sdk/communication/connection.rb +2 -0
- data/lib/onlinepayments/sdk/communication/default_connection.rb +187 -206
- data/lib/onlinepayments/sdk/communication/metadata_provider.rb +37 -47
- data/lib/onlinepayments/sdk/communication/multipart_form_data_object.rb +8 -17
- data/lib/onlinepayments/sdk/communication/multipart_form_data_request.rb +2 -0
- data/lib/onlinepayments/sdk/communication/not_found_exception.rb +2 -1
- data/lib/onlinepayments/sdk/communication/param_request.rb +2 -0
- data/lib/onlinepayments/sdk/communication/pooled_connection.rb +5 -5
- data/lib/onlinepayments/sdk/communication/request_header.rb +11 -15
- data/lib/onlinepayments/sdk/communication/request_param.rb +5 -6
- data/lib/onlinepayments/sdk/communication/response_exception.rb +7 -11
- data/lib/onlinepayments/sdk/communication/response_header.rb +17 -24
- data/lib/onlinepayments/sdk/communication.rb +2 -0
- data/lib/onlinepayments/sdk/communicator.rb +100 -175
- data/lib/onlinepayments/sdk/communicator_configuration.rb +71 -53
- data/lib/onlinepayments/sdk/declined_payment_exception.rb +2 -0
- data/lib/onlinepayments/sdk/declined_payout_exception.rb +2 -0
- data/lib/onlinepayments/sdk/declined_refund_exception.rb +2 -0
- data/lib/onlinepayments/sdk/declined_transaction_exception.rb +2 -0
- data/lib/onlinepayments/sdk/domain/acceptance.rb +13 -3
- data/lib/onlinepayments/sdk/domain/account_on_file.rb +17 -6
- data/lib/onlinepayments/sdk/domain/account_on_file_attribute.rb +15 -4
- data/lib/onlinepayments/sdk/domain/account_on_file_display_hints.rb +12 -3
- data/lib/onlinepayments/sdk/domain/acquirer_information.rb +12 -3
- data/lib/onlinepayments/sdk/domain/acquirer_selection_information.rb +13 -3
- data/lib/onlinepayments/sdk/domain/add_authorization_details_response.rb +10 -2
- data/lib/onlinepayments/sdk/domain/additional_order_input.rb +19 -8
- data/lib/onlinepayments/sdk/domain/address.rb +21 -7
- data/lib/onlinepayments/sdk/domain/address_personal.rb +26 -10
- data/lib/onlinepayments/sdk/domain/airline_data.rb +83 -27
- data/lib/onlinepayments/sdk/domain/airline_flight_leg.rb +69 -21
- data/lib/onlinepayments/sdk/domain/airline_passenger.rb +30 -8
- data/lib/onlinepayments/sdk/domain/amex.rb +15 -5
- data/lib/onlinepayments/sdk/domain/amount_breakdown.rb +11 -2
- data/lib/onlinepayments/sdk/domain/amount_of_money.rb +11 -2
- data/lib/onlinepayments/sdk/domain/api_error.rb +23 -8
- data/lib/onlinepayments/sdk/domain/api_parameters.rb +22 -10
- data/lib/onlinepayments/sdk/domain/apple_pay_line_item.rb +27 -7
- data/lib/onlinepayments/sdk/domain/apple_pay_recurring_payment_request.rb +19 -7
- data/lib/onlinepayments/sdk/domain/authentication_options.rb +15 -4
- data/lib/onlinepayments/sdk/domain/auto_capture.rb +9 -1
- data/lib/onlinepayments/sdk/domain/bank_account_iban.rb +9 -1
- data/lib/onlinepayments/sdk/domain/batch_metadata.rb +13 -3
- data/lib/onlinepayments/sdk/domain/browser_data.rb +17 -5
- data/lib/onlinepayments/sdk/domain/calculate_surcharge_request.rb +13 -4
- data/lib/onlinepayments/sdk/domain/calculate_surcharge_response.rb +10 -2
- data/lib/onlinepayments/sdk/domain/cancel_payment_batch_request.rb +12 -3
- data/lib/onlinepayments/sdk/domain/cancel_payment_request.rb +21 -9
- data/lib/onlinepayments/sdk/domain/cancel_payment_response.rb +10 -2
- data/lib/onlinepayments/sdk/domain/capture.rb +17 -6
- data/lib/onlinepayments/sdk/domain/capture_output.rb +57 -23
- data/lib/onlinepayments/sdk/domain/capture_payment_batch_request.rb +12 -3
- data/lib/onlinepayments/sdk/domain/capture_payment_request.rb +23 -10
- data/lib/onlinepayments/sdk/domain/capture_response.rb +17 -6
- data/lib/onlinepayments/sdk/domain/capture_status_output.rb +9 -1
- data/lib/onlinepayments/sdk/domain/captures_response.rb +10 -2
- data/lib/onlinepayments/sdk/domain/car_rental_data.rb +57 -19
- data/lib/onlinepayments/sdk/domain/car_rental_pickup_return_data.rb +21 -7
- data/lib/onlinepayments/sdk/domain/car_rental_vehicle_data.rb +11 -2
- data/lib/onlinepayments/sdk/domain/card.rb +15 -4
- data/lib/onlinepayments/sdk/domain/card_bin_details.rb +66 -20
- data/lib/onlinepayments/sdk/domain/card_data_without_cvv.rb +13 -3
- data/lib/onlinepayments/sdk/domain/card_essentials.rb +75 -23
- data/lib/onlinepayments/sdk/domain/card_fraud_results.rb +13 -3
- data/lib/onlinepayments/sdk/domain/card_info.rb +11 -2
- data/lib/onlinepayments/sdk/domain/card_installment_details.rb +6 -1
- data/lib/onlinepayments/sdk/domain/card_payment_method_specific_input.rb +122 -50
- data/lib/onlinepayments/sdk/domain/card_payment_method_specific_input_base.rb +93 -39
- data/lib/onlinepayments/sdk/domain/card_payment_method_specific_input_for_hosted_checkout.rb +16 -5
- data/lib/onlinepayments/sdk/domain/card_payment_method_specific_output.rb +88 -36
- data/lib/onlinepayments/sdk/domain/card_payment_method_specific_output_summary.rb +12 -3
- data/lib/onlinepayments/sdk/domain/card_payment_method_specific_output_summary_card.rb +9 -1
- data/lib/onlinepayments/sdk/domain/card_payout_method_specific_input.rb +18 -6
- data/lib/onlinepayments/sdk/domain/card_recurrence_details.rb +9 -1
- data/lib/onlinepayments/sdk/domain/card_source.rb +16 -5
- data/lib/onlinepayments/sdk/domain/card_token.rb +21 -7
- data/lib/onlinepayments/sdk/domain/card_without_cvv.rb +13 -3
- data/lib/onlinepayments/sdk/domain/click_to_pay.rb +9 -1
- data/lib/onlinepayments/sdk/domain/company_information.rb +9 -1
- data/lib/onlinepayments/sdk/domain/complete_payment_card_payment_method_specific_input.rb +10 -2
- data/lib/onlinepayments/sdk/domain/complete_payment_request.rb +13 -4
- data/lib/onlinepayments/sdk/domain/complete_payment_response.rb +16 -6
- data/lib/onlinepayments/sdk/domain/contact_details.rb +17 -5
- data/lib/onlinepayments/sdk/domain/create_certificate_response.rb +11 -2
- data/lib/onlinepayments/sdk/domain/create_hosted_checkout_request.rb +38 -16
- data/lib/onlinepayments/sdk/domain/create_hosted_checkout_response.rb +20 -7
- data/lib/onlinepayments/sdk/domain/create_hosted_fields_session_request.rb +17 -6
- data/lib/onlinepayments/sdk/domain/create_hosted_fields_session_response.rb +22 -9
- data/lib/onlinepayments/sdk/domain/create_hosted_tokenization_request.rb +23 -9
- data/lib/onlinepayments/sdk/domain/create_hosted_tokenization_response.rb +26 -8
- data/lib/onlinepayments/sdk/domain/create_mandate_request.rb +31 -9
- data/lib/onlinepayments/sdk/domain/create_mandate_response.rb +13 -4
- data/lib/onlinepayments/sdk/domain/create_mandate_with_return_url.rb +31 -9
- data/lib/onlinepayments/sdk/domain/create_payment_link_request.rb +61 -25
- data/lib/onlinepayments/sdk/domain/create_payment_request.rb +47 -19
- data/lib/onlinepayments/sdk/domain/create_payment_response.rb +16 -6
- data/lib/onlinepayments/sdk/domain/create_payout_request.rb +29 -11
- data/lib/onlinepayments/sdk/domain/create_token_request.rb +14 -4
- data/lib/onlinepayments/sdk/domain/created_payment_output.rb +12 -3
- data/lib/onlinepayments/sdk/domain/created_token_response.rb +22 -9
- data/lib/onlinepayments/sdk/domain/credit_card_specific_input_hosted_tokenization.rb +13 -4
- data/lib/onlinepayments/sdk/domain/credit_card_validation_rules.rb +11 -2
- data/lib/onlinepayments/sdk/domain/crm_token.rb +11 -2
- data/lib/onlinepayments/sdk/domain/csr_request.rb +9 -1
- data/lib/onlinepayments/sdk/domain/currency_conversion.rb +12 -3
- data/lib/onlinepayments/sdk/domain/currency_conversion_input.rb +11 -2
- data/lib/onlinepayments/sdk/domain/currency_conversion_request.rb +13 -4
- data/lib/onlinepayments/sdk/domain/currency_conversion_response.rb +15 -5
- data/lib/onlinepayments/sdk/domain/currency_conversion_result.rb +11 -2
- data/lib/onlinepayments/sdk/domain/currency_conversion_specific_input.rb +9 -1
- data/lib/onlinepayments/sdk/domain/cursor_pagination_info.rb +11 -2
- data/lib/onlinepayments/sdk/domain/customer.rb +42 -16
- data/lib/onlinepayments/sdk/domain/customer_account.rb +36 -12
- data/lib/onlinepayments/sdk/domain/customer_account_authentication.rb +13 -3
- data/lib/onlinepayments/sdk/domain/customer_bank_account.rb +13 -3
- data/lib/onlinepayments/sdk/domain/customer_device.rb +28 -8
- data/lib/onlinepayments/sdk/domain/customer_device_output.rb +9 -1
- data/lib/onlinepayments/sdk/domain/customer_output.rb +10 -2
- data/lib/onlinepayments/sdk/domain/customer_payment_activity.rb +13 -3
- data/lib/onlinepayments/sdk/domain/customer_token.rb +16 -6
- data/lib/onlinepayments/sdk/domain/data_object.rb +19 -2
- data/lib/onlinepayments/sdk/domain/dcc_card_source.rb +16 -5
- data/lib/onlinepayments/sdk/domain/dcc_proposal.rb +20 -8
- data/lib/onlinepayments/sdk/domain/decrypted_payment_data.rb +17 -5
- data/lib/onlinepayments/sdk/domain/detokenization_response.rb +10 -2
- data/lib/onlinepayments/sdk/domain/detokenized_token_response.rb +27 -7
- data/lib/onlinepayments/sdk/domain/directory_entry.rb +13 -3
- data/lib/onlinepayments/sdk/domain/discount.rb +9 -1
- data/lib/onlinepayments/sdk/domain/dpa_data.rb +9 -1
- data/lib/onlinepayments/sdk/domain/dpa_transaction_options.rb +10 -2
- data/lib/onlinepayments/sdk/domain/empty_validator.rb +2 -0
- data/lib/onlinepayments/sdk/domain/error_response.rb +12 -3
- data/lib/onlinepayments/sdk/domain/external_cardholder_authentication_data.rb +36 -10
- data/lib/onlinepayments/sdk/domain/external_token_linked.rb +13 -3
- data/lib/onlinepayments/sdk/domain/feedbacks.rb +12 -3
- data/lib/onlinepayments/sdk/domain/fixed_list_validator.rb +10 -2
- data/lib/onlinepayments/sdk/domain/fraud_fields.rb +14 -4
- data/lib/onlinepayments/sdk/domain/fraud_results.rb +9 -1
- data/lib/onlinepayments/sdk/domain/g_pay_three_d_secure.rb +25 -7
- data/lib/onlinepayments/sdk/domain/get_batch_status_response.rb +15 -4
- data/lib/onlinepayments/sdk/domain/get_hosted_checkout_response.rb +12 -3
- data/lib/onlinepayments/sdk/domain/get_hosted_fields_session_response.rb +12 -3
- data/lib/onlinepayments/sdk/domain/get_hosted_tokenization_response.rb +12 -3
- data/lib/onlinepayments/sdk/domain/get_iin_details_request.rb +12 -3
- data/lib/onlinepayments/sdk/domain/get_iin_details_response.rb +76 -24
- data/lib/onlinepayments/sdk/domain/get_mandate_response.rb +10 -2
- data/lib/onlinepayments/sdk/domain/get_payment_links_by_merchant_group_request.rb +16 -6
- data/lib/onlinepayments/sdk/domain/get_payment_product_groups_response.rb +10 -2
- data/lib/onlinepayments/sdk/domain/get_payment_products_response.rb +10 -2
- data/lib/onlinepayments/sdk/domain/get_privacy_policy_response.rb +9 -1
- data/lib/onlinepayments/sdk/domain/gift_card_purchase.rb +12 -3
- data/lib/onlinepayments/sdk/domain/hosted_checkout_specific_input.rb +48 -16
- data/lib/onlinepayments/sdk/domain/hosted_checkout_specific_output.rb +11 -2
- data/lib/onlinepayments/sdk/domain/iin_detail.rb +72 -22
- data/lib/onlinepayments/sdk/domain/import_cof_series_request.rb +33 -11
- data/lib/onlinepayments/sdk/domain/import_cof_series_response.rb +9 -1
- data/lib/onlinepayments/sdk/domain/increment_authorization_request.rb +10 -2
- data/lib/onlinepayments/sdk/domain/increment_authorization_response.rb +10 -2
- data/lib/onlinepayments/sdk/domain/label_template_element.rb +11 -2
- data/lib/onlinepayments/sdk/domain/length_validator.rb +11 -2
- data/lib/onlinepayments/sdk/domain/line_item.rb +19 -8
- data/lib/onlinepayments/sdk/domain/line_item_detail.rb +13 -3
- data/lib/onlinepayments/sdk/domain/line_item_invoice_data.rb +9 -1
- data/lib/onlinepayments/sdk/domain/loan_recipient.rb +17 -5
- data/lib/onlinepayments/sdk/domain/lodging_data.rb +9 -1
- data/lib/onlinepayments/sdk/domain/mandate_address.rb +17 -5
- data/lib/onlinepayments/sdk/domain/mandate_address_response.rb +17 -5
- data/lib/onlinepayments/sdk/domain/mandate_contact_details.rb +11 -2
- data/lib/onlinepayments/sdk/domain/mandate_customer.rb +21 -9
- data/lib/onlinepayments/sdk/domain/mandate_customer_response.rb +21 -9
- data/lib/onlinepayments/sdk/domain/mandate_merchant_action.rb +12 -3
- data/lib/onlinepayments/sdk/domain/mandate_personal_information.rb +12 -3
- data/lib/onlinepayments/sdk/domain/mandate_personal_information_response.rb +12 -3
- data/lib/onlinepayments/sdk/domain/mandate_personal_name.rb +11 -2
- data/lib/onlinepayments/sdk/domain/mandate_personal_name_response.rb +11 -2
- data/lib/onlinepayments/sdk/domain/mandate_redirect_data.rb +11 -2
- data/lib/onlinepayments/sdk/domain/mandate_response.rb +22 -8
- data/lib/onlinepayments/sdk/domain/market_place.rb +11 -2
- data/lib/onlinepayments/sdk/domain/mastercard.rb +14 -4
- data/lib/onlinepayments/sdk/domain/merchant_action.rb +21 -9
- data/lib/onlinepayments/sdk/domain/mobile_payment_data.rb +11 -2
- data/lib/onlinepayments/sdk/domain/mobile_payment_method_hosted_checkout_specific_input.rb +17 -6
- data/lib/onlinepayments/sdk/domain/mobile_payment_method_specific_input.rb +40 -14
- data/lib/onlinepayments/sdk/domain/mobile_payment_method_specific_output.rb +22 -9
- data/lib/onlinepayments/sdk/domain/mobile_payment_product302_specific_input.rb +17 -6
- data/lib/onlinepayments/sdk/domain/mobile_payment_product320_specific_input.rb +17 -6
- data/lib/onlinepayments/sdk/domain/mobile_three_d_secure_challenge_parameters.rb +15 -4
- data/lib/onlinepayments/sdk/domain/multiple_payment_information.rb +11 -2
- data/lib/onlinepayments/sdk/domain/network_token_data.rb +19 -6
- data/lib/onlinepayments/sdk/domain/network_token_essentials.rb +19 -6
- data/lib/onlinepayments/sdk/domain/network_token_linked.rb +13 -3
- data/lib/onlinepayments/sdk/domain/omnichannel_payment_specific_input.rb +9 -1
- data/lib/onlinepayments/sdk/domain/omnichannel_payout_specific_input.rb +11 -2
- data/lib/onlinepayments/sdk/domain/omnichannel_refund_specific_input.rb +9 -1
- data/lib/onlinepayments/sdk/domain/omnichannel_subsequent_specific_input.rb +9 -1
- data/lib/onlinepayments/sdk/domain/operation_output.rb +34 -12
- data/lib/onlinepayments/sdk/domain/operation_payment_references.rb +24 -6
- data/lib/onlinepayments/sdk/domain/order.rb +44 -18
- data/lib/onlinepayments/sdk/domain/order_line_details.rb +36 -10
- data/lib/onlinepayments/sdk/domain/order_references.rb +30 -8
- data/lib/onlinepayments/sdk/domain/order_status_output.rb +18 -6
- data/lib/onlinepayments/sdk/domain/order_type_information.rb +11 -2
- data/lib/onlinepayments/sdk/domain/other_details.rb +11 -2
- data/lib/onlinepayments/sdk/domain/pagination.rb +11 -2
- data/lib/onlinepayments/sdk/domain/payment_account_on_file.rb +11 -2
- data/lib/onlinepayments/sdk/domain/payment_context.rb +14 -4
- data/lib/onlinepayments/sdk/domain/payment_creation_output.rb +15 -4
- data/lib/onlinepayments/sdk/domain/payment_details_response.rb +23 -10
- data/lib/onlinepayments/sdk/domain/payment_error_response.rb +15 -5
- data/lib/onlinepayments/sdk/domain/payment_link_event.rb +13 -3
- data/lib/onlinepayments/sdk/domain/payment_link_order_input.rb +15 -5
- data/lib/onlinepayments/sdk/domain/payment_link_order_output.rb +15 -5
- data/lib/onlinepayments/sdk/domain/payment_link_overview_entry.rb +37 -11
- data/lib/onlinepayments/sdk/domain/payment_link_overview_filtering.rb +13 -4
- data/lib/onlinepayments/sdk/domain/payment_link_overview_response.rb +15 -5
- data/lib/onlinepayments/sdk/domain/payment_link_overview_sorting.rb +11 -2
- data/lib/onlinepayments/sdk/domain/payment_link_response.rb +38 -12
- data/lib/onlinepayments/sdk/domain/payment_link_specific_input.rb +13 -3
- data/lib/onlinepayments/sdk/domain/payment_output.rb +61 -25
- data/lib/onlinepayments/sdk/domain/payment_output_summary.rb +18 -7
- data/lib/onlinepayments/sdk/domain/payment_product.rb +55 -21
- data/lib/onlinepayments/sdk/domain/payment_product11.rb +17 -5
- data/lib/onlinepayments/sdk/domain/payment_product130_specific_input.rb +10 -2
- data/lib/onlinepayments/sdk/domain/payment_product130_specific_three_d_secure.rb +15 -4
- data/lib/onlinepayments/sdk/domain/payment_product3012.rb +11 -2
- data/lib/onlinepayments/sdk/domain/payment_product3012_specific_input.rb +15 -4
- data/lib/onlinepayments/sdk/domain/payment_product3013_specific_input.rb +13 -3
- data/lib/onlinepayments/sdk/domain/payment_product302_specific_data.rb +10 -2
- data/lib/onlinepayments/sdk/domain/payment_product3203_specific_output.rb +13 -4
- data/lib/onlinepayments/sdk/domain/payment_product3204_specific_output.rb +9 -1
- data/lib/onlinepayments/sdk/domain/payment_product3208_specific_input.rb +9 -1
- data/lib/onlinepayments/sdk/domain/payment_product3208_specific_output.rb +9 -1
- data/lib/onlinepayments/sdk/domain/payment_product3209_specific_input.rb +9 -1
- data/lib/onlinepayments/sdk/domain/payment_product3209_specific_output.rb +9 -1
- data/lib/onlinepayments/sdk/domain/payment_product320_specific_data.rb +12 -3
- data/lib/onlinepayments/sdk/domain/payment_product350.rb +11 -2
- data/lib/onlinepayments/sdk/domain/payment_product5001.rb +11 -2
- data/lib/onlinepayments/sdk/domain/payment_product5001_specific_output.rb +17 -5
- data/lib/onlinepayments/sdk/domain/payment_product5002_specific_data.rb +10 -2
- data/lib/onlinepayments/sdk/domain/payment_product5002_specific_input.rb +11 -2
- data/lib/onlinepayments/sdk/domain/payment_product5002default_brand_parameters.rb +11 -2
- data/lib/onlinepayments/sdk/domain/payment_product5100_specific_input.rb +9 -1
- data/lib/onlinepayments/sdk/domain/payment_product5402_specific_output.rb +9 -1
- data/lib/onlinepayments/sdk/domain/payment_product5404.rb +11 -2
- data/lib/onlinepayments/sdk/domain/payment_product5407.rb +11 -2
- data/lib/onlinepayments/sdk/domain/payment_product5407_auto_capture.rb +6 -1
- data/lib/onlinepayments/sdk/domain/payment_product5412.rb +13 -3
- data/lib/onlinepayments/sdk/domain/payment_product5500_specific_output.rb +15 -4
- data/lib/onlinepayments/sdk/domain/payment_product5704_auto_capture.rb +9 -1
- data/lib/onlinepayments/sdk/domain/payment_product771_specific_output.rb +9 -1
- data/lib/onlinepayments/sdk/domain/payment_product840.rb +9 -1
- data/lib/onlinepayments/sdk/domain/payment_product840_customer_account.rb +30 -8
- data/lib/onlinepayments/sdk/domain/payment_product840_specific_output.rb +33 -13
- data/lib/onlinepayments/sdk/domain/payment_product_display_hints.rb +13 -3
- data/lib/onlinepayments/sdk/domain/payment_product_field.rb +17 -6
- data/lib/onlinepayments/sdk/domain/payment_product_field_data_restrictions.rb +12 -3
- data/lib/onlinepayments/sdk/domain/payment_product_field_display_element.rb +15 -4
- data/lib/onlinepayments/sdk/domain/payment_product_field_display_hints.rb +38 -12
- data/lib/onlinepayments/sdk/domain/payment_product_field_form_element.rb +12 -3
- data/lib/onlinepayments/sdk/domain/payment_product_field_tooltip.rb +11 -2
- data/lib/onlinepayments/sdk/domain/payment_product_field_validators.rb +42 -18
- data/lib/onlinepayments/sdk/domain/payment_product_filter.rb +13 -4
- data/lib/onlinepayments/sdk/domain/payment_product_filter_hosted_tokenization.rb +10 -2
- data/lib/onlinepayments/sdk/domain/payment_product_filters_hosted_checkout.rb +13 -4
- data/lib/onlinepayments/sdk/domain/payment_product_filters_hosted_fields.rb +13 -4
- data/lib/onlinepayments/sdk/domain/payment_product_filters_hosted_tokenization.rb +13 -4
- data/lib/onlinepayments/sdk/domain/payment_product_group.rb +18 -7
- data/lib/onlinepayments/sdk/domain/payment_product_networks_response.rb +10 -2
- data/lib/onlinepayments/sdk/domain/payment_product_session302_specific_input.rb +11 -2
- data/lib/onlinepayments/sdk/domain/payment_product_session302_specific_output.rb +9 -1
- data/lib/onlinepayments/sdk/domain/payment_product_session_request.rb +10 -2
- data/lib/onlinepayments/sdk/domain/payment_product_session_response.rb +10 -2
- data/lib/onlinepayments/sdk/domain/payment_references.rb +27 -7
- data/lib/onlinepayments/sdk/domain/payment_response.rb +32 -12
- data/lib/onlinepayments/sdk/domain/payment_status_output.rb +28 -8
- data/lib/onlinepayments/sdk/domain/payment_status_output_summary.rb +16 -5
- data/lib/onlinepayments/sdk/domain/payment_summary.rb +17 -6
- data/lib/onlinepayments/sdk/domain/payments_report_response.rb +13 -4
- data/lib/onlinepayments/sdk/domain/payout_card_payment_method_specific_output.rb +17 -6
- data/lib/onlinepayments/sdk/domain/payout_error_response.rb +15 -5
- data/lib/onlinepayments/sdk/domain/payout_output.rb +27 -9
- data/lib/onlinepayments/sdk/domain/payout_response.rb +17 -6
- data/lib/onlinepayments/sdk/domain/payout_result.rb +17 -6
- data/lib/onlinepayments/sdk/domain/payout_status_output.rb +13 -3
- data/lib/onlinepayments/sdk/domain/pending_authentication.rb +9 -1
- data/lib/onlinepayments/sdk/domain/personal_information.rb +14 -4
- data/lib/onlinepayments/sdk/domain/personal_information_token.rb +10 -2
- data/lib/onlinepayments/sdk/domain/personal_name.rb +13 -3
- data/lib/onlinepayments/sdk/domain/personal_name_token.rb +11 -2
- data/lib/onlinepayments/sdk/domain/problem_details_response.rb +17 -5
- data/lib/onlinepayments/sdk/domain/product302_recurring.rb +9 -1
- data/lib/onlinepayments/sdk/domain/product320_recurring.rb +9 -1
- data/lib/onlinepayments/sdk/domain/product_directory.rb +10 -2
- data/lib/onlinepayments/sdk/domain/protection_eligibility.rb +11 -2
- data/lib/onlinepayments/sdk/domain/range_validator.rb +11 -2
- data/lib/onlinepayments/sdk/domain/rate_details.rb +17 -5
- data/lib/onlinepayments/sdk/domain/reattempt_instructions.rb +14 -4
- data/lib/onlinepayments/sdk/domain/reattempt_instructions_conditions.rb +11 -2
- data/lib/onlinepayments/sdk/domain/redirect_data.rb +11 -2
- data/lib/onlinepayments/sdk/domain/redirect_payment_method_specific_input.rb +117 -53
- data/lib/onlinepayments/sdk/domain/redirect_payment_method_specific_output.rb +50 -20
- data/lib/onlinepayments/sdk/domain/redirect_payment_product11_specific_input.rb +9 -1
- data/lib/onlinepayments/sdk/domain/redirect_payment_product3103_specific_input.rb +9 -1
- data/lib/onlinepayments/sdk/domain/redirect_payment_product3112_specific_input.rb +9 -1
- data/lib/onlinepayments/sdk/domain/redirect_payment_product3116_specific_input.rb +9 -1
- data/lib/onlinepayments/sdk/domain/redirect_payment_product3203_specific_input.rb +9 -1
- data/lib/onlinepayments/sdk/domain/redirect_payment_product3204_specific_input.rb +11 -2
- data/lib/onlinepayments/sdk/domain/redirect_payment_product3302_specific_input.rb +13 -3
- data/lib/onlinepayments/sdk/domain/redirect_payment_product3306_specific_input.rb +9 -1
- data/lib/onlinepayments/sdk/domain/redirect_payment_product3307_specific_input.rb +2 -0
- data/lib/onlinepayments/sdk/domain/redirect_payment_product5001_specific_input.rb +11 -2
- data/lib/onlinepayments/sdk/domain/redirect_payment_product5300_specific_input.rb +33 -9
- data/lib/onlinepayments/sdk/domain/redirect_payment_product5301_specific_input.rb +9 -1
- data/lib/onlinepayments/sdk/domain/redirect_payment_product5402_specific_input.rb +9 -1
- data/lib/onlinepayments/sdk/domain/redirect_payment_product5403_specific_input.rb +9 -1
- data/lib/onlinepayments/sdk/domain/redirect_payment_product5406_specific_input.rb +10 -2
- data/lib/onlinepayments/sdk/domain/redirect_payment_product5407_specific_input.rb +10 -2
- data/lib/onlinepayments/sdk/domain/redirect_payment_product5408_specific_input.rb +12 -3
- data/lib/onlinepayments/sdk/domain/redirect_payment_product5410_specific_input.rb +9 -1
- data/lib/onlinepayments/sdk/domain/redirect_payment_product5412_specific_input.rb +11 -2
- data/lib/onlinepayments/sdk/domain/redirect_payment_product5601_specific_input.rb +9 -1
- data/lib/onlinepayments/sdk/domain/redirect_payment_product809_specific_input.rb +9 -1
- data/lib/onlinepayments/sdk/domain/redirect_payment_product840_specific_input.rb +15 -4
- data/lib/onlinepayments/sdk/domain/redirect_payment_product900_specific_input.rb +9 -1
- data/lib/onlinepayments/sdk/domain/redirection_data.rb +9 -1
- data/lib/onlinepayments/sdk/domain/refund_card_method_specific_output.rb +27 -9
- data/lib/onlinepayments/sdk/domain/refund_e_wallet_method_specific_output.rb +14 -4
- data/lib/onlinepayments/sdk/domain/refund_error_response.rb +15 -5
- data/lib/onlinepayments/sdk/domain/refund_mobile_method_specific_output.rb +13 -3
- data/lib/onlinepayments/sdk/domain/refund_output.rb +49 -19
- data/lib/onlinepayments/sdk/domain/refund_payment_batch_request.rb +12 -3
- data/lib/onlinepayments/sdk/domain/refund_payment_product840_customer_account.rb +13 -3
- data/lib/onlinepayments/sdk/domain/refund_payment_product840_specific_output.rb +10 -2
- data/lib/onlinepayments/sdk/domain/refund_redirect_method_specific_output.rb +11 -2
- data/lib/onlinepayments/sdk/domain/refund_redirect_payment_method_specific_input.rb +10 -2
- data/lib/onlinepayments/sdk/domain/refund_redirect_payment_product900_specific_input.rb +9 -1
- data/lib/onlinepayments/sdk/domain/refund_request.rb +39 -15
- data/lib/onlinepayments/sdk/domain/refund_response.rb +17 -6
- data/lib/onlinepayments/sdk/domain/refunds_response.rb +10 -2
- data/lib/onlinepayments/sdk/domain/regular_expression_validator.rb +9 -1
- data/lib/onlinepayments/sdk/domain/revoke_mandate_request.rb +9 -1
- data/lib/onlinepayments/sdk/domain/send_test_request.rb +9 -1
- data/lib/onlinepayments/sdk/domain/sepa_direct_debit_payment_method_specific_input.rb +12 -3
- data/lib/onlinepayments/sdk/domain/sepa_direct_debit_payment_method_specific_input_base.rb +12 -3
- data/lib/onlinepayments/sdk/domain/sepa_direct_debit_payment_method_specific_output.rb +15 -5
- data/lib/onlinepayments/sdk/domain/sepa_direct_debit_payment_product771_specific_input.rb +12 -3
- data/lib/onlinepayments/sdk/domain/sepa_direct_debit_payment_product771_specific_input_base.rb +12 -3
- data/lib/onlinepayments/sdk/domain/session_data.rb +18 -6
- data/lib/onlinepayments/sdk/domain/session_details.rb +11 -2
- data/lib/onlinepayments/sdk/domain/session_request.rb +10 -2
- data/lib/onlinepayments/sdk/domain/session_response.rb +18 -6
- data/lib/onlinepayments/sdk/domain/share_payment_link_request.rb +13 -3
- data/lib/onlinepayments/sdk/domain/shipping.rb +35 -11
- data/lib/onlinepayments/sdk/domain/shipping_detail.rb +11 -2
- data/lib/onlinepayments/sdk/domain/shipping_method.rb +15 -4
- data/lib/onlinepayments/sdk/domain/shopping_cart.rb +27 -9
- data/lib/onlinepayments/sdk/domain/shopping_cart_extension.rb +16 -13
- data/lib/onlinepayments/sdk/domain/show_form_data.rb +42 -18
- data/lib/onlinepayments/sdk/domain/show_instructions_data.rb +9 -1
- data/lib/onlinepayments/sdk/domain/split_payment_product_filter.rb +10 -2
- data/lib/onlinepayments/sdk/domain/split_payment_product_filters_hosted_checkout.rb +13 -4
- data/lib/onlinepayments/sdk/domain/sub_merchant.rb +20 -7
- data/lib/onlinepayments/sdk/domain/submit_batch_request_body.rb +38 -16
- data/lib/onlinepayments/sdk/domain/submit_batch_response.rb +11 -2
- data/lib/onlinepayments/sdk/domain/subsequent_card_payment_method_specific_input.rb +32 -10
- data/lib/onlinepayments/sdk/domain/subsequent_payment_batch_request.rb +12 -3
- data/lib/onlinepayments/sdk/domain/subsequent_payment_product5001_specific_input.rb +9 -1
- data/lib/onlinepayments/sdk/domain/subsequent_payment_request.rb +22 -8
- data/lib/onlinepayments/sdk/domain/subsequent_payment_response.rb +10 -2
- data/lib/onlinepayments/sdk/domain/surcharge.rb +23 -10
- data/lib/onlinepayments/sdk/domain/surcharge_calculation_card.rb +11 -2
- data/lib/onlinepayments/sdk/domain/surcharge_for_payment_link.rb +9 -1
- data/lib/onlinepayments/sdk/domain/surcharge_rate.rb +15 -4
- data/lib/onlinepayments/sdk/domain/surcharge_specific_input.rb +12 -3
- data/lib/onlinepayments/sdk/domain/surcharge_specific_output.rb +15 -5
- data/lib/onlinepayments/sdk/domain/test_connection.rb +9 -1
- data/lib/onlinepayments/sdk/domain/three_d_secure.rb +45 -15
- data/lib/onlinepayments/sdk/domain/three_d_secure_base.rb +34 -10
- data/lib/onlinepayments/sdk/domain/three_d_secure_data.rb +13 -3
- data/lib/onlinepayments/sdk/domain/three_d_secure_results.rb +45 -13
- data/lib/onlinepayments/sdk/domain/three_ds_input_data.rb +13 -3
- data/lib/onlinepayments/sdk/domain/token_card.rb +12 -3
- data/lib/onlinepayments/sdk/domain/token_card_data.rb +15 -5
- data/lib/onlinepayments/sdk/domain/token_card_specific_input.rb +10 -2
- data/lib/onlinepayments/sdk/domain/token_data.rb +12 -3
- data/lib/onlinepayments/sdk/domain/token_e_wallet.rb +12 -3
- data/lib/onlinepayments/sdk/domain/token_info.rb +15 -4
- data/lib/onlinepayments/sdk/domain/token_response.rb +35 -13
- data/lib/onlinepayments/sdk/domain/transaction.rb +10 -2
- data/lib/onlinepayments/sdk/domain/update_authorization_additional_data_request.rb +10 -2
- data/lib/onlinepayments/sdk/domain/uploadable_file.rb +6 -8
- data/lib/onlinepayments/sdk/domain/validate_credentials_request.rb +11 -2
- data/lib/onlinepayments/sdk/domain/validate_credentials_response.rb +9 -1
- data/lib/onlinepayments/sdk/domain/value_mapping_element.rb +12 -3
- data/lib/onlinepayments/sdk/domain/visa.rb +18 -6
- data/lib/onlinepayments/sdk/domain/visa_authentication_options.rb +13 -3
- data/lib/onlinepayments/sdk/domain.rb +2 -0
- data/lib/onlinepayments/sdk/exception_factory.rb +3 -1
- data/lib/onlinepayments/sdk/factory.rb +131 -52
- data/lib/onlinepayments/sdk/idempotence_exception.rb +2 -0
- data/lib/onlinepayments/sdk/json/default_marshaller.rb +7 -5
- data/lib/onlinepayments/sdk/json/marshaller.rb +2 -1
- data/lib/onlinepayments/sdk/json/marshaller_syntax_exception.rb +2 -0
- data/lib/onlinepayments/sdk/json.rb +2 -0
- data/lib/onlinepayments/sdk/logging/communicator_logger.rb +4 -3
- data/lib/onlinepayments/sdk/logging/log_message_builder.rb +76 -69
- data/lib/onlinepayments/sdk/logging/logging_capable.rb +2 -1
- data/lib/onlinepayments/sdk/logging/obfuscation/body_obfuscator.rb +50 -49
- data/lib/onlinepayments/sdk/logging/obfuscation/header_obfuscator.rb +12 -15
- data/lib/onlinepayments/sdk/logging/obfuscation/obfuscation_capable.rb +27 -5
- data/lib/onlinepayments/sdk/logging/obfuscation/obfuscation_rule.rb +14 -16
- data/lib/onlinepayments/sdk/logging/obfuscation.rb +2 -0
- data/lib/onlinepayments/sdk/logging/request_log_message_builder.rb +18 -14
- data/lib/onlinepayments/sdk/logging/response_log_message_builder.rb +15 -13
- data/lib/onlinepayments/sdk/logging/ruby_communicator_logger.rb +12 -13
- data/lib/onlinepayments/sdk/logging/stdout_communicator_logger.rb +7 -5
- data/lib/onlinepayments/sdk/logging.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/captures/captures_client.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/captures.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/cofseries/cof_series_client.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/cofseries.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/complete/complete_client.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/complete.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/hostedcheckout/hosted_checkout_client.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/hostedcheckout.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/hostedfields/hosted_fields_client.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/hostedfields.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/hostedtokenization/hosted_tokenization_client.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/hostedtokenization.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/mandates/mandates_client.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/mandates.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/merchant_client.rb +6 -0
- data/lib/onlinepayments/sdk/merchant/merchantbatch/get_payments_report_params.rb +9 -0
- data/lib/onlinepayments/sdk/merchant/merchantbatch/merchant_batch_client.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/merchantbatch.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/paymentlinks/payment_links_client.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/paymentlinks.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/payments/payments_client.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/payments.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/payouts/payouts_client.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/payouts.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/preauthorization/pre_authorization_client.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/preauthorization.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/privacypolicy/get_privacy_policy_params.rb +9 -0
- data/lib/onlinepayments/sdk/merchant/privacypolicy/privacy_policy_client.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/privacypolicy.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/productgroups/get_product_group_params.rb +13 -0
- data/lib/onlinepayments/sdk/merchant/productgroups/get_product_groups_params.rb +13 -0
- data/lib/onlinepayments/sdk/merchant/productgroups/product_groups_client.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/productgroups.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/products/get_payment_product_networks_params.rb +11 -0
- data/lib/onlinepayments/sdk/merchant/products/get_payment_product_params.rb +14 -0
- data/lib/onlinepayments/sdk/merchant/products/get_payment_products_params.rb +14 -0
- data/lib/onlinepayments/sdk/merchant/products/get_product_directory_params.rb +9 -0
- data/lib/onlinepayments/sdk/merchant/products/products_client.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/products.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/refunds/refunds_client.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/refunds.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/services/services_client.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/services.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/sessions/sessions_client.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/sessions.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/subsequent/subsequent_client.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/subsequent.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/tokenization/get_card_data_by_payments_params.rb +8 -0
- data/lib/onlinepayments/sdk/merchant/tokenization/get_card_data_by_tokens_params.rb +8 -0
- data/lib/onlinepayments/sdk/merchant/tokenization/tokenization_client.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/tokenization.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/tokens/tokens_client.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/tokens.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/webhooks/webhooks_client.rb +2 -0
- data/lib/onlinepayments/sdk/merchant/webhooks.rb +2 -0
- data/lib/onlinepayments/sdk/merchant.rb +2 -0
- data/lib/onlinepayments/sdk/platform_exception.rb +2 -0
- data/lib/onlinepayments/sdk/problem_details_exception.rb +2 -0
- data/lib/onlinepayments/sdk/proxy_configuration.rb +22 -18
- data/lib/onlinepayments/sdk/reference_exception.rb +2 -0
- data/lib/onlinepayments/sdk/validation_exception.rb +2 -0
- data/lib/onlinepayments/sdk/version.rb +8 -0
- data/lib/onlinepayments/sdk/webhooks/api_version_mismatch_exception.rb +3 -3
- data/lib/onlinepayments/sdk/webhooks/in_memory_secret_key_store.rb +7 -4
- data/lib/onlinepayments/sdk/webhooks/secret_key_not_available_exception.rb +4 -2
- data/lib/onlinepayments/sdk/webhooks/secret_key_store.rb +2 -1
- data/lib/onlinepayments/sdk/webhooks/signature_validation_exception.rb +2 -1
- data/lib/onlinepayments/sdk/webhooks/signature_validator.rb +13 -10
- data/lib/onlinepayments/sdk/webhooks/webhooks_event.rb +38 -62
- data/lib/onlinepayments/sdk/webhooks/webhooks_helper.rb +3 -1
- data/lib/onlinepayments/sdk/webhooks.rb +2 -0
- data/lib/onlinepayments/sdk.rb +2 -0
- data/onlinepayments-sdk-ruby.gemspec +13 -8
- data/skills/worldline-direct/SKILL.md +85 -0
- data/skills/worldline-direct/examples/after_payment_operations_example.rb +75 -0
- data/skills/worldline-direct/examples/app_types.rb +170 -0
- data/skills/worldline-direct/examples/client_integration_example.rb +76 -0
- data/skills/worldline-direct/examples/client_setup.rb +57 -0
- data/skills/worldline-direct/examples/create_payment_response_handler.rb +32 -0
- data/skills/worldline-direct/examples/customer_device.rb +32 -0
- data/skills/worldline-direct/examples/error_handling_example.rb +99 -0
- data/skills/worldline-direct/examples/hosted_checkout_example.rb +181 -0
- data/skills/worldline-direct/examples/hosted_fields_example.rb +82 -0
- data/skills/worldline-direct/examples/hosted_tokenization_example.rb +79 -0
- data/skills/worldline-direct/examples/payment_attempt.rb +30 -0
- data/skills/worldline-direct/examples/payment_links_example.rb +52 -0
- data/skills/worldline-direct/examples/payment_status_example.rb +62 -0
- data/skills/worldline-direct/examples/recurring_payments_example.rb +127 -0
- data/skills/worldline-direct/examples/server_to_server_example.rb +81 -0
- data/skills/worldline-direct/examples/webhook_event_processor.rb +40 -0
- data/skills/worldline-direct/examples/webhooks_endpoint.rb +73 -0
- data/skills/worldline-direct/examples/webhooks_setup.rb +41 -0
- data/skills/worldline-direct/references/errors.md +113 -0
- data/skills/worldline-direct/references/flows.md +966 -0
- data/skills/worldline-direct/references/ruby.md +209 -0
- data/skills/worldline-direct/references/webhooks.md +167 -0
- metadata +100 -23
- data/lib/onlinepayments/sdk/domain/credit_card_validation_rules_hosted_tokenization.rb +0 -37
- data/lib/onlinepayments/sdk/domain/payment_links_response.rb +0 -35
- data/lib/onlinepayments/sdk/domain/shopping_cart_output.rb +0 -35
- data/lib/onlinepayments/sdk/merchant/paymentlinks/get_payment_links_in_bulk_params.rb +0 -28
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 14f74da92196a45ca19ca5d1b71fa5ba64707cffcaff538f6453db4f71e08a6b
|
|
4
|
+
data.tar.gz: c0e60497b736faa3e1705fa19ff58e8c62f8eb0b57b1edb2c3f59cb7dabffb57
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bc07494fad4f0bf2dc03324a789c800ad1e2b620cc30a4ca26fbee73f97e0d17eec77fd00606843f67f20d990bd94678c617cf7e5aa74fce9accd6ef091c101f
|
|
7
|
+
data.tar.gz: 6f6e48f5b5c02610fa09c49e68b458d263ab7f57f653deaa26546a38ac0834368f70b401f1606da80783f7b77070fc9c3b9e12b6498c9a3b1d63681e6d377d67
|
data/AGENTS.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
## Using this SDK in your project
|
|
4
|
+
|
|
5
|
+
If you are writing code that integrates Worldline Direct with this SDK, read the agent skill
|
|
6
|
+
for this SDK version first and use the code it shows. Do not write SDK calls from memory.
|
|
7
|
+
|
|
8
|
+
- In this gem: `skills/worldline-direct/SKILL.md`
|
|
9
|
+
(gem folder: `bundle info onlinepayments-sdk-ruby --path`)
|
|
10
|
+
- Online: https://raw.githubusercontent.com/wl-online-payments-direct/sdk-ruby/12.0.0/skills/worldline-direct/SKILL.md
|
|
11
|
+
|
|
12
|
+
The skill matches SDK version 12.0.0. If your installed version is different, use the skill
|
|
13
|
+
from your installed gem.
|
|
14
|
+
|
|
15
|
+
## Working on this SDK
|
|
16
|
+
|
|
17
|
+
- SDK source: `lib/onlinepayments/sdk/`; unit tests: `spec/lib/`; integration tests: `spec/integration/`.
|
|
18
|
+
- Install the dependencies with `bundle install`.
|
|
19
|
+
- Run the unit tests with `bundle exec rake unit`, the integration tests with `bundle exec rake integration`, and both
|
|
20
|
+
with `bundle exec rake spec`. Check the code style with `bundle exec rake rubocop`.
|
|
21
|
+
- The integration tests need the environment variables `ONLINEPAYMENTS_API_KEY_ID`, `ONLINEPAYMENTS_SECRET_API_KEY`
|
|
22
|
+
and `ONLINEPAYMENTS_MERCHANT_ID` (optionally `ONLINEPAYMENTS_API_ENDPOINT`); they are skipped when one is missing.
|
|
23
|
+
Copy `.env.example` to `.env` to set them; the integration tests load it automatically.
|
|
24
|
+
- Generate the documentation with `bundle exec rake yard` (output in `doc/`).
|
|
25
|
+
- See `README.md` for details.
|
data/README.md
CHANGED
|
@@ -10,7 +10,7 @@ The Ruby SDK helps you to communicate with the payment platform server API. Its
|
|
|
10
10
|
* handling of all the details concerning authentication
|
|
11
11
|
* handling of required metadata
|
|
12
12
|
|
|
13
|
-
See the [Online Payments Developer Hub](https://
|
|
13
|
+
See the [Worldline Online Payments Developer Hub](https://docs.direct.worldline-solutions.com/documentation/sdk/server/ruby/) for more information on how to use the SDK.
|
|
14
14
|
|
|
15
15
|
## Structure of this repository
|
|
16
16
|
|
|
@@ -24,15 +24,26 @@ Note that the source code of the unit tests and integration tests can only be fo
|
|
|
24
24
|
|
|
25
25
|
## Requirements
|
|
26
26
|
|
|
27
|
-
Ruby
|
|
28
|
-
As for JRuby, version 9.0.0.0 and higher are supported.
|
|
29
|
-
In addition, the following packages are required:
|
|
27
|
+
Ruby 3.4 or higher is required. In addition, the following packages are required:
|
|
30
28
|
|
|
31
|
-
* [
|
|
32
|
-
* [concurrent-ruby](https://github.com/ruby-concurrency/concurrent-ruby) 1.
|
|
29
|
+
* [net-http-persistent](https://github.com/drbrain/net-http-persistent) 4.0 or higher
|
|
30
|
+
* [concurrent-ruby](https://github.com/ruby-concurrency/concurrent-ruby) 1.3 or higher
|
|
31
|
+
* [base64](https://github.com/ruby/base64) 0.2 or higher
|
|
32
|
+
|
|
33
|
+
These packages will be installed automatically if the SDK is installed following the below instructions.
|
|
33
34
|
|
|
34
35
|
## Installation
|
|
35
36
|
|
|
37
|
+
### Using Bundler
|
|
38
|
+
|
|
39
|
+
Add the SDK to the `Gemfile` of your project:
|
|
40
|
+
|
|
41
|
+
gem 'onlinepayments-sdk-ruby'
|
|
42
|
+
|
|
43
|
+
Then execute the following command:
|
|
44
|
+
|
|
45
|
+
bundle install
|
|
46
|
+
|
|
36
47
|
### Using RubyGems
|
|
37
48
|
|
|
38
49
|
To install the SDK using `gem`, execute the following command:
|
|
@@ -44,23 +55,46 @@ To install the SDK using `gem`, execute the following command:
|
|
|
44
55
|
1. Download the latest version of the Ruby SDK from GitHub. Choose the `onlinepayments-sdk-ruby-x.y.z.gem` file from the [releases](https://github.com/wl-online-payments-direct/sdk-ruby/releases) page, where `x.y.z` is the version number.
|
|
45
56
|
2. Navigate into the folder where the gem file is downloaded to, and execute the following command:
|
|
46
57
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
58
|
+
```
|
|
59
|
+
gem install onlinepayments-sdk-ruby-x.y.z.gem
|
|
60
|
+
```
|
|
61
|
+
|
|
50
62
|
3. Feel free to delete the gem file at this point, it is no longer required.
|
|
51
63
|
|
|
52
64
|
### From source
|
|
53
65
|
|
|
54
66
|
1. Download the latest version of the Ruby SDK from GitHub. Choose the `onlinepayments-sdk-ruby-x.y.z.zip` file from the [releases](https://github.com/wl-online-payments-direct/sdk-ruby/releases) page, where `x.y.z` is the version number.
|
|
55
|
-
1. Download the latest version of the Ruby SDK from GitHub. Choose the `onlinepayments-sdk-ruby-x.y.z.zip` file from the releases page of the Github repository, where `x.y.z` is the version number.
|
|
56
67
|
2. Unzip the file, navigate into the folder where the file is unzipped to, and execute the following commands:
|
|
57
68
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
69
|
+
```
|
|
70
|
+
gem build onlinepayments-sdk-ruby.gemspec
|
|
71
|
+
gem install onlinepayments-sdk-ruby-x.y.z.gem
|
|
72
|
+
```
|
|
73
|
+
|
|
62
74
|
3. Feel free to delete the unzipped archive, the zip file, and the gem file at this point; they are no longer required.
|
|
63
75
|
|
|
76
|
+
## Working with AI agents
|
|
77
|
+
|
|
78
|
+
The SDK comes with an agent skill for AI coding agents such as Claude Code, Codex, GitHub Copilot and Cursor. It tells the agent how to choose an integration method, which steps each flow needs, which rules every integration must follow, and gives code examples that are type-checked against this SDK version.
|
|
79
|
+
|
|
80
|
+
The skill for this version is available:
|
|
81
|
+
|
|
82
|
+
* online, as plain Markdown for agents: https://raw.githubusercontent.com/wl-online-payments-direct/sdk-ruby/12.0.0/skills/worldline-direct/SKILL.md
|
|
83
|
+
* online, on GitHub: https://github.com/wl-online-payments-direct/sdk-ruby/blob/12.0.0/skills/worldline-direct/SKILL.md
|
|
84
|
+
* in the installed gem: `skills/worldline-direct/` in the gem folder, e.g. `vendor/bundle/ruby/<ruby version>/gems/onlinepayments-sdk-ruby-<version>/skills/worldline-direct/` when Bundler installs into `vendor/bundle`. `bundle info onlinepayments-sdk-ruby --path` prints the gem folder; without Bundler, `gem contents onlinepayments-sdk-ruby | grep SKILL.md` prints the path of the skill.
|
|
85
|
+
* in this repository: `skills/worldline-direct/`
|
|
86
|
+
|
|
87
|
+
To make your agent use it, add this to the `AGENTS.md` or `CLAUDE.md` file of your project:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
For the Worldline Direct integration (onlinepayments-sdk-ruby), read and follow the agent skill
|
|
91
|
+
skills/worldline-direct/SKILL.md in the folder of the installed onlinepayments-sdk-ruby gem (bundle info onlinepayments-sdk-ruby --path)
|
|
92
|
+
(online: https://raw.githubusercontent.com/wl-online-payments-direct/sdk-ruby/12.0.0/skills/worldline-direct/SKILL.md)
|
|
93
|
+
Use the code shown in the skill; do not write SDK calls from memory.
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Agents that support the Agent Skills format can also load the folder directly, for example by copying `skills/worldline-direct/` from the gem folder to `.claude/skills/worldline-direct/` in your project for Claude Code.
|
|
97
|
+
|
|
64
98
|
## Uninstalling
|
|
65
99
|
|
|
66
100
|
After the Ruby SDK has been installed, it can be uninstalled using the
|
|
@@ -72,68 +106,142 @@ The required packages can be uninstalled in the same way.
|
|
|
72
106
|
|
|
73
107
|
## Usage
|
|
74
108
|
|
|
75
|
-
After the Ruby SDK has been installed, it can be required in Ruby program as follows:
|
|
109
|
+
After the Ruby SDK has been installed, it can be required in a Ruby program as follows:
|
|
110
|
+
|
|
111
|
+
```ruby
|
|
112
|
+
require 'onlinepayments/sdk'
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Creating a client
|
|
76
116
|
|
|
77
|
-
|
|
117
|
+
A client can be created from code, from environment variables or from a YAML file:
|
|
118
|
+
|
|
119
|
+
```ruby
|
|
120
|
+
client = OnlinePayments::SDK::Factory.create_client(
|
|
121
|
+
api_endpoint: 'https://payment.direct.ecom.preprod.worldline-solutions.com',
|
|
122
|
+
api_key_id: '...',
|
|
123
|
+
secret_api_key: '...',
|
|
124
|
+
integrator: 'MyShop',
|
|
125
|
+
connect_timeout: 10, # seconds
|
|
126
|
+
socket_timeout: 60 # seconds
|
|
127
|
+
# optional: max_connections, proxy_configuration, shopping_cart_extension
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
client = OnlinePayments::SDK::Factory.create_client_from_env
|
|
131
|
+
|
|
132
|
+
client = OnlinePayments::SDK::Factory.create_client_from_file('configuration.yml', 'api_key_id', 'secret_api_key')
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
`Factory.create_client_from_env` reads the following environment variables:
|
|
136
|
+
|
|
137
|
+
| Environment variable | Description |
|
|
138
|
+
|---|---|
|
|
139
|
+
| `ONLINEPAYMENTS_API_ENDPOINT` | Required. The API endpoint, for example `https://payment.direct.ecom.preprod.worldline-solutions.com` |
|
|
140
|
+
| `ONLINEPAYMENTS_API_KEY_ID` | Required. The API key id |
|
|
141
|
+
| `ONLINEPAYMENTS_SECRET_API_KEY` | Required. The secret API key |
|
|
142
|
+
| `ONLINEPAYMENTS_INTEGRATOR` | Required. The name of the integrator |
|
|
143
|
+
| `ONLINEPAYMENTS_CONNECT_TIMEOUT` | Required. The connect timeout in seconds |
|
|
144
|
+
| `ONLINEPAYMENTS_SOCKET_TIMEOUT` | Required. The socket timeout in seconds |
|
|
145
|
+
|
|
146
|
+
The merchant ID is not part of the client configuration; pass it to `client.merchant(merchant_id)`.
|
|
147
|
+
|
|
148
|
+
When a block is given, the client is passed to the block and closed at the end of the block.
|
|
149
|
+
Without a block, close the client with `client.close` when it is no longer needed.
|
|
150
|
+
|
|
151
|
+
```ruby
|
|
152
|
+
OnlinePayments::SDK::Factory.create_client_from_env do |client|
|
|
153
|
+
# use client as needed
|
|
154
|
+
end
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Creating requests
|
|
158
|
+
|
|
159
|
+
Domain objects accept their fields as keyword arguments:
|
|
160
|
+
|
|
161
|
+
```ruby
|
|
162
|
+
Domain = OnlinePayments::SDK::Domain
|
|
163
|
+
|
|
164
|
+
request = Domain::CreatePaymentRequest.new(
|
|
165
|
+
order: Domain::Order.new(amount_of_money: Domain::AmountOfMoney.new(amount: 125000, currency_code: 'EUR'))
|
|
166
|
+
)
|
|
167
|
+
response = client.merchant(merchant_id).payments.create_payment(request, OnlinePayments::SDK::CallContext.new('order-42'))
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Fields can also be set afterwards, with setters (`request.order = ...`) or with the fluent `with_*` methods
|
|
171
|
+
(`Domain::AmountOfMoney.new.with_amount(125000).with_currency_code('EUR')`).
|
|
172
|
+
An unknown keyword argument raises an `ArgumentError`.
|
|
173
|
+
Printing a domain object (`p`, `inspect`, `to_s`) shows its fields, with card numbers, CVVs and personal data masked.
|
|
174
|
+
|
|
175
|
+
### Handling errors
|
|
176
|
+
|
|
177
|
+
```ruby
|
|
178
|
+
begin
|
|
179
|
+
client.merchant(merchant_id).payments.create_payment(request, OnlinePayments::SDK::CallContext.new(idempotence_key))
|
|
180
|
+
rescue OnlinePayments::SDK::DeclinedPaymentException => e
|
|
181
|
+
# e.payment_result contains the declined payment
|
|
182
|
+
rescue OnlinePayments::SDK::ApiException => e
|
|
183
|
+
logger.error("Payment failed: #{e.message}") # the response body in the message is masked
|
|
184
|
+
# e.cause.headers contains the response headers
|
|
185
|
+
rescue OnlinePayments::SDK::Communication::CommunicationException => e
|
|
186
|
+
# e.cause contains the original error
|
|
187
|
+
end
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
A timeout, a `CommunicationException` or a `PlatformException` during `create_payment` means the outcome of the payment is unknown.
|
|
191
|
+
Check the payment status with `get_payment`, and always send an idempotence key so that a retry does not create a second payment.
|
|
192
|
+
|
|
193
|
+
The unmasked response body is available in `response_body`.
|
|
78
194
|
|
|
79
195
|
## Running tests
|
|
80
196
|
|
|
81
197
|
There are two types of tests: unit tests and integration tests. The unit tests will work out-of-the-box; for the integration tests some configuration is required.
|
|
82
198
|
First, some environment variables need to be set:
|
|
83
|
-
* `
|
|
84
|
-
* `
|
|
85
|
-
* `
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
In order to run the unit and integration tests, some additional dependencies are required:
|
|
199
|
+
* `ONLINEPAYMENTS_API_KEY_ID` for the API key id to use.
|
|
200
|
+
* `ONLINEPAYMENTS_SECRET_API_KEY` for the secret API key to use.
|
|
201
|
+
* `ONLINEPAYMENTS_MERCHANT_ID` for your merchant ID.
|
|
202
|
+
* Optionally, `ONLINEPAYMENTS_API_ENDPOINT` to use a different endpoint than `https://payment.direct.ecom.preprod.worldline-solutions.com`.
|
|
89
203
|
|
|
90
|
-
|
|
91
|
-
* [rspec](https://github.com/rspec/rspec) 3.5 or higher
|
|
92
|
-
* [webmock](https://github.com/bblimke/webmock) 2.1 or higher
|
|
93
|
-
* [sinatra](https://github.com/sinatra/sinatra) 2.1 or higher
|
|
94
|
-
* [webrick](https://github.com/ruby/webrick) 1.7 or higher
|
|
204
|
+
If any of the required variables is missing, the integration tests are skipped.
|
|
95
205
|
|
|
96
|
-
|
|
206
|
+
The file `.env.example` lists all variables. You can copy it to `.env` (which is ignored by git) and fill in your values.
|
|
207
|
+
The integration tests load `.env` automatically; variables that are already set in the environment take precedence.
|
|
97
208
|
|
|
98
|
-
|
|
209
|
+
To install the test dependencies, execute the following command from the root of the repository:
|
|
99
210
|
|
|
100
|
-
|
|
211
|
+
bundle install
|
|
101
212
|
|
|
102
|
-
The following commands can
|
|
213
|
+
The following commands can then be executed from the root of the repository to execute the tests:
|
|
103
214
|
|
|
104
215
|
* Unit tests:
|
|
105
216
|
|
|
106
217
|
```
|
|
107
|
-
rake unit
|
|
218
|
+
bundle exec rake unit
|
|
108
219
|
```
|
|
109
220
|
|
|
110
221
|
* Integration tests:
|
|
111
222
|
|
|
112
223
|
```
|
|
113
|
-
rake integration
|
|
224
|
+
bundle exec rake integration
|
|
114
225
|
```
|
|
115
226
|
|
|
116
227
|
* Both unit and integration tests:
|
|
117
228
|
|
|
118
229
|
```
|
|
119
|
-
rake spec
|
|
230
|
+
bundle exec rake spec
|
|
120
231
|
```
|
|
121
232
|
|
|
122
|
-
|
|
233
|
+
The code style of the hand-written code can be checked with the following command:
|
|
123
234
|
|
|
124
|
-
|
|
235
|
+
bundle exec rake rubocop
|
|
125
236
|
|
|
126
|
-
|
|
127
|
-
* [yard](https://github.com/lsegal/yard) 0.9.5 or higher
|
|
128
|
-
|
|
129
|
-
They can be installed using the following command:
|
|
237
|
+
## Generating documentation
|
|
130
238
|
|
|
131
|
-
|
|
239
|
+
Documentation can be generated with YARD. To install the required dependencies, execute the following command from the root of the repository:
|
|
132
240
|
|
|
133
|
-
|
|
241
|
+
bundle install
|
|
134
242
|
|
|
135
|
-
Once
|
|
243
|
+
Once the dependencies are installed, documentation can be generated with the following command (ran from the root folder):
|
|
136
244
|
|
|
137
|
-
rake yard
|
|
245
|
+
bundle exec rake yard
|
|
138
246
|
|
|
139
247
|
Documentation will be generated in the `/doc` folder. The file `/doc/index.html` is the main documentation file.
|
data/Rakefile
CHANGED
|
@@ -32,3 +32,11 @@ begin
|
|
|
32
32
|
rescue LoadError
|
|
33
33
|
puts '[*] error -- development dependency is not installed'
|
|
34
34
|
end
|
|
35
|
+
|
|
36
|
+
begin
|
|
37
|
+
require 'rubocop/rake_task'
|
|
38
|
+
|
|
39
|
+
RuboCop::RakeTask.new(:rubocop) # supports checking the hand-written code style using the command *rake* *rubocop*
|
|
40
|
+
rescue LoadError
|
|
41
|
+
puts '[*] error -- development dependency is not installed'
|
|
42
|
+
end
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
#
|
|
2
4
|
# This file was automatically generated.
|
|
3
5
|
#
|
|
4
6
|
require 'onlinepayments/sdk/domain/api_error'
|
|
7
|
+
require 'onlinepayments/sdk/logging/obfuscation/body_obfuscator'
|
|
5
8
|
|
|
6
9
|
module OnlinePayments
|
|
7
10
|
module SDK
|
|
@@ -42,10 +45,10 @@ module OnlinePayments
|
|
|
42
45
|
def to_s
|
|
43
46
|
str = super.to_s
|
|
44
47
|
if @status_code > 0
|
|
45
|
-
str +=
|
|
48
|
+
str += "; status_code=#{@status_code}"
|
|
46
49
|
end
|
|
47
50
|
if !@response_body.nil? && @response_body.length > 0
|
|
48
|
-
str += "; response_body='
|
|
51
|
+
str += "; response_body='#{OnlinePayments::SDK::Logging::Obfuscation::BodyObfuscator.default_obfuscator.obfuscate_body(@response_body)}'"
|
|
49
52
|
end
|
|
50
53
|
str.to_s
|
|
51
54
|
end
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'uri'
|
|
1
4
|
require 'onlinepayments/sdk/communication/request_header'
|
|
2
5
|
|
|
3
6
|
module OnlinePayments
|
|
@@ -8,7 +11,6 @@ module OnlinePayments
|
|
|
8
11
|
# @attr_reader [OnlinePayments::SDK::Communicator] communicator Communicator instance that provides communication with the Online Payments platform.
|
|
9
12
|
# @attr_reader [String] client_meta_info JSON string containing client info specific to the current client.
|
|
10
13
|
class ApiResource
|
|
11
|
-
|
|
12
14
|
# Creates a new ApiResource.
|
|
13
15
|
#
|
|
14
16
|
# @param parent [OnlinePayments::SDK::ApiResource] parent resource instance.
|
|
@@ -17,15 +19,15 @@ module OnlinePayments
|
|
|
17
19
|
# This hash will be used to instantiate a concrete URL used to access specific resources.
|
|
18
20
|
# @param client_meta_info [String] JSON string containing the metadata for the client.
|
|
19
21
|
def initialize(parent: nil, communicator: nil, path_context: nil, client_meta_info: nil)
|
|
20
|
-
raise ArgumentError
|
|
22
|
+
raise ArgumentError, 'parent and/or communicator is required' if parent.nil? && communicator.nil?
|
|
23
|
+
|
|
21
24
|
@parent = parent
|
|
22
25
|
@communicator = communicator.nil? ? parent.communicator : communicator
|
|
23
26
|
@path_context = path_context
|
|
24
|
-
@client_meta_info = client_meta_info || parent
|
|
27
|
+
@client_meta_info = client_meta_info || parent&.client_meta_info
|
|
25
28
|
end
|
|
26
29
|
|
|
27
|
-
attr_reader :communicator
|
|
28
|
-
attr_reader :client_meta_info
|
|
30
|
+
attr_reader :communicator, :client_meta_info
|
|
29
31
|
|
|
30
32
|
protected
|
|
31
33
|
|
|
@@ -45,9 +47,7 @@ module OnlinePayments
|
|
|
45
47
|
instantiate_uri(uri)
|
|
46
48
|
else
|
|
47
49
|
uri = replace_all(uri, @path_context)
|
|
48
|
-
unless @parent.nil?
|
|
49
|
-
uri = @parent.instantiate_uri(uri)
|
|
50
|
-
end
|
|
50
|
+
uri = @parent.instantiate_uri(uri) unless @parent.nil?
|
|
51
51
|
uri
|
|
52
52
|
end
|
|
53
53
|
end
|
|
@@ -55,13 +55,20 @@ module OnlinePayments
|
|
|
55
55
|
private
|
|
56
56
|
|
|
57
57
|
def replace_all(uri, path_context)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
end
|
|
58
|
+
path_context&.each do |key, value|
|
|
59
|
+
encoded = encode_path_segment(key, value)
|
|
60
|
+
uri = uri.gsub("{#{key}}") { encoded }
|
|
62
61
|
end
|
|
63
62
|
uri
|
|
64
63
|
end
|
|
64
|
+
|
|
65
|
+
def encode_path_segment(key, value)
|
|
66
|
+
segment = value.to_s
|
|
67
|
+
raise ArgumentError, "#{key} is required" if value.nil? || segment.empty?
|
|
68
|
+
raise ArgumentError, "#{key} must not be '#{segment}'" if %w[. ..].include?(segment)
|
|
69
|
+
|
|
70
|
+
URI.encode_uri_component(segment)
|
|
71
|
+
end
|
|
65
72
|
end
|
|
66
73
|
end
|
|
67
74
|
end
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module OnlinePayments
|
|
2
4
|
module SDK
|
|
3
5
|
module Authentication
|
|
4
6
|
# Abstract class that is responsible for authenticating requests sent to the Online Payments platform.
|
|
5
7
|
class Authenticator
|
|
6
|
-
|
|
7
8
|
# Returns a value that can be used for the "Authorization" header.
|
|
8
9
|
#
|
|
9
10
|
# @param http_method [String] 'GET', 'PUT', 'POST' or 'DELETE' indicating which HTTP method will be used with the request
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module OnlinePayments
|
|
2
4
|
module SDK
|
|
3
5
|
module Authentication
|
|
4
6
|
# Contains all authentication schemes supported by the Online Payments platform.
|
|
5
7
|
class AuthorizationType
|
|
6
|
-
V1HMAC =
|
|
8
|
+
V1HMAC = 'v1HMAC'
|
|
7
9
|
|
|
8
10
|
# @return [String] the authorization string that belongs to the parameter _authorization_, or _nil_ if not found.
|
|
9
11
|
def self.get_authorization(authorization)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'openssl'
|
|
2
4
|
require 'base64'
|
|
3
5
|
|
|
@@ -10,26 +12,27 @@ module OnlinePayments
|
|
|
10
12
|
module Authentication
|
|
11
13
|
# Authenticates requests made to the Online Payments platform using V1Hmac.
|
|
12
14
|
class V1HmacAuthenticator < Authenticator
|
|
13
|
-
|
|
14
15
|
# HMAC algorithm used to generate the signature
|
|
15
|
-
HMAC_ALGOR = 'SHA256'
|
|
16
|
-
CONTENT_TYPE = 'Content-Type'
|
|
17
|
-
DATE = 'Date'
|
|
18
|
-
XGCS = 'X-GCS'
|
|
16
|
+
HMAC_ALGOR = 'SHA256'
|
|
17
|
+
CONTENT_TYPE = 'Content-Type'
|
|
18
|
+
DATE = 'Date'
|
|
19
|
+
XGCS = 'X-GCS'
|
|
19
20
|
XGCS_LOWER = XGCS.downcase.freeze
|
|
20
21
|
|
|
21
22
|
# Constructs a new V1HmacAuthenticator instance using the provided CommunicatorConfiguration.
|
|
22
23
|
#
|
|
23
24
|
# @param communicator_configuration [OnlinePayments::SDK::CommunicatorConfiguration] The configuration object
|
|
24
|
-
# containing the V1Hmac authorization id and authorization secret
|
|
25
|
-
#
|
|
26
|
-
# and the timeout values must be positive.
|
|
25
|
+
# containing the V1Hmac authorization id and authorization secret.
|
|
26
|
+
# Neither of these can be _nil_ or empty.
|
|
27
27
|
def initialize(communicator_configuration)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
super()
|
|
29
|
+
api_key_id = communicator_configuration.api_key_id
|
|
30
|
+
secret_api_key = communicator_configuration.secret_api_key
|
|
31
|
+
raise ArgumentError, 'api_key_id is required' unless api_key_id && !api_key_id.strip.empty?
|
|
32
|
+
raise ArgumentError, 'secret_api_key is required' unless secret_api_key && !secret_api_key.strip.empty?
|
|
33
|
+
|
|
34
|
+
@api_key_id = api_key_id
|
|
35
|
+
@secret_api_key = secret_api_key
|
|
33
36
|
@authorization_type = communicator_configuration.authorization_type
|
|
34
37
|
end
|
|
35
38
|
|
|
@@ -62,17 +65,16 @@ module OnlinePayments
|
|
|
62
65
|
http_headers&.each do |header|
|
|
63
66
|
name = header.name
|
|
64
67
|
value = header.value
|
|
65
|
-
|
|
66
|
-
when name.casecmp(CONTENT_TYPE).zero?
|
|
68
|
+
if name.casecmp(CONTENT_TYPE).zero?
|
|
67
69
|
content_type = value
|
|
68
|
-
|
|
70
|
+
elsif name.casecmp(DATE).zero?
|
|
69
71
|
date = value
|
|
70
|
-
|
|
72
|
+
elsif to_canonical_header_name(name).start_with?(XGCS_LOWER)
|
|
71
73
|
xgc_http_headers << [to_canonical_header_name(name), to_canonical_header_value(value)]
|
|
72
74
|
end
|
|
73
75
|
end
|
|
74
76
|
|
|
75
|
-
xgc_http_headers.sort! { |(h1,
|
|
77
|
+
xgc_http_headers.sort! { |(h1, _v1), (h2, _v2)| h1 <=> h2 } unless xgc_http_headers.empty?
|
|
76
78
|
|
|
77
79
|
data = "#{http_method.upcase}\n#{content_type}\n#{date}\n"
|
|
78
80
|
data << xgc_http_headers.inject('') { |s, (k, v)| "#{s}#{k}:#{v}\n" } unless xgc_http_headers.empty?
|
|
@@ -89,9 +91,10 @@ module OnlinePayments
|
|
|
89
91
|
|
|
90
92
|
private
|
|
91
93
|
|
|
92
|
-
# Returns the URI path without the HTTP method and including all
|
|
94
|
+
# Returns the URI path without the HTTP method and including all query parameters, encoded as they are sent.
|
|
93
95
|
def to_canonical_resource(resource_uri)
|
|
94
96
|
return "#{resource_uri.path}?#{resource_uri.query}" if resource_uri.query
|
|
97
|
+
|
|
95
98
|
resource_uri.path
|
|
96
99
|
end
|
|
97
100
|
|
|
@@ -102,6 +105,7 @@ module OnlinePayments
|
|
|
102
105
|
# Strips a header value of excess whitespace to produce a canonical value
|
|
103
106
|
def to_canonical_header_value(original_value)
|
|
104
107
|
return '' unless original_value
|
|
108
|
+
|
|
105
109
|
original_value.gsub(/\r?\n[\s&&[^\r\n]]*/, ' ').strip
|
|
106
110
|
end
|
|
107
111
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'date'
|
|
2
4
|
|
|
3
5
|
module OnlinePayments
|
|
@@ -19,18 +21,12 @@ module OnlinePayments
|
|
|
19
21
|
# @attr [DateTime] idempotence_response_date_time If two or more requests arrive at the Online Payments platform with the same _idempotence_key_,
|
|
20
22
|
# the _idempotence_response_date_time_ will be set to the response date/time of the first response.
|
|
21
23
|
class CallContext
|
|
22
|
-
@idempotence_key = nil
|
|
23
|
-
@idempotence_request_timestamp = nil
|
|
24
|
-
@idempotence_response_date_time = nil
|
|
25
|
-
|
|
26
24
|
def initialize(idempotence_key = nil)
|
|
27
25
|
@idempotence_key = idempotence_key
|
|
28
26
|
end
|
|
29
27
|
|
|
30
28
|
attr_reader :idempotence_key
|
|
31
|
-
attr_accessor :idempotence_request_timestamp
|
|
32
|
-
attr_accessor :idempotence_response_date_time
|
|
33
|
-
attr_accessor :gzip
|
|
29
|
+
attr_accessor :idempotence_request_timestamp, :idempotence_response_date_time, :gzip
|
|
34
30
|
end
|
|
35
31
|
end
|
|
36
32
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
#
|
|
2
4
|
# This file was automatically generated.
|
|
3
5
|
#
|
|
@@ -48,7 +50,8 @@ module OnlinePayments
|
|
|
48
50
|
end
|
|
49
51
|
end
|
|
50
52
|
|
|
51
|
-
#
|
|
53
|
+
# Sets the idle timeout for pooled connections. Connections are closed lazily
|
|
54
|
+
# after being idle longer than _idle_time_ seconds.
|
|
52
55
|
def close_idle_connections(idle_time)
|
|
53
56
|
@communicator.close_idle_connections(idle_time)
|
|
54
57
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module OnlinePayments
|
|
2
4
|
module SDK
|
|
3
5
|
module Communication
|
|
@@ -6,7 +8,6 @@ module OnlinePayments
|
|
|
6
8
|
#
|
|
7
9
|
# @attr [Exception] cause The error that is the cause of this error.
|
|
8
10
|
class CommunicationException < RuntimeError
|
|
9
|
-
|
|
10
11
|
def initialize(cause)
|
|
11
12
|
super()
|
|
12
13
|
@cause = cause
|