{"id":21578230,"url":"https://github.com/wallee-payment/csharp-sdk","last_synced_at":"2025-04-10T17:30:18.427Z","repository":{"id":21811224,"uuid":"94104754","full_name":"wallee-payment/csharp-sdk","owner":"wallee-payment","description":"The C# SDK allows an easy integration of wallee into C# and .net applications.","archived":false,"fork":false,"pushed_at":"2024-05-14T22:19:06.000Z","size":3260,"stargazers_count":8,"open_issues_count":1,"forks_count":4,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-12T18:14:25.441Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","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,"publiccode":null,"codemeta":null}},"created_at":"2017-06-12T14:21:09.000Z","updated_at":"2023-11-30T18:23:28.000Z","dependencies_parsed_at":"2023-12-22T15:49:17.819Z","dependency_job_id":"ff03dc68-394f-4126-81ef-7e2a58862c63","html_url":"https://github.com/wallee-payment/csharp-sdk","commit_stats":{"total_commits":81,"total_committers":17,"mean_commits":4.764705882352941,"dds":0.691358024691358,"last_synced_commit":"5e15031b3629eb89984ea4e70fa035902548126d"},"previous_names":["wallee-payment/wallee-csharp-sdk"],"tags_count":65,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallee-payment%2Fcsharp-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallee-payment%2Fcsharp-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallee-payment%2Fcsharp-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallee-payment%2Fcsharp-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wallee-payment","download_url":"https://codeload.github.com/wallee-payment/csharp-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226165742,"owners_count":17583856,"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":[],"created_at":"2024-11-24T13:09:55.422Z","updated_at":"2025-04-10T17:30:18.419Z","avatar_url":"https://github.com/wallee-payment.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wallee C# Library\n\nThe wallee C# library wraps around the wallee API. This library facilitates your interaction with various services such as transactions, accounts, and subscriptions.\n\n\n## Documentation\n\n[wallee Web Service API](https://app-wallee.com/doc/api/web-service)\n\n\n\u003ca name=\"frameworks-supported\"\u003e\u003c/a\u003e\n## Frameworks supported\n- .NET 8.0 or later\n\n\u003ca name=\"dependencies\"\u003e\u003c/a\u003e\n## Dependencies\n- [RestSharp](https://www.nuget.org/packages/RestSharp) - 112.1.0\n- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 13.0.3\n- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 2.0.1\n- [BouncyCastle.Cryptography](https://www.nuget.org/packages/BouncyCastle.Cryptography/) - 2.3.1\n\nThe DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages:\n```\nInstall-Package RestSharp\nInstall-Package Newtonsoft.Json\nInstall-Package JsonSubTypes\nInstall-Package BouncyCastle.Cryptography\n```\n\n\n\u003ca name=\"installation\"\u003e\u003c/a\u003e\n## Installation\n```\n# Package Manager\nInstall-Package Wallee -Version 8.3.0\n# .NET CLI\ndotnet add package Wallee --version 8.3.0\n# Paket CLI\npaket add Wallee --version 8.3.0\n# PackageReference\n\u003cPackageReference Include=\"Wallee\" Version=\"8.3.0\" /\u003e\n```\n\nThen include the DLL (under the `bin` folder) in the C# project, and use the namespaces:\n```csharp\nusing Wallee.Service;\nusing Wallee.Client;\nusing Wallee.Model;\n```\n\n\u003ca name=\"getting-started\"\u003e\u003c/a\u003e\n## Getting Started\nInstantiate a configuration like so:\n```csharp\nnew Configuration(this.applicationUserID, this.authenticationKey)\n```\nOr if you want to customize the RestSharp client that's being used underneath (e.g. set the proxy), use the overloaded constructor:\n```csharp\nnew Configuration(this.applicationUserID, this.authenticationKey, new RestClientOptions()\n{\n    Proxy = new WebProxy(\"http://example.com\")\n});\n```\n\nRequest Timeout (in seconds) is customizable separately via the ```Configuration.TimeOut``` property.\n\n```csharp\nusing System;\nusing System.Configuration;\nusing System.Collections.Generic;\n\nusing NUnit.Framework;\n\nusing Wallee.Model;\nusing Wallee.Service;\nusing Wallee.Client;\n\nnamespace Wallee.Test\n{\n    /// \u003csummary\u003e\n    ///  Class for testing TransactionService.\n    /// \u003c/summary\u003e\n    [TestFixture]\n    public class TransactionPaymentPageServiceTest\n    {\n        private TransactionService transactionService;\n        private TransactionCreate transactionCreate;\n        private Configuration configuration;\n        private long spaceId;\n        private string applicationUserID;\n        private string authenticationKey;\n        private ApiResponse\u003cTransaction\u003e transaction;\n\n        /// \u003csummary\u003e\n        /// Setup before each unit test.\n        /// \u003c/summary\u003e\n        [SetUp]\n        public void SetUpTest()\n        {\n            this.spaceId = 405;\n            this.authenticationKey = \"FKrO76r5VwJtBrqZawBspljbBNOxp5veKQQkOnZxucQ=\";\n            this.applicationUserID = \"512\";\n            this.configuration = new Configuration(this.applicationUserID, this.authenticationKey);\n            this.transactionService = new TransactionService(configuration);\n            this.CreateTransaction();\n        }\n\n        private void CreateTransaction() {\n\n            AddressCreate billingAddress = new AddressCreate();\n            billingAddress.Salutation = \"Ms\";\n            billingAddress.GivenName = \"Good\";\n            billingAddress.FamilyName = \"Customer\";\n            billingAddress.Gender = Gender.FEMALE;\n            billingAddress.Country = \"CH\";\n            billingAddress.City = \"Winterthur\";\n            billingAddress.PostCode = \"8400\";\n            billingAddress.DateOfBirth = new DateTime(1988, 4, 19);\n            billingAddress.OrganizationName = \"Test GmbH\";\n            billingAddress.MobilePhoneNumber = \"+41791234567\";\n            billingAddress.EmailAddress = \"test@example.com\";\n\n            LineItemCreate lineItem1 = new LineItemCreate(\n                name: \"Item 1\",\n                uniqueId: \"unique-id-item-1\",\n                type: LineItemType.PRODUCT,\n                quantity: 1,\n                amountIncludingTax: (decimal) 67.47\n            );\n            lineItem1.Sku = \"item-1\";\n            lineItem1.ShippingRequired = true;\n\n            this.transactionCreate = new TransactionCreate(new List\u003cLineItemCreate\u003e() { lineItem1 });\n            this.transactionCreate.BillingAddress = billingAddress;\n            this.transactionCreate.ShippingAddress = billingAddress;\n            this.transactionCreate.CustomerEmailAddress = billingAddress.EmailAddress;\n            this.transactionCreate.CustomerId = \"cutomer-x\";\n            this.transactionCreate.MerchantReference = Guid.NewGuid().ToString();\n            this.transactionCreate.InvoiceMerchantReference = \"order-1\";\n            this.transactionCreate.SuccessUrl = \"http://localhost/success?orderId=1\";\n            this.transactionCreate.FailedUrl = \"http://localhost/failed?orderId=1\";\n            this.transactionCreate.ShippingMethod = \"Test Shipping\";\n            this.transactionCreate.ChargeRetryEnabled = false;\n            this.transactionCreate.AllowedPaymentMethodConfigurations = new List\u003clong?\u003e() { 8656L };\n            this.transactionCreate.Language = \"en-US\";\n            this.transactionCreate.Currency = \"CHF\";\n\n            try\n            {\n                this.transaction = this.transactionService.CreateWithHttpInfo(\n                    this.spaceId,\n                    this.transactionCreate\n                );\n            } catch (ApiException e){\n                Assert.Fail(\"Failed to create transaction. Reason: \" + e.Message + \" Details: \" + e.ErrorContent);\n            }\n\n        }\n\n        /// \u003csummary\u003e\n        /// Test transaction creation.\n        /// \u003c/summary\u003e\n        [Test]\n        public void TestPaymentPageUrl() {\n        // If needed configure configure a custom timeout. (Default is 25 seconds)\n        this.configuration.Timeout = 30;\n        TransactionPaymentPageService transactionPaymentPageService = new TransactionPaymentPageService(this.configuration);\n            String paymentPageUrl     = null;\n            try {\n                paymentPageUrl = transactionPaymentPageService.PaymentPageUrl(this.spaceId, this.transaction.Data.Id);\n            } catch (ApiException e) {\n                Console.WriteLine(e.ToString());\n            }\n            Console.WriteLine(paymentPageUrl);\n            Assert.IsTrue(paymentPageUrl.Contains(\"http\"));\n        }\n    }\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```csharp\n...\n    [HttpPost(\"callback\")]\n    public IActionResult HandleWebhook([FromBody] string requestPayload)\n    {\n        var signature = Request.Headers[\"x-signature\"];\n\n        if (string.IsNullOrEmpty(signature))\n        {\n            // Make additional API call to retrieve the entity state\n            // ...\n        }\n        else\n        {\n            if (webhookEncryptionService().isContentValid(signature, requestPayload))\n            {\n                // Parse requestPayload to extract 'state' value\n                // Process entity's state change\n                // ...\n            }\n        }\n\n        // Process the received webhook data\n        // ...\n    }\n...\n```\n\n\n## License\n\nPlease see the [license file](https://github.com/wallee-payment/csharp-sdk/blob/master/LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwallee-payment%2Fcsharp-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwallee-payment%2Fcsharp-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwallee-payment%2Fcsharp-sdk/lists"}