{"id":21409566,"url":"https://github.com/mahmoudsayed96/opay","last_synced_at":"2026-05-18T18:39:00.648Z","repository":{"id":124431638,"uuid":"494563860","full_name":"MahmoudSayed96/opay","owner":"MahmoudSayed96","description":"Drupal custom module to integrate with opay payment gateway using http client","archived":false,"fork":false,"pushed_at":"2022-05-20T18:09:38.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-23T04:29:13.351Z","etag":null,"topics":["cms","drupal","drupal-8","module","php"],"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/MahmoudSayed96.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}},"created_at":"2022-05-20T18:07:52.000Z","updated_at":"2022-05-20T18:11:06.000Z","dependencies_parsed_at":"2023-08-07T17:21:13.668Z","dependency_job_id":null,"html_url":"https://github.com/MahmoudSayed96/opay","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahmoudSayed96%2Fopay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahmoudSayed96%2Fopay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahmoudSayed96%2Fopay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahmoudSayed96%2Fopay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MahmoudSayed96","download_url":"https://codeload.github.com/MahmoudSayed96/opay/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243910383,"owners_count":20367537,"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":["cms","drupal","drupal-8","module","php"],"created_at":"2024-11-22T17:27:07.568Z","updated_at":"2026-05-18T18:39:00.605Z","avatar_url":"https://github.com/MahmoudSayed96.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Opay\nCustom drupal module make an integration with OPay payment gateway.\n\n\n\n## Configurations\nAfter install module go to `admin/config/system/opay`\n- Set `Token`\n- Set `Merchant Id`\n- Set `API Base Url`\n\n## Usage/Examples\n\n```php\n\u003c?php\nnamespace Drupal\\mental_health\\Controller;\nuse Drupal\\Core\\Controller\\ControllerBase;\n/**\n * Returns responses for opay routes.\n */\nclass OPayController extends ControllerBase {\n\n  /**\n   * OPay client instance.\n   *\n   * @var \\Drupal\\opay\\Client\\OPayApiClient.\n   */\n  private $opayClient;\n\n  public function __construct() {\n    $this-\u003eopayClient = \\Drupal::service('opay.client');\n  }\n\n  /**\n   * Create opay payment action.\n   */\n  public function pay(array $query = [], array $data = []) {\n    $body = [\n      \"amount\" =\u003e [\n        \"currency\" =\u003e \"EGP\",\n        \"total\" =\u003e  $data['amount'] * 100,\n     ],\n    \"country\" =\u003e \"EG\",\n    \"product\" =\u003e [\n        \"description\" =\u003e \"description\",\n        \"name\" =\u003e \"name\"\n    ],\n    \"reference\" =\u003e time(),\n    \"payMethod\" =\u003e \"BankCard\",\n    'returnUrl' =\u003e $data['returnUrl'],\n    'callbackUrl' =\u003e $data['callbackUrl'],\n    'cancelUrl' =\u003e $data['cancelUrl'],\n    ];\n    return $this-\u003eopayClient-\u003erequest('POST', 'create',$query, $body);\n  }\n\n}\n```\n\n## Reference\n- [OPay](https://doc.opaycheckout.com/reference-code)\n\n- [End-to-End Test](https://doc.opaycheckout.com/end-to-end-testing)\n\n## Author\n\n- [@MahmoudSayed96](https://www.github.com/MahmoudSayed96)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahmoudsayed96%2Fopay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmahmoudsayed96%2Fopay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahmoudsayed96%2Fopay/lists"}