thephpleague / omnipay

A framework agnostic, multi-gateway payment processing library for PHP 5.6+
http://omnipay.thephpleague.com/
MIT License
5.92k stars 928 forks source link

Make z-credit gateway for laravel. Not visible in list of drivers. #422

Closed bbrandtlv closed 7 years ago

bbrandtlv commented 7 years ago

Hey I'm building z-credit gateway for omnipay for octobercms. I simply started with worldpay folder and replicated it then added info into composer.json in zcredit folder and added info in vendor folder composer.json but plugin doent see it. i trued to remove one of working gateways, and it disappeared from the list. but mine is not in it.

Tried to find any doc on howto add custom gateway, but with no luck.

this is composer.json from zcredit folder:

{ "name": "omnipay/zcredit", "type": "library", "description": "Z-credit.co.il driver for the Omnipay payment processing library", "keywords": [ "gateway", "merchant", "omnipay", "pay", "payment", "zcredit" ], "homepage": "https://github.com/bbrand/omnipay-zcredit", "license": "MIT", "authors": [ { "name": "Alexei Kositsin", "email": "alxkos.mail@gmail.com" }, { "name": "Omnipay Contributors", "homepage": "https://github.com/bbrand/omnipay-zcredit/contributors" } ], "autoload": { "psr-4": { "Omnipay\\Zcredit\\" : "src/" } }, "require": { "omnipay/common": "~2.0" }, "require-dev": { "omnipay/tests": "~2.0" }, "extra": { "branch-alias": { "dev-master": "2.0.x-dev" } } }

code from json from vendor folder:

{ "require": { "barryvdh/laravel-dompdf": "^0.6.1", "stripe/stripe-php": "3.*", "ignited/laravel-omnipay": "2.*", "omnipay/authorizenet": "^2.4", "omnipay/buckaroo": "^2.1", "omnipay/cardsave": "^2.1", "omnipay/coinbase": "^2.0", "omnipay/common": "^2.5", "omnipay/dummy": "^2.1", "omnipay/eway": "^2.2", "omnipay/firstdata": "^2.3", "omnipay/gocardless": "^2.2", "omnipay/manual": "^2.2", "omnipay/migs": "^2.2", "omnipay/mollie": "^3.1", "omnipay/multisafepay": "^2.3", "omnipay/netaxept": "^2.3", "omnipay/netbanx": "^2.2", "omnipay/payfast": "^2.1", "omnipay/payflow": "^2.2", "omnipay/paymentexpress": "^2.2", "omnipay/paypal": "^2.6", "omnipay/pin": "^2.2", "omnipay/sagepay": "^2.3", "omnipay/securepay": "^2.1", "omnipay/stripe": "^2.4", "omnipay/targetpay": "^2.2", "omnipay/worldpay": "^2.2", "omnipay/zcredit": "^0.1", "collizo4sky/omnipay-2checkout": "^1.4" } }

and part of composer.lock file from vendor folder:

{ "name": "omnipay/zcredit", "version": "v1.0", "source": { "type": "git", "url": "https://github.com/bbrand/omnipay-worldpay.git", "reference": "26ead4ca2c6ec45c9a3b3dad0be8880e0b1df083" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/bbrand/omnipay-worldpay/zipball/26ead4ca2c6ec45c9a3b3dad0be8880e0b1df083", "reference": "26ead4ca2c6ec45c9a3b3dad0be8880e0b1df083", "shasum": "" }, "require": { "omnipay/common": "~2.0" }, "require-dev": { "omnipay/tests": "~2.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "2.0.x-dev" } }, "autoload": { "psr-4": { "Omnipay\\Zcredit\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Alexei Kositsin", "email": "alxkos.mila@gmail.com" }, { "name": "Omnipay Contributors", "homepage": "https://github.com/bbrand/omnipay-worldpay/contributors" } ], "description": "WorldPay driver for the Omnipay payment processing library", "homepage": "https://github.com/bbrand/omnipay-worldpay", "keywords": [ "gateway", "merchant", "omnipay", "pay", "payment", "zcredit" ], "time": "2017-02-23 12:55:58" },

Please help me where I made mistake? Thanks

delatbabel commented 7 years ago

and added info in vendor folder composer.json

You should not need to touch anything in the vendor folder. The vendor folder is built by composer.

but plugin doent see it. i trued to remove one of working gateways, and it disappeared from the list. but mine is not in it.

Doesn't see it where? How are you attempting to load the gateway?

What is the gateway class name for the gateway class that you have added?

bbrandtlv commented 7 years ago

Hey I'm working on my gateway (z-credit) for development i added zcredit folder into vendor folder with my code. I found the problem why i dont see my gateway in my list.

Is there any tutorial for custom gateway creation? and how can I test it? later, once it will work, ill try to deploy it for others. Please help me with this. Thanks!

delatbabel commented 7 years ago

I think the best thing to do is to copy one of the existing gateway codes and modify it.

e.g. there are gateways "Manual" and "Example" which you can use. If your z-credit gateway is REST then you should copy one of the existing REST gateways, e.g. PIN, Stripe, or PayPal_REST