{"id":19396414,"url":"https://github.com/remotemerge/esewa-php-sdk","last_synced_at":"2025-04-24T05:30:53.817Z","repository":{"id":36838632,"uuid":"230560048","full_name":"remotemerge/esewa-php-sdk","owner":"remotemerge","description":"Effortless and Secure eSewa Payment Gateway Integration in PHP.","archived":false,"fork":false,"pushed_at":"2025-03-01T12:25:31.000Z","size":418,"stargazers_count":9,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-18T05:46:03.975Z","etag":null,"topics":["api","esewa","gateway","nepal","payment","php","sdk"],"latest_commit_sha":null,"homepage":"https://github.com/remotemerge/esewa-php-sdk","language":"PHP","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/remotemerge.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":"2019-12-28T04:53:35.000Z","updated_at":"2025-03-01T12:23:49.000Z","dependencies_parsed_at":"2023-12-25T16:59:25.067Z","dependency_job_id":"257f8e01-4166-4965-9b23-6bd38be85bf0","html_url":"https://github.com/remotemerge/esewa-php-sdk","commit_stats":{"total_commits":165,"total_committers":3,"mean_commits":55.0,"dds":"0.38787878787878793","last_synced_commit":"53e2d69822b80fae05fd17536d73d4f8e7b64864"},"previous_names":["remotemerge/esewa-php-sdk"],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remotemerge%2Fesewa-php-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remotemerge%2Fesewa-php-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remotemerge%2Fesewa-php-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remotemerge%2Fesewa-php-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remotemerge","download_url":"https://codeload.github.com/remotemerge/esewa-php-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250572177,"owners_count":21452326,"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":["api","esewa","gateway","nepal","payment","php","sdk"],"created_at":"2024-11-10T10:35:12.215Z","updated_at":"2025-04-24T05:30:53.446Z","avatar_url":"https://github.com/remotemerge.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eSewa SDK for PHP\n\n[![X (formerly Twitter)](https://img.shields.io/badge/-@sapkotamadan-white?style=flat\u0026logo=x\u0026label=(formerly%20Twitter))](https://twitter.com/sapkotamadan)\n[![Facebook](https://img.shields.io/badge/Facebook-NextSapkotaMadan-blue?style=flat\u0026logo=facebook)](https://www.facebook.com/NextSapkotaMadan)\n![PHP Version](https://img.shields.io/packagist/php-v/remotemerge/esewa-php-sdk)\n![Build](https://img.shields.io/github/actions/workflow/status/remotemerge/esewa-php-sdk/install.yml?style=flat\u0026logo=github)\n[![Downloads](https://img.shields.io/packagist/dt/remotemerge/esewa-php-sdk.svg?style=flat\u0026label=Downloads)](https://packagist.org/packages/remotemerge/esewa-php-sdk)\n![License](https://img.shields.io/github/license/remotemerge/esewa-php-sdk)\n\nThe **eSewa SDK for PHP** is developed and maintained by [remotemerge] and the community, simplifying the integration of the eSewa payment service into PHP code. For more details, refer to the [eSewa Documentation] website.\n\n## Getting Started\n\n1. **Sign up for eSewa** – Before you begin, you need to sign up and retrieve your credentials from [eSewa].\n2. **Minimum requirements** – To run the SDK, your system will need to meet the minimum requirements, including having **PHP \u003e= 8.1**. We highly recommend having it compiled with the cURL extension and cURL compiled with a TLS backend (e.g., NSS or OpenSSL).\n\n## Installation\n\n**Install the SDK** – Using Composer is the recommended way to install the eSewa SDK for PHP. The SDK is available via Packagist under the [`remotemerge/esewa-php-sdk`][install-package] package.\n\n```\ncomposer require remotemerge/esewa-php-sdk\n```\n\n## Getting Help\n\nBugs and feature requests are tracked using GitHub issues, and prioritization is given to addressing them as soon as possible.\n\n* For account and payment related concerns, please contact [eSewa] directly by calling or emailing them.\n* If a bug is identified, please [open an issue](https://github.com/remotemerge/esewa-php-sdk/issues/new) on GitHub.\n* For assistance with integrating eSewa into your application, feel free to reach out to the support team.\n\n## Quick Examples\n\n### Create an eSewa client\n\n```php\n// Init composer autoloader.\nrequire dirname(__DIR__) . '/vendor/autoload.php';\n\nuse RemoteMerge\\Esewa\\Client;\n\n// Set success and failure callback URLs.\n$successUrl = 'https://example.com/success.php';\n$failureUrl = 'https://example.com/failed.php';\n\n// Initialize eSewa client for development.\n$esewa = new Client([\n    'merchant_code' =\u003e 'EPAYTEST',\n    'success_url' =\u003e $successUrl,\n    'failure_url' =\u003e $failureUrl,\n]);\n\n// Initialize eSewa client for production.\n$esewa = new Client([\n    'merchant_code' =\u003e 'b4e...e8c753...2c6e8b',\n    'success_url' =\u003e $successUrl,\n    'failure_url' =\u003e $failureUrl,\n]);\n```\n\nHere `b4e...e8c753...2c6e8b` is merchant code retrieved from eSewa.\n\n### Make Payment\n\nWhen the user initiates the payment process, the package redirects the user to an eSewa site for payment processing. The\neSewa system will redirect the user to your specified success URL if the payment is successful and to the failure URL if\nthe payment fails.\n\n```php\n$esewa-\u003epayment('P101W201', 100, 15, 80, 50);\n```\n\nThe method accepts five parameters.\n\n```text\npayment(string $pid, float $amt, float $txAmt = 0, float $psc = 0, float $pdc = 0)\n```\n\n1. `pid` A unique ID of product or item or ticket etc.\n2. `amt` Amount of product or item or ticket etc\n3. `txAmt` Tax amount on product or item or ticket etc. Pass `0` if Tax/VAT is not applicable.\n4. `psc` The service charge (if applicable); default to `0`.\n5. `pdc` The delivery charge (if applicable); default to `0`.\n\n### OTP for Payment\n\nWhen using the eSewa payment gateway in production mode, an OTP (One-Time Password) code is sent to the customer's mobile number to verify the transaction. In development mode, the OTP code is a fixed six-digit number, `123456`, for testing purposes.\n\n### Verify Payment\n\nThe verification process identifies potentially fraudulent transactions and checks them against data such as transaction\namount and other parameters.\n\n```php\n$status = $esewa-\u003everifyPayment('R101', 'P101W201', 245);\nif ($status) {\n    // Verification successful.\n}\n```\n\nThe method accepts three parameters.\n\n```text\nverifyPayment(string $refId, string $oid, float $tAmt)\n```\n\n1. `refId` A unique payment reference code generated by eSewa.\n2. `oid` Product ID used on payment request.\n3. `tAmt` Total payment amount (including Tax/VAT and other charges.)\n\n**Note:** You can extract `refId` from the success response url parameter.\n\n## Contribution\n\nThe contributions of the Open Source community are highly valued and appreciated. To ensure a smooth and efficient process, please adhere to the following guidelines when submitting code:\n\n- Ensure that the code adheres to [PER Coding Style 2.0] standards.\n- All submitted code must pass relevant tests.\n- Proper documentation and clean code practices are essential.\n- Please make pull requests to the `main` branch.\n\nThank you for your support and contributions. Looking forward to reviewing your code.\n\n[eSewa]: https://esewa.com.np\n\n[remotemerge]: https://github.com/remotemerge\n\n[eSewa Documentation]: https://developer.esewa.com.np\n\n[install-package]: https://packagist.org/packages/remotemerge/esewa-php-sdk\n\n[PER Coding Style 2.0]: https://www.php-fig.org/per/coding-style/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremotemerge%2Fesewa-php-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremotemerge%2Fesewa-php-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremotemerge%2Fesewa-php-sdk/lists"}