{"id":21578251,"url":"https://github.com/wallee-payment/ruby-sdk","last_synced_at":"2025-04-10T17:33:22.056Z","repository":{"id":54529283,"uuid":"97002447","full_name":"wallee-payment/ruby-sdk","owner":"wallee-payment","description":"The ruby SDK allows an easy integration of wallee into ruby applications.","archived":false,"fork":false,"pushed_at":"2024-02-12T14:01:40.000Z","size":2413,"stargazers_count":4,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-24T15:11:14.551Z","etag":null,"topics":["payment","payment-integration","ruby","ruby-sdk","rubygem","wallee"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wallee-payment.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-07-12T11:59:29.000Z","updated_at":"2023-01-25T13:14:27.000Z","dependencies_parsed_at":"2024-02-17T17:15:15.240Z","dependency_job_id":null,"html_url":"https://github.com/wallee-payment/ruby-sdk","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallee-payment%2Fruby-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallee-payment%2Fruby-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallee-payment%2Fruby-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallee-payment%2Fruby-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wallee-payment","download_url":"https://codeload.github.com/wallee-payment/ruby-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248261993,"owners_count":21074229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["payment","payment-integration","ruby","ruby-sdk","rubygem","wallee"],"created_at":"2024-11-24T13:09:58.998Z","updated_at":"2025-04-10T17:33:22.008Z","avatar_url":"https://github.com/wallee-payment.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wallee Ruby Library\n\nThe wallee Ruby library wraps around the wallee API. This library facilitates your interaction with various services such as transactions, accounts, and subscriptions.\n\n## Documentation\n\n[wallee Web Service API](https://app-wallee.com/doc/api/web-service)\n\n## Requirements\n\n- Ruby 3.0.0+\n\n## Installation\n\n# RubyGem install (recommended)\n\n```sh\n$ gem install wallee-ruby-sdk\n```\n\n## Usage\nThe library needs to be configured with your account's space id, user id, and secret key which are available in your [wallee\naccount dashboard](https://app-wallee.com/account/select). Set `space_id`, `user_id`, and `api_secret` to their values. You can also optionally set `default_headers` to set some headers that will be sent to all requests:\n\n### Configuring a Service\n\n```ruby\nrequire 'wallee-ruby-sdk'\n\nspace_id = 405\napp_user_id = 512\napp_user_key = \"FKrO76r5VwJtBrqZawBspljbBNOxp5veKQQkOnZxucQ=\"\n\n# default_headers is an optional param, that represents headers sent to all requests\n# timeout is an optional param, that allows to configure custom timeout (default is 25 seconds)\nWallee.configure do |config|\n  config.user_id = app_user_id\n  config.authentication_key = app_user_key\n  config.default_headers = {\"x-meta-custom-header\": 'value-1', \"x-meta-custom-header-2\": 'value-2'}\n  config.timeout = 60\nend\n\n# TransactionService\ntransaction_service = Wallee::TransactionService.new\n# TransactionPaymentPageService\ntransaction_payment_page_service = Wallee::TransactionPaymentPageService.new\n```\n\nTo get stated with sending transactions you can review the example below:\n\n```ruby\nrequire 'wallee-ruby-sdk'\n\nspace_id = 405\napp_user_id = 512\napp_user_key = \"FKrO76r5VwJtBrqZawBspljbBNOxp5veKQQkOnZxucQ=\"\n\n# timeout is an optional param, that allows to configure custom timeout (default is 25 seconds)\nWallee.configure do |config|\n    config.user_id = app_user_id\n    config.authentication_key = app_user_key\n    config.timeout = 60\nend\n\n# TransactionService\ntransaction_service = Wallee::TransactionService.new\n# TransactionPaymentPageService\ntransaction_payment_page_service = Wallee::TransactionPaymentPageService.new\n\ntransaction = Wallee::TransactionCreate.new({\n    billingAddress: Wallee::AddressCreate.new({\n        city: \"City\",\n        country: \"US\",\n        emailAddress: \"billing@address.com\",\n        familyName: \"Family\",\n        givenName: \"Given\",\n        postCode: \"98100\",\n        postalState: \"WA\",\n        street: \"Street\"\n    }),\n    currency: 'EUR',\n    customerEmailAddress: \"test@example.com\",\n    customerPresence: Wallee::CustomersPresence::VIRTUAL_PRESENT,\n    failedUrl: \"http://localhost/failure\",\n    invoiceMerchantReference: \"order-1\",\n    language: \"en_US\",\n    lineItems: [\n        Wallee::LineItemCreate.new({\n            amountIncludingTax: 29.60,\n            name: \"Item 1\",\n            quantity: 1,\n            shippingRequired: true,\n            sku: \"sku-1\",\n            taxes: [\n                Wallee::TaxCreate.new({\n                    rate: 8,\n                    title: \"VAT\"\n                })\n            ],\n            type: Wallee::LineItemType::PRODUCT,\n            uniqueId: \"unique-id-item-1\",\n        }),\n        Wallee::LineItemCreate.new({\n            amountIncludingTax: 5.60,\n            name: \"Test Shipping\",\n            quantity: 1,\n            shippingRequired: false,\n            sku: \"test-shipping\",\n            taxes: [\n                Wallee::TaxCreate.new({\n                    rate: 8,\n                    title: \"VAT\"\n                })\n            ],\n            type: Wallee::LineItemType::SHIPPING,\n            uniqueId: \"unique-id-shipping-1\",\n        }),\n    ],\n    merchantReference: \"order-1\",\n    shippingAddress: Wallee::AddressCreate.new({\n        city: \"City\",\n        country: \"US\",\n        emailAddress: \"shipping@address.com\",\n        familyName: \"Family\",\n        givenName: \"Given\",\n        postCode: \"98100\",\n        postalState: \"WA\",\n        street: \"Street\"\n    }),\n    shippingMethod: \"Test Shipping\",\n    successUrl: \"http://localhost/success\"\n})\n\ntransaction = transaction_service.create(space_id, transaction)\npayment_page_url = transaction_payment_page_service.payment_page_url(space_id, transaction.id)\n# redirect to payment_page_url\n```\n\n### Integrating Webhook Payload Signing Mechanism into webhook callback handler\n\nThe HTTP request which is sent for a state change of an entity now includes an additional field `state`, which provides information about the update of the monitored entity's state. This enhancement is a result of the implementation of our webhook encryption mechanism.\n\nPayload field `state` provides direct information about the state update of the entity, making additional API calls to retrieve the entity state redundant.\n\n#### ⚠️ Warning: Generic Pseudocode\n\n\u003e **The provided pseudocode is intentionally generic and serves to illustrate the process of enhancing your API to leverage webhook payload signing. It is not a complete implementation.**\n\u003e\n\u003e Please ensure that you adapt and extend this code to meet the specific needs of your application, including appropriate security measures and error handling.\nFor a detailed webhook payload signing mechanism understanding we highly recommend referring to our comprehensive\n[Webhook Payload Signing Documentation](https://app-wallee.com/doc/webhooks#_webhook_payload_signing_mechanism).\n\n```ruby\npost '/webhook/callback' do\n    request_payload = request.body.read\n    signature = request.env['HTTP_X_SIGNATURE']\n\n    if signature.nil? || signature.empty?\n        # Make additional API call to retrieve the entity state\n        # ...\n    else\n        if webhook_encryption_service.is_content_valid(signature, request_payload)\n            # Parse request_payload to extract 'state' value\n            # Process entity's state change\n            # ...\n        end\n    end\n\n    # Process the received webhook data\n    # ...\nend\n```\n\n## License\n\nPlease see the [license file](https://github.com/wallee-payment/ruby-sdk/blob/master/LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwallee-payment%2Fruby-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwallee-payment%2Fruby-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwallee-payment%2Fruby-sdk/lists"}