{"id":44582693,"url":"https://github.com/mirotechteam/rasedi-c-sharp-sdk","last_synced_at":"2026-05-14T08:02:23.237Z","repository":{"id":314064251,"uuid":"1016073623","full_name":"MirotechTeam/rasedi-c-sharp-sdk","owner":"MirotechTeam","description":"Build desktop, web, or backend integrations for Rasedi using C#. Ideal for Windows-based solutions and enterprise-level systems.","archived":false,"fork":false,"pushed_at":"2026-05-10T09:05:00.000Z","size":48,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-10T11:17:42.518Z","etag":null,"topics":["csharp","iraq","kurdistan","netcore","payment-gateway","payment-integration","paymetn","rasedi","sdk"],"latest_commit_sha":null,"homepage":"https://rasedi.com","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MirotechTeam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-08T12:57:53.000Z","updated_at":"2026-05-10T09:05:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"68de75cf-1519-4d5d-b801-9348ae00ca34","html_url":"https://github.com/MirotechTeam/rasedi-c-sharp-sdk","commit_stats":null,"previous_names":["mirotechteam/miropay-c-sharp-sdk","mirotechteam/rasedi-c-sharp-sdk"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/MirotechTeam/rasedi-c-sharp-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MirotechTeam%2Frasedi-c-sharp-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MirotechTeam%2Frasedi-c-sharp-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MirotechTeam%2Frasedi-c-sharp-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MirotechTeam%2Frasedi-c-sharp-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MirotechTeam","download_url":"https://codeload.github.com/MirotechTeam/rasedi-c-sharp-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MirotechTeam%2Frasedi-c-sharp-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33015817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["csharp","iraq","kurdistan","netcore","payment-gateway","payment-integration","paymetn","rasedi","sdk"],"created_at":"2026-02-14T05:56:17.225Z","updated_at":"2026-05-14T08:02:23.231Z","avatar_url":"https://github.com/MirotechTeam.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# C#.NET SDK\n\nA lightweight SDK for interacting with the Rasedi Payment API, built on top of [HttpClient in System.Net.Http and System.Net.Http.Headers] for fast, native HTTP calls and private key-based request signing.\n\n---\n\n## 📦 Installation\n\n```bash\ndotnet add package RasediSDK --version x.x.x\n```\n\n---\n\n## 🚀 Usage\n\n```C#\nusing RasediSDK.Rest;\nusing RasediSDK.Rest.Enums;\nusing RasediSDK.Rest.Interfaces;\nusing RasediSDK.Exceptions;\n\nvar client = new PaymentRestClient(privateKey, secretKey);\n```\n\n\u003e **Note:**  \n\u003e Switching between sandbox and production mode will be automatically based on (test) and (live) keyword inside secretKey `(test = sandbox mode, live = production mode)`.\n\n---\n\n## 🔐 Authentication\n\nThe SDK uses a private key and a secret to sign every request with HMAC. Signature logic is handled internally.\n\n---\n\n## 🧪 Example\n\n```C#\nstring privateKey = `-----BEGIN ENCRYPTED PRIVATE KEY-----\n...\n-----END ENCRYPTED PRIVATE KEY-----`;\n\nstring secretKey = \"live_xxx...\"; // or \"test_xxx...\"\n\nvar client = new PaymentRestClient(privateKey, secretKey);\n```\n\n---\n\n## 📘 API Reference\n\n#### `new PaymentRestClient(string privateKey, string secretKey)`\n\nCreates a new client instance.\n\n---\n\n#### `async Task\u003cICreatePaymentResponse\u003e CreatePaymentAsync(ICreatePayment payload)`\n\nCreates a new payment session.\n\n**Hint:** The `amount` parameter cannot be a decimal value.\n\n**Parameters:**\n\n```C#\nnew CreatePayment\n{\n    string amount; // e.g. \"1000\"\n    GateWays[] gateways; // e.g. [GateWays.ZAIN, GateWays.FIB]\n    string title;\n    string description;\n    string redirectUrl;\n    string callbackUrl;\n    bool collectFeeFromCustomer;\n    bool collectCustomerEmail;\n    bool collectCustomerPhoneNumber;\n}\n```\n\n**Returns:**\n\n```C#\nnew CreatePaymentResponse\n    {\n      StatusCode = response.StatusCode,\n      Body = response.Body,\n      Headers = response.Headers\n    };\n```\n\n**Example:**\n\n```C#\nawait client.CreatePaymentAsync( new CreatePayment {\n  amount: \"1000\",\n  gateways: [GateWays.FIB],\n  title: \"Test\",\n  description: \"Desc\",\n  redirectUrl: \"https://google.com\",\n  callbackUrl: \"https://google.com\",\n  collectFeeFromCustomer: false,\n  collectCustomerEmail: false,\n  collectCustomerPhoneNumber: false,\n});\n```\n\n---\n\n#### `async Task\u003cIPaymentDetailsResponse\u003e GetPaymentByIdAsync(string referenceCode)`\n\nGets the details of a payment.\n\n**Returns:**\n\n```C#\nnew PaymentDetailsResponse\n  {\n    StatusCode = response.StatusCode,\n    Body = response.Body,\n    Headers = response.Headers\n  };\n```\n\n**Example:**\n\n```C#\nvar status = await client.GetPaymentByIdAsync(\"your-reference-code\");\nConsole.WriteLine(status.body.status);\n```\n\n---\n\n#### `async Task\u003cICancelPaymentResponse\u003e CancelPaymentAsync(string referenceCode)`\n\nCancels an existing payment.\n\n**Example:**\n\n```C#\nawait client.CancelPaymentAsync(\"your-reference-code\");\n```\n\n**Returns:**\n\n```C#\nnew CancelPaymentResponse\n  {\n    StatusCode = response.StatusCode,\n    Body = response.Body,\n    Headers = response.Headers\n  };\n```\n\n---\n#### `Using RasediSDK.Exception to catch different type of exception`\n\nThe exceptions help you to catch more specific and error-related issues.\n\n**Example:**\n\n```C#\ntry\n  {\n      // 1. Try to get a public key by ID\n      ...................................\n\n      // 2. Validate payload content\n      ...................................\n\n      // 3. More SDK calls...............\n  }\n  catch (PublicKeyNotFoundException ex)\n  {\n      Console.WriteLine(\"Handle missing key specifically: \" + ex.Message);\n  }\n  catch (InvalidPayloadException ex)\n  {\n      Console.WriteLine(\"Handle invalid payload specifically: \" + ex.Message);\n  }\n  catch (JwtValidationException ex)\n  {\n      Console.WriteLine(\"Handle JWT validation errors: \" + ex.Message);\n  }\n  catch (PayloadDeserializationException ex)\n  {\n      Console.WriteLine(\"Handle deserialization errors: \" + ex.Message);\n  }\n  catch (PemFormatException ex)\n  {\n      Console.WriteLine(\"Handle PEM format errors: \" + ex.Message);\n  }\n  catch (RasediException ex)\n  {\n      // Catch any other SDK-related errors not explicitly caught above\n      Console.WriteLine(\"General Rasedi SDK error: \" + ex.Message);\n  }\n  catch (Exception ex)\n  {\n      // Catch unexpected errors not related to SDK\n      Console.WriteLine(\"Unexpected error: \" + ex.Message);\n  }\n```\n\n---\n\n## 🏷️ Types\n\n```C#\npublic enum GateWays\n{\n    [EnumMember(Value = \"FIB\")]\n    FIB,\n\n    [EnumMember(Value = \"ZAIN\")]\n    ZAIN,\n\n    [EnumMember(Value = \"ASIA_PAY\")]\n    ASIA_PAY,\n\n    [EnumMember(Value = \"FAST_PAY\")]\n    FAST_PAY,\n\n    [EnumMember(Value = \"NASS_WALLET\")]\n    NASS_WALLET,\n\n    [EnumMember(Value = \"CREDIT_CARD\")]\n    CREDIT_CARD\n}\n```\n```\npublic enum PaymentStatuses\n{\n    [EnumMember(Value = \"TIMED_OUT\")]\n    TIMED_OUT,\n\n    [EnumMember(Value = \"PENDING\")]\n    PENDING,\n\n    [EnumMember(Value = \"PAID\")]\n    PAID,\n\n    [EnumMember(Value = \"CANCELED\")]\n    CANCELED,\n\n    [EnumMember(Value = \"FAILED\")]\n    FAILED,\n\n    [EnumMember(Value = \"SETTLED\")]\n    SETTLED\n}\n```\n\n---\n\n## 💬 Need Help?\n\nContact the payment provider or open an issue on the internal GitHub repo.\n\n---\n## 🎯 Testing SDK\n\nYou can test the SDK [ ➡️ here](https://github.com/MirotechTeam/rasedi-c-sharp-sdk/blob/master/Test/TestSdk.cs).\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirotechteam%2Frasedi-c-sharp-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmirotechteam%2Frasedi-c-sharp-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirotechteam%2Frasedi-c-sharp-sdk/lists"}