{"id":50200883,"url":"https://github.com/arif98741/nagadApi","last_synced_at":"2026-06-11T14:00:35.909Z","repository":{"id":41571980,"uuid":"300738403","full_name":"arif98741/nagadApi","owner":"arif98741","description":"This is Bangladeshi nagad payment gateway api development php sdk library. This library can be used in any php application.","archived":false,"fork":false,"pushed_at":"2025-10-20T18:06:57.000Z","size":702,"stargazers_count":45,"open_issues_count":0,"forks_count":22,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-20T19:10:56.895Z","etag":null,"topics":["api","bangladesh","bangladeshi-payment-gateway","bd-payment","laravel-nagad-payment","nagad-api","nagad-api-library","nagad-gateway","nagad-packagist-library","nagad-php-library","nagad-php-payment-gateway","payment","payment-gateway","payment-integration"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/arif98741.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"custom":"https://www.buymeacoffee.com/arif98741"}},"created_at":"2020-10-02T21:19:27.000Z","updated_at":"2025-10-20T18:07:00.000Z","dependencies_parsed_at":"2024-10-01T08:21:09.568Z","dependency_job_id":"f27669a1-b427-4c17-b596-e89e6f7a7e94","html_url":"https://github.com/arif98741/nagadApi","commit_stats":{"total_commits":105,"total_committers":4,"mean_commits":26.25,"dds":0.4476190476190476,"last_synced_commit":"9802f0a1a70e010480c82b73ef6342cb7fb42205"},"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"purl":"pkg:github/arif98741/nagadApi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arif98741%2FnagadApi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arif98741%2FnagadApi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arif98741%2FnagadApi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arif98741%2FnagadApi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arif98741","download_url":"https://codeload.github.com/arif98741/nagadApi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arif98741%2FnagadApi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34201842,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","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":["api","bangladesh","bangladeshi-payment-gateway","bd-payment","laravel-nagad-payment","nagad-api","nagad-api-library","nagad-gateway","nagad-packagist-library","nagad-php-library","nagad-php-payment-gateway","payment","payment-gateway","payment-integration"],"created_at":"2026-05-25T22:00:42.189Z","updated_at":"2026-06-11T14:00:35.900Z","avatar_url":"https://github.com/arif98741.png","language":"PHP","funding_links":["https://www.buymeacoffee.com/arif98741"],"categories":["Fintech \u0026 Payments"],"sub_categories":["🚀 How to contribute"],"readme":"\u003cp\u003e\u003cimg alt=\"Nagad api php xenon nagad api\" style=\"width: 400px; height: 300px;\" src=\"https://github.com/arif98741/nagadApi/blob/master/file/nagad-logo.png\"\u003e\u003c/p\u003e\n\n# Xenon/NagadApi\n\n\n## Features\n\n- Easy Installation\n- Easy Payment Processing\n- Composer based installation\n- Verify Payment\n- Demo Invoice Code Generate\n\n# Install Using Composer\n\n```bash\ncomposer require xenon/nagad-api\n```\n\n\n\n# Example Code\n```php\n\u003c?php\n\nuse Xenon\\NagadApi\\Helper;\nuse Xenon\\NagadApi\\Base;\n\nrequire 'vendor/autoload.php';\n\n/**\n * ==============================================================================\n * all configuration are used here for demo purpose.\n * for use in dev mode use 'development'\n * for use in production mode use 'production'\n * ===============================================================================\n **/\n$config = [\n    'NAGAD_APP_ENV' =\u003e 'development', // development|production\n    'NAGAD_APP_LOG' =\u003e '1',\n    'NAGAD_APP_MERCHANTID' =\u003e '6800000025', //demo\n    'NAGAD_APP_MERCHANT_PRIVATE_KEY' =\u003e 'MIIEvFAAxN1qfKiRiCL720FtQfIwPDp9ZqbG2OQbdyZUB8I08irKJ0x/psM4SjXasglHBK5G1DX7BmwcB/PRbC0cHYy3pXDmLI8pZl1NehLzbav0Y4fP4MdnpQnfzZJdpaGVE0oI15l',\n    'NAGAD_APP_MERCHANT_PG_PUBLIC_KEY' =\u003e 'MIIBIjANBc54jjMJoP2toR9fGmQV7y9fzj',\n    'NAGAD_APP_TIMEZONE' =\u003e 'Asia/Dhaka',\n];\n\n$nagad = new Base($config, [\n    'amount' =\u003e 10,\n    'invoice' =\u003e Helper::generateFakeInvoice(15, true),\n    'merchantCallback' =\u003e 'https://example.com/payment/success/id=4',\n]);\n```\n\n## Method-1 **:** Use for website\n```\n$status = $nagad-\u003epayNow($nagad); //will redirect to payment page\n```\n\n## Method-2 **:** Return Redirection url . You can use this according to need \n```\n$paymentUrl = $nagad-\u003epayNowWithoutRedirection($nagad); //will return payment url like below. You can use that url and do whatever u want to get payment from clients. \n```\n\n\n```\nhttp://sandbox.mynagad.com:10060/check-out/MDYyODAwNTcyNTYxNi42ODMwMDIwMDcxMDQyMjUuOU5PTEFVNkVaWkdUWVRBLmJiZGMyNTE3MTVmZTNiNjIzN2Zk\n```\n\n### After that use below method for extracting payment response that will return an array\n\n```\n$successUrl = 'https://example.com/payment/success/id=4/?merchant=683XXXX225\u0026order_id=CKH060JXXXXXFRA2\u0026payment_ref_id=MXXXXXXXXtIMDYwSjFRSlBRMUZSQTIuMTg0NTE2Yzc3ZmEzNmEwZTJlZjk=\u0026status=Success\u0026status_code=00_0000_000\u0026message=Successful%20Transaction\u0026payment_dt=20211123235008\u0026issuer_payment_ref=MTEyMzIzNDg1NzUwOS42ODMwMDIwMDcxMDQyMjUuQ0tIMDYwSjFRSlBRMUZSQTIuMTg0NTE2Yzc3ZmEzNmEwZTJlZjk=';\n$response = Helper::successResponse(\"$successUrl\");\n\nArray\n(\n    [merchant] =\u003e 683XXXX225\n    [order_id] =\u003e CKH060JXXXXXFRA2\n    [payment_ref_id] =\u003e MXXXXXXXXtIMDYwSjFRSlBRMUZSQTIuMTg0NTE2Yzc3ZmEzNmEwZTJlZjk=\n    [status] =\u003e Success\n    [status_code] =\u003e 00_0000_000\n    [message] =\u003e Successful Transaction\n    [payment_dt] =\u003e 20211123235008\n    [issuer_payment_ref] =\u003e MTEyMzIzNDg1NzUwOXXXXXtIMDYwSjFRSlBRMUZSQTIuMTg0NTE2Yzc3ZmEzNmEwZTJlZjk=\n)\n```\n### For payment verification use below method. You will then get below json as response. \n```\n$helper = new Helper($config);\n$response = $helper-\u003everifyPayment($response['payment_ref_id']);\n```\n\n## Payment Verification Response\n```\n{\n\tmerchantId: \"683XXXX225\",\n\torderId: \"CKH060JXXXXXFRA2\",\n\tpaymentRefId: \"MXXXXXXXXtIMDYwSjFRSlBRMUZSQTIuMTg0NTE2Yzc3ZmEzNmEwZTJlZjk=\",\n\tamount: \"16\",\n\tclientMobileNo: \"016****5428\",\n\tmerchantMobileNo: \"01XXXXXXX10\",\n\torderDateTime: \"2021-11-23 23:48:22.0\",\n\tissuerPaymentDateTime: \"2021-11-23 23:50:08.0\",\n\tissuerPaymentRefNo: \"000XXXW\",\n\tadditionalMerchantInfo: null,\n\tstatus: \"Success\",\n\tstatusCode: \"000\",\n\tcancelIssuerDateTime: null,\n\tcancelIssuerRefNo: null\n}\n```\n## Maintainer\n\u003cul\u003e\n    \u003cli\u003e\u003ca href=\"https://github.com/arif98741\"\u003eAriful Islam\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\n### Contributors\n\u003cul\u003e\n    \u003cli\u003e\u003ca href=\"https://github.com/tusharkhan\"\u003eTushar Khan\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\n\n# Important Information:\n\n### Sandbox Environment\n1. Need sandbox details for sandbox testing. Check your email that you have got from nagad authority\n2. Use sandbox details such as pgpublickey, privatekey, merchant-id for sandbox testing\n3. You need to register a mobile number for sandbox testing. Contact with your account manager for doing this\n4. You should test environment before going to live\n\n\n### Live Environment\n1. Need production details for production final. You will get through email\n2. Your server ip/domain and callback url should be whitelisted before running in production. You can contact with nagad team using mail or other system\n\nLogin to your **Nagad Merchant Panel**\n\n`   https://auth.mynagad.com:10900/authentication-service-provider-1.0/login\n`\n\n**Step 1:**\n**_In the Merchant Portal, Go to Merchant Integration Details under Merchant Management Menu.\nYou will get the Merchant ID which is your Merchant ID for Integration._**\n\nThen, Click on “Key Generate” and \nDownload the Merchant Private Key and Merchant Public Key.\n\n**Step 2:**\n_**_Go to Merchant Integration under Merchant Management Menu.\nPut your Call Back URL and Upload the Merchant Public Key which you have downloaded in Step 1. Add and Submit!**__\n\n**Step 3:**\n_**_Usage Production Details .\nYou have to use public key and private key that you have downloaded!**__\n\n\n3. If you have any question/query then email me **arif98741@gmail.com**\n4. Do Code, Be Crazy\n\u003cbr\u003e\n### If you find any kind of issue or bug you are highly encouraged to report. For reporting use [issues option](https://github.com/arif98741/nagadApi/issues)\nFor can also add pull request. For pull request you should use **dev** branch. Because our **master** branch is serving at this moment for usage around community. We dont want to messup\n\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farif98741%2FnagadApi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farif98741%2FnagadApi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farif98741%2FnagadApi/lists"}