{"id":15076653,"url":"https://github.com/colinodell/omnipay-bundle","last_synced_at":"2025-10-05T11:31:22.494Z","repository":{"id":29003537,"uuid":"32530505","full_name":"colinodell/omnipay-bundle","owner":"colinodell","description":"Omnipay bundle for Symfony 2.3+ and 3.0+","archived":true,"fork":false,"pushed_at":"2018-09-25T12:22:56.000Z","size":54,"stargazers_count":7,"open_issues_count":4,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-23T15:17:01.821Z","etag":null,"topics":["omnipay","php","symfony","symfony-bundle","symfony2","symfony3"],"latest_commit_sha":null,"homepage":"","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/colinodell.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-19T15:40:11.000Z","updated_at":"2023-01-28T02:06:54.000Z","dependencies_parsed_at":"2022-09-03T17:40:30.783Z","dependency_job_id":null,"html_url":"https://github.com/colinodell/omnipay-bundle","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/colinodell/omnipay-bundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinodell%2Fomnipay-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinodell%2Fomnipay-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinodell%2Fomnipay-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinodell%2Fomnipay-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/colinodell","download_url":"https://codeload.github.com/colinodell/omnipay-bundle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinodell%2Fomnipay-bundle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278445728,"owners_count":25988043,"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","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"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":["omnipay","php","symfony","symfony-bundle","symfony2","symfony3"],"created_at":"2024-09-25T04:01:19.959Z","updated_at":"2025-10-05T11:31:22.247Z","avatar_url":"https://github.com/colinodell.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# omnipay-bundle\n\n[![Latest Version](https://img.shields.io/github/release/colinodell/omnipay-bundle.svg?style=flat-square)](https://github.com/colinodell/omnipay-bundle/releases)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n[![Build Status](https://img.shields.io/travis/colinodell/omnipay-bundle/master.svg?style=flat-square)](https://travis-ci.org/colinodell/omnipay-bundle)\n[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/colinodell/omnipay-bundle.svg?style=flat-square)](https://scrutinizer-ci.com/g/colinodell/omnipay-bundle/code-structure)\n[![Quality Score](https://img.shields.io/scrutinizer/g/colinodell/omnipay-bundle.svg?style=flat-square)](https://scrutinizer-ci.com/g/colinodell/omnipay-bundle)\n[![Total Downloads](https://img.shields.io/packagist/dt/colinodell/omnipay-bundle.svg?style=flat-square)](https://packagist.org/packages/colinodell/omnipay-bundle)\n\nSimple bundle for implementing [Omnipay](http://omnipay.thephpleague.com/) in your Symfony application.\n\n## Versions\n\n| omnipay-bundle  | Symfony    | Omnipay | PHP  |\n|-----------------|------------|---------|------|\n| **1.x**         | 2.x or 3.x | **2.x** | 5.4+ |\n| **2.x**         | 2.x or 3.x | **3.x** | 5.6+ |\n\n## Install\n\nVia Composer\n\n``` bash\n$ composer require colinodell/omnipay-bundle\n```\n\nEnable the bundle in your `AppKernel.php`:\n\n```php\nnew ColinODell\\OmnipayBundle\\OmnipayBundle(),\n```\n\n## Usage\n\nThis bundle provides a new service called `Omnipay`.  It contains a single method `get()`, which returns a fully-configured gateway for you to use:\n\n``` php\n$stripe = $this-\u003eget('omnipay')-\u003eget('Stripe');\n\n$paypal = $this-\u003eget('omnipay')-\u003eget('PayPal_Express');\n```\n\nYou can then use these gateways like usual.\n\n**Note:** Gateways are \"cached\" - calling `get('Some_Gateway')` multiple times will always return the same object.\n\n## Configuration\n\nGateways can be configured in your `app/config/config.yml` file\n\n``` yml\nomnipay:\n    methods:\n        # Your config goes here\n```\n\nFor example, to configure the [Stripe](https://github.com/thephpleague/omnipay-stripe) and [PayPal Express](https://github.com/thephpleague/omnipay-paypal) gateways:\n\n``` yml\nomnipay:\n    methods:\n        Stripe:\n            apiKey: sk_test_BQokikJOvBiI2HlWgH4olfQ2\n\n        PayPal_Express:\n            username:     test-facilitator_api1.example.com\n            password:     3MPI3VB4NVQ3XSVF\n            signature:    6fB0XmM3ODhbVdfev2hUXL2x7QWxXlb1dERTKhtWaABmpiCK1wtfcWd.\n            testMode:     false\n            solutionType: Sole\n            landingPage:  Login\n```\n\n**NOTE:** You should probably consider using parameters instead of storing credentials directly in your `config.yml` like that.\n\nThe method names should be whatever you'd typically pass into `Omnipay::create()`.  The configuration settings vary per gateway - see\n[Configuring Gateways](http://omnipay.thephpleague.com/gateways/configuring/) in the Omnipay documentation for more details.\n\n## Registering Custom Gateways\n\nCustom gateways can be registered via the container by tagging them with `omnipay.gateway`:\n\n```yml\n# services.yml\nservices:\n    my.test.gateway:\n        class: Path\\To\\MyTestGateway\n        tags:\n            - { name: omnipay.gateway, alias: MyTest }\n\n# config.yml\nomnipay:\n    methods:\n        # Reference the gateway alias here\n        MyTest:\n            apiKey: abcd1234!@#\n```\n\nYou can then obtain the fully-configured gateway by its alias:\n\n```php\n$this-\u003eget('omnipay')-\u003eget('MyTest');\n```\n\n## Additional configuration and customization\n\n### Default gateway\n\nAdd default gateway key to your config:\n```yml\n# config.yml\nomnipay:\n    methods:\n        MyGateway1:\n            apiKey: abcd1234!@#\n        MyGateway2:\n            apiKey: abcd45678!@#\n\n    default_gateway: MyGateway1\n```\n\nYou can now get default gateway instance:\n```php\n$omnipay-\u003egetDefaultGateway();\n```\n\n### Disabling gateways\n\nIf need to disable a gateway but want to keep all the configuration add `disabled_gateways` key to the config:\n```yml\n# config.yml\nomnipay:\n    methods:\n        MyGateway1:\n            apiKey: abcd1234!@#\n        MyGateway2:\n            apiKey: abcd45678!@#\n\n    disabled_gateways: [ MyGateway1 ]\n```\n\n`MyGateway1` gateway will be skipped during gateway registration now.\n\n### Customizing Omnipay service\n\nIf you need specific gateway selection mechanism or need to get multiple gateways at once consider to extend\ndefault Omnipay service. Create your custom Omnipay class, extend it from base class and add custom getters. For\nexample, you might want to get all gateways which implement some interface.\n\n```php\n\u003c?php\n\n// AppBundle/Omnipay/Omnipay.php\n\nnamespace AppBundle\\Omnipay;\n\nuse AppBundle\\Payment\\Processing\\Gateway\\VaultAwareGateway;\nuse ColinODell\\OmnipayBundle\\Service\\Omnipay as BaseOmnipay;\nuse Omnipay\\Common\\GatewayInterface;\n\nclass Omnipay extends BaseOmnipay\n{\n    /**\n     * @return VaultAwareGateway[]\n     */\n    public function getVaultAwareGateways()\n    {\n        return array_filter($this-\u003eregisteredGateways, function (GatewayInterface $gateway) {\n            return $gateway instanceof VaultAwareGateway;\n        });\n    }\n}\n```\n\n```yml\n#services.yml\nparameters:\n    omnipay.class: AppBundle\\Omnipay\\Omnipay\n```\n\nNow you should be able to get vault-aware gateways in your application:\n```php\nforeach ($omnipay-\u003egetVaultAwareGateways() as $gateway) {\n    $gateway-\u003esaveCreditCard($creditCard); // assuming saveCreditCard is a part of VaultAwareGateway interface\n}\n\n```\n\n### Initialize gateways on registration\n\nBy default gateway is initialized only when you call `get()` method. If you use custom getters (like\n`getVaultAwareGateways` from example above) with `$this-\u003eregisteredGateways` inside you might want to initialize them\nautomatically during registration. Simply add appropriate config key:\n```yml\n# config.yml\nomnipay:\n    methods:\n        MyGateway1:\n            apiKey: abcd1234!@#\n\n    initialize_gateway_on_registration: true\n```\n\n## Testing\n\n``` bash\n$ phpunit\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Security\n\nIf you discover any security related issues, please email colinodell@gmail.com instead of using the issue tracker.\n\n## Credits\n\n- [Colin O'Dell](https://github.com/colinodell)\n- [All Contributors](https://github.com/colinodell/omnipay-bundle/graphs/contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolinodell%2Fomnipay-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolinodell%2Fomnipay-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolinodell%2Fomnipay-bundle/lists"}