{"id":21701217,"url":"https://github.com/russkyc/paymongo-sharp","last_synced_at":"2025-04-12T13:35:18.565Z","repository":{"id":209860977,"uuid":"725072880","full_name":"russkyc/paymongo-sharp","owner":"russkyc","description":"An unofficial C# client for the Paymongo API","archived":false,"fork":false,"pushed_at":"2024-01-08T07:00:14.000Z","size":19913,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-03-26T11:47:48.120Z","etag":null,"topics":["card-payment","csharp","dotnet","gcash","grabpay","maya","paymaya","payment","payment-gateway","paymongo","paymongo-client","paymongo-csharp","paymongo-sharp"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/Paymongo.Sharp","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/russkyc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"russkyc","patreon":"russkyc","custom":["https://paypal.me/jrcmo"]}},"created_at":"2023-11-29T11:35:16.000Z","updated_at":"2024-02-08T03:19:46.000Z","dependencies_parsed_at":"2024-01-08T08:22:45.864Z","dependency_job_id":"f733661d-4e42-4bda-80bb-e61806ebf2f4","html_url":"https://github.com/russkyc/paymongo-sharp","commit_stats":null,"previous_names":["russkyc/paymongo-sharp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/russkyc%2Fpaymongo-sharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/russkyc%2Fpaymongo-sharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/russkyc%2Fpaymongo-sharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/russkyc%2Fpaymongo-sharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/russkyc","download_url":"https://codeload.github.com/russkyc/paymongo-sharp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248573846,"owners_count":21126914,"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":["card-payment","csharp","dotnet","gcash","grabpay","maya","paymaya","payment","payment-gateway","paymongo","paymongo-client","paymongo-csharp","paymongo-sharp"],"created_at":"2024-11-25T20:18:34.540Z","updated_at":"2025-04-12T13:35:18.538Z","avatar_url":"https://github.com/russkyc.png","language":"C#","funding_links":["https://github.com/sponsors/russkyc","https://patreon.com/russkyc","https://paypal.me/jrcmo"],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://www.nuget.org/packages/Paymongo.Sharp\"\u003e\n    \u003cimg src=\".github/resources/images/banner.svg\" style=\"width: 100%;\" /\u003e\n\u003c/a\u003e\n\n\u003ch2 align=\"center\"\u003ePaymongo.Sharp - The Unofficial Paymongo API Client for .NET\u003c/h2\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://img.shields.io/nuget/v/Paymongo.Sharp?color=1f72de\" alt=\"Nuget\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/-.NET%20Standard%202.0-blueviolet?color=1f72de\u0026label=NET\" alt=\"\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/russkyc/paymongo-sharp\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/issues/russkyc/paymongo-sharp\"\u003e\n    \u003cimg src=\"https://img.shields.io/nuget/dt/Paymongo.Sharp\"\u003e\n\u003c/p\u003e\n\n\u003cp style=\"text-align: justify\"\u003e\nPaymongo is a powerful payment platform that provides a wide range of payment solutions for businesses of all sizes. With the Paymongo API, you can integrate payment processing into your .NET applications, allowing you to securely accept payments, manage transactions, and more.\n\nThis client wrapper is designed to make it easy for .NET developers to interact with the Paymongo API. It provides a simple, intuitive interface that abstracts the API, allowing you to access a typed client and focus on building your Paymongo-integrated application faster.\n\u003c/p\u003e\n\n## :arrow_down: Installation\n\n\u003cbr/\u003e\n\u003cbr/\u003e\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://www.nuget.org/packages/Paymongo.Sharp/\"\u003e\n        \u003cimg src=\".github/resources/images/nuget-button.svg\" style=\"width:200px\" alt=\"Nuget\"\u003e\n    \u003c/a\u003e\n    \u003cp align=\"center\"\u003eInstall package from: \u003ca href=\"https://www.nuget.org/packages/Paymongo.Sharp/\"\u003eNuget\u003c/a\u003e using nuget cli or the nuget package manager.\u003c/p\u003e\n\u003c/div\u003e\n\u003cbr/\u003e\n\nAdd Imports\n\n```csharp\nusing Paymongo.Sharp;\n```\n\nInitialize Client\n```csharp\nvar client = new PaymongoClient(secretKey: \"\u003csecret_key\u003e\");\n```\n\n## :star: Payments Demo\n\n**Cli (Console)**\n\n\u003cimg src=\".github/resources/images/demo-payments-cli.gif\" style=\"widt: 100%;\"\u003e\n\n**WPF (With WebView 2 Control)**\n\n\u003cimg src=\".github/resources/images/demo-payments.gif\" style=\"widt: 100%;\"\u003e\n\n**Blazor**\n\n\u003cimg src=\".github/resources/images/demo-payments-blazor.gif\" style=\"widt: 100%;\"\u003e\n\nThis nuget package is not limited to these samples, it also supports the all .NET platforms including mono, android, and others.\n\n## :sparkles: What API Actions are currently Supported\n\nThis client is in active development and features are slowly being implemented but not all of them are supported as of now.\nYou can track the support for all of Paymongo's official API actions below:\n\n### API Support (Paymongo API v1)\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eAPI Resource\u003c/th\u003e\n    \u003cth\u003eStatus\u003c/th\u003e\n    \u003cth\u003eAdded on\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eCheckout\u003c/td\u003e\n    \u003ctd\u003eFull\u003c/td\u003e\n    \u003ctd\u003ev0.1.2-pre+\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ePayment Intent\u003c/td\u003e\n    \u003ctd\u003eNot yet available\u003c/td\u003e\n    \u003ctd\u003eNot yet Added\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ePayment Method\u003c/td\u003e\n    \u003ctd\u003eNot yet available\u003c/td\u003e\n    \u003ctd\u003eNot yet Added\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ePayments\u003c/td\u003e\n    \u003ctd\u003eFull\u003c/td\u003e\n    \u003ctd\u003ev0.2.0+\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eLinks\u003c/td\u003e\n    \u003ctd\u003eFull\u003c/td\u003e\n    \u003ctd\u003ev0.3.0+\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eWebhooks\u003c/td\u003e\n    \u003ctd\u003eNot yet available\u003c/td\u003e\n    \u003ctd\u003eNot yet Added\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eCustomers\u003c/td\u003e\n    \u003ctd\u003ePartial\u003c/td\u003e\n    \u003ctd\u003ev0.5.0+\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eTreasury\u003c/td\u003e\n    \u003ctd\u003eNot yet available\u003c/td\u003e\n    \u003ctd\u003eNot yet Added\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eInstallments\u003c/td\u003e\n    \u003ctd\u003eNot yet available\u003c/td\u003e\n    \u003ctd\u003eNot yet Added\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eSources\u003c/td\u003e\n    \u003ctd\u003eFull\u003c/td\u003e\n    \u003ctd\u003ev0.4.0+\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n---\n\n## :collision: Breaking Changes\n\n- (v0.5.1+) All amount related properties should now be a `decimal` (up to 2 decimal places)\n- (v0.2.0+) PaymongoClient now only needs a Secret Key on initialization\n- (v0.1.1-pre+) Updated root namespace to `Paymongo.Sharp` from `paymongo_sharp`\n\n---\n\n## :notebook: Basic Client API Reference\n\nIf you want to get started with this Paymongo client, you can\ncheck the refernces for basic usage below.\n\n### Checkout\n\n- [x] Create Checkout Session\n- [x] Retrieve a Checkout Session\n- [x] Expire a Checkout Session\n\n**Create a Checkout Session**\n\n```csharp\n// We create a new Checkout object\n// This one includes the minimal required values\nCheckout checkout = new Checkout() {\n    Description = \"Test Checkout\",\n    LineItems = new [] {\n        new LineItem {\n            Name = \"item_name\",\n            Quantity = 1,\n            Currency = Currency.Php,\n            Amount = 3500\n        }\n    },\n    PaymentMethodTypes = new [] {\n        PaymentMethod.GCash,\n        PaymentMethod.Card,\n        PaymentMethod.Paymaya\n    }\n};\n\n// We use the PaymongoClient from earlier\n// This returns the Checkout object with the new server info for checkout url, id, and others\nCheckout checkoutResult = await client.Checkouts.CreateCheckoutAsync(checkout);\n```\n\n**Retrieve a Checkout Session**\n\n```csharp\n// We use the PaymongoClient from earlier\n// Lets assume that the checkout id is \"12345678\"\n// This returns a Checkout object from the server\nCheckout checkoutResult = await client.Checkouts.RetrieveCheckoutAsync(\"12345678\");\n```\n\n**Expire a Checkout Session**\n\n```csharp\n// We use the PaymongoClient from earlier\n// Lets assume that the checkout id is \"12345678\"\n// This expires the checkout on the server and returns the expired Checkout object\nCheckout checkoutResult = await client.Checkouts.ExpireCheckoutAsync(\"12345678\");\n```\n\nFor full Checkout API reference, please see: [Checkout Session Resource](https://developers.paymongo.com/reference/checkout-session-resource)\n\n---\n\n### Payment Intent\n\n- [ ] Create Payment Intent\n- [ ] Retrieve a Payment Intent\n- [ ] Attach to a Payment Intent\n- [ ] Attach to a Payment Intent\n\nPre Authorization and Capture\n\n- [ ] Capture a Payment Intent\n- [ ] Cancel a Payment Intent\n\nFor full Payment API reference, please see: [The Payment Intent Object](https://developers.paymongo.com/reference/the-payment-intent-object), [(Pre-Authorization) Capture](https://developers.paymongo.com/reference/capture-a-payment), [(Pre-Authorization) Cancel](https://developers.paymongo.com/reference/cancel-a-payment)\n\n---\n\n### Payment Method\n\n- [ ] Retrieve list of possible merchant payment methods\n- [ ] Create a payment method\n- [ ] Retrieve a payment method\n- [ ] Update a payment method\n\nFor full Payment Method API reference, please see: [The Payment Method Object](https://developers.paymongo.com/reference/the-payment-method-object)\n\n---\n\n### Payments\n\n- [x] Create a Payment\n- [x] List all Payments\n- [x] Retrieve a Payment\n\n**List All Payments**\n\n```csharp\n// We use the PaymongoClient from earlier\n// This returns a list of Payment objects\nIEnumerable\u003cPayment\u003e paymentsResult = await client.Payments.ListAllPaymentsAsync();\n```\n\n**Retrieve a Payment**\n\n```csharp\n// We use the PaymongoClient from earlier\n// Lets assume that the payment id is \"12345678\"\n// This returns a Payment object from the server\nPayment paymentResult = await client.Payments.RetrievePaymentAsync(\"12345678\");\n```\n\nFor full Payments API reference, please see: [Payment Resource](https://developers.paymongo.com/reference/payment-source)\n\n---\n\n### Links API\n\n- [x] Create a Link\n- [x] Retrieve a Link\n- [x] Get Link by Reference Number\n- [x] Archive a Link\n- [x] Unarchive a Link\n\n**Create a Link**\n\n```csharp\n// We create a new Link object\n// This one includes the minimal required values\nLink link = new Link {\n    Description = \"New Link\",\n    Amount = 100000,\n    Currency = Currency.Php\n};\n\n// We use the PaymongoClient from earlier\n// This returns the Link object with the new server info for checkout url, id, and others\nLink linkResult = await client.Links.CreateLinkAsync(link);\n```\n\n**Retrieve a Link**\n\n```csharp\n// We use the PaymongoClient from earlier\n// Lets assume that the link id is \"12345678\"\n// This returns a Link object from the server\nLink linkResult = await client.Links.RetrieveLinkAsync(\"12345678\");\n```\n\n**Get Link by Reference Number**\n\n```csharp\n// We use the PaymongoClient from earlier\n// Lets assume that the link id is \"ABCD1234\"\n// This returns a Link object from the server\nLink linkResult = await client.Links.GetLinkByReferenceNumberAsync(\"ABCD1234\");\n```\n\n**Archive a Link**\n\n```csharp\n// We use the PaymongoClient from earlier\n// Lets assume that the Link id is \"12345678\"\n// This returns the updated archived Link object\nLink linkResult = await client.Links.ArchiveLinkAsync(\"12345678\");\n```\n\n**Unarchive a Link**\n\n```csharp\n// We use the PaymongoClient from earlier\n// Lets assume that the payment id is \"12345678\"\n// This returns the updated un-archived Link object\nLink linkResult = await client.Links.UnarchiveLinkAsync(\"12345678\");\n```\n\nFor full Links API reference, please see: [Links Resource](https://developers.paymongo.com/reference/links-resource)\n\n---\n\n### Webhooks\n\n- [ ] Create a Webhook\n- [ ] List all Webhooks\n- [ ] Retrieve a Webhook\n- [ ] Disable a Webhook\n- [ ] Enable a Webhook\n- [ ] Update a Webhook\n\nFor full Webhook API reference, please see: [Webhook Resource](https://developers.paymongo.com/reference/webhook-resource)\n\n---\n\n### Refunds\n\n- [ ] Create a Refund\n- [ ] Retrieve a Refund\n- [ ] List all Refunds\n\nFor full Refunds API reference, please see: [Refund Resource](https://developers.paymongo.com/reference/refund-resource)\n\n---\n\n### Customers\n\n- [x] Create a Customer\n- [x] Retrieve a Customer\n- [x] Edit a Customer\n- [x] Delete a Customer\n- [ ] Retrieve the Payment Methods of a Customer\n- [ ] Delete a Payment Method of a Customer\n\n**Create a Customer**\n\n```csharp\n// We create a new Customer object\n// This one includes the minimal required values\nCustomer customer = new Customer() {\n    FirstName = \"First Name\",\n    LastName = \"Last Name\",\n    Email = \"testcustomermail@mail.com\",\n    Phone = \"+639234735258\",\n    DefaultDevice = Device.Email\n};\n\n// We use the PaymongoClient from earlier\n// This returns a Customer object from the server with an Id as confirmation\nCustomer customerResult = await client.Customers.CreateCustomerAsync(customer);\n```\n\n**Retrieve a Customer**\n\n```csharp\n// We use the PaymongoClient from earlier\n// Lets assume that the customer email is \"customer@mail.com\"\n// Lets assume that the customer phone number is \"+639876543210\"\n// This returns a Customer object from the server\nCustomer customerResult = await client.Customers.RetrieveCustomerAsync(\"customer@mail.com\", \"+639876543210\");\n```\n\n**Edit a Customer**\n\n```csharp\n// First lets get the customer we want to edit\nCustomer customerResult = await client.Customers.RetrieveCustomerAsync(\"customer@mail.com\", \"+639876543210\");\n\n// Lets edit some of the customer information\ncustomerResult.FirstName = \"New First Name\";\ncustomerResult.LastName = \"New Last Name\";\n\n// After this update executes, this returns the Customer object with the updated information\nvar editCustomerResult = await client.Customers.EditCustomerAsync(customerResult);\n\n```\n\n**Delete a Customer**\n\n```csharp\n// We use the PaymongoClient from earlier\n// Lets assume that the customer id is \"12345678\"\n// This returns true if the customer is deleted successfuly\nbool deletedCustomerResult = await client.Customers.DeleteCustomerAsync(\"12345678\");\n```\n\nFor full Customers API reference, please see: [Customer Resource](https://developers.paymongo.com/reference/customer-resource)\n\n---\n\n### Sources (Gcash and GrabPay Checkout)\n\n- [x] Create a Source\n- [x] Retrieve a Source\n\n**Create a Source**\n\n```csharp\n// We create a new Source object\n// This one includes the minimal required values\nSource source = new Source {\n    Amount = 100000,\n    Billing = new Billing {\n        Name = \"TestName\",\n        Email = \"test@paymongo.com\",\n        Phone = \"9734534443\",\n        Address = new Address {\n            Line1 = \"TestAddress1\",\n            Line2 = \"TestAddress2\",\n            PostalCode = \"4506\",\n            State = \"TestState\",\n            City = \"TestCity\",\n            Country = \"PH\"\n        }\n    },\n    Redirect = new Redirect {\n        Success = \"http://127.0.0.1\",\n        Failed = \"http://127.0.0.1\"\n    },\n    Type = SourceType.GCash,\n    Currency = Currency.Php\n};\n\n// We use the PaymongoClient from earlier\n// This returns a Source object from the server\n// containing the redirect object(with checkout url) and other info\nSource sourceResult = await client.Sources.CreateSourceAsync(source);\n```\n\n**Retrieve a Source**\n\n```csharp\n// We use the PaymongoClient from earlier\n// Lets assume that the Source id is \"12345678\"\n// This returns a Source object from the server\nLink sourceResult = await client.Sources.RetrieveSourceAsync(\"12345678\");\n```\n\nFor full Sources API reference, please see: [The Sources Object](https://developers.paymongo.com/reference/the-sources-object)\n\n---\n\n### Treasury\n\nTreasury has a couple of sub sections\n\n##### Wallet\n\n- [ ] Retrieve Wallet by ID\n- [ ] Retrieve Wallet Accounts\n\nFor full Transaction History API reference, please see: [Wallet Account Resource](https://developers.paymongo.com/reference/account-resource)\n\n##### Send Money\n\n- [ ] Create a Wallet Transaction\n- [ ] Retrieve List of all Receiving Institutions\n\nFor full Send Money API reference, please see: [Wallet Transaction Resource](https://developers.paymongo.com/reference/wallet-transaction-resource)\n\n##### Disbursemenet\n\n- [ ] Create a Batch Transaction\n\nFor full Transaction History API reference, please see: [Batch Transaction Resource](https://developers.paymongo.com/reference/batch-transaction-resource)\n\n##### Transaction History\n\n- [ ] Retrieve a Wallet Transaction By ID\n- [ ] Retrieve List of Wallet Transactions\n- [ ] Retrieve List of Batches\n- [ ] Retrieve Batch Object\n\nFor full Transaction History API reference, please see: [Retrieve a Wallet Transaction By ID](https://developers.paymongo.com/reference/retrieve-a-wallet-transaction)\n\n---\n\n### Installments\n\n- [ ] List Installment Plans\n\nFor full Installments API reference, please see: [List Installment Plans](https://developers.paymongo.com/reference/list-installment-plans)\n\n---\n\n## Future Plans\n\n### Fluent Builder\nSomething that I have in mind that might be easier to work with,\nfor context let's compare the current api usage and the future\nfluent builder implementation for the Checkouts client.\n\n##### 1. Current\n\n```csharp\nvar client = new PaymongoClient(secretKey: \"\u003csecret_key\u003e\");\n\nCheckout checkout = new Checkout() {\n    Description = \"Test Checkout\",\n    LineItems = new [] {\n        new LineItem {\n            Name = \"Item Name\",\n            Quantity = 1,\n            Currency = Currency.Php,\n            Amount = 3500\n        }\n    },\n    PaymentMethodTypes = new [] {\n        PaymentMethod.GCash,\n        PaymentMethod.Card,\n        PaymentMethod.Paymaya\n    }\n};\n\nCheckout checkoutResult = await client.Checkouts.CreateCheckoutAsync(checkout);\n```\n\n##### 2. Future Fluent Builder\n\n```csharp\nvar client = new PaymongoClient(secretKey: \"\u003csecret_key\u003e\");\n\nCheckout checkoutResult = await CheckoutBuilder\n                                    .WithDescription(\"Test Checkout\")\n                                    .WithLineItem(\n                                        LineItemBuilder.WithName(\"Item Name\")\n                                            .WithQuantity(1)\n                                            .WithAmount(3500)\n                                            .WithCurrency(Currency.Php)\n                                    )\n                                    .WithPaymentMethod(PaymentMethod.Gcash)\n                                    .WithPaymentMethod(PaymentMethod.Card)\n                                    .WithPaymentMethod(PaymentMethod.Paymaya)\n                                    .CreateCheckoutAsync();\n```\n\n### Other Plans\n\nWhat do you think should be implemented in future versions of the client? Let your ideas be known\nand open an [issue](https://github.com/russkyc/paymongo-sharp/issues) with a [feature-request] tag and it might make it into future updates.\nOr, if you tried something that works and is awesome try opening a [pull request](https://github.com/russkyc/paymongo-sharp/pulls) and if all\nis good, your contribution can be implemented into the project!\n\n---\n\n## :heart: Donate\n\nThis is free and available for everyone to use, but still requires time for development\nand maintenance. By choosing to donate, you are not only helping develop this project,\nbut you are also helping me dedicate more time for creating more tools that help the community :heart:\n\n## :tada: Special Thanks\n\nThis project is made easier to develop by Jetbrains! They have provided\nLicenses to their IDE's to support development of this open-source project.\n\n\u003ca href=\"https://www.jetbrains.com/community/opensource/#support\"\u003e\n\u003cimg width=\"200px\" src=\"https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.png\" alt=\"JetBrains Logo (Main) logo.\"\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frusskyc%2Fpaymongo-sharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frusskyc%2Fpaymongo-sharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frusskyc%2Fpaymongo-sharp/lists"}