Comments (11)
Yes, I know about this. This will require deeper refactoring, use 2.0.0 stable in the mean time.
from gopay.
I temporary use somethink like this immediatelly before the payment process call:
/**
* @param Markette\Gopay\Service $goPay
* @throws Markette\Gopay\GopayFatalException
*/
private function setChannels(Markette\Gopay\Service $goPay)
{
$goPay->addChannel($goPay::METHOD_GOPAY, 'GoPay');
$goPay->addChannel($goPay::METHOD_CARD_CESKAS, 'Platba kartou - ČS');
$goPay->addChannel($goPay::METHOD_CARD_UNICREDITB, 'Platba kartou - Unicredit');
$goPay->addChannel($goPay::METHOD_SUPERCASH, 'SuperCash');
$goPay->addChannel($goPay::METHOD_PREMIUMSMS, 'Premium SMS');
$goPay->addChannel($goPay::METHOD_MPLATBA, 'mPlatba');
$goPay->addChannel($goPay::METHOD_KOMERCNIB, 'KB');
$goPay->addChannel($goPay::METHOD_RAIFFEISENB, 'Raiffeisen bank');
$goPay->addChannel($goPay::METHOD_MBANK, 'mBank');
$goPay->addChannel($goPay::METHOD_FIOB, 'FIO banka');
$goPay->addChannel($goPay::METHOD_UNICREDITB, 'Unicredit');
$goPay->addChannel($goPay::METHOD_SLOVENSKAS, 'Slovenská spořitelna');
$goPay->addChannel($goPay::METHOD_TRANSFER, 'Bankovní převod');
}
Tag 2.0.0 is OK at all.
In master instead of ::allowChannel
could be called ::addChannel
from the Extension class . Or no?
from gopay.
Sorry for that - didn't realize it will bump here, please ignore.
Do you have any ideas how to solve this bug once for all?
Approaches I was considering:
- bring back GopaySoap::paymentMethodList() call, just cache its results for a long time
- load list of methods from constants defined in Service.php - the problem is, PHP reflection cannot read phpdoc of these constants, so you lose information about human-readable name of the payment method ($title)
- load list in a way @hranicka suggests, just with the possibility for user to edit/rewrite this specification if needed (so the method probably shouldn't be private)
Seems to me, list of payment methods is quite stable, is even specified in API docs, but changes from time to time.
from gopay.
I vote for caching. And also for load list as @hranicka suggested. There could be quite more options to set it.
from gopay.
Personally, I would totaly remove getting channels. They are not specific for users, it's just something, which tells you which channel is available. Something like xml documentation. Obivously, you have to allow them "manually", so I would implemented only adding channels manually.
from gopay.
So, user have to add/allow channel before pay method is called. Am I right? I'll change it in master then.
from gopay.
Does it mean not adding then via config.neon?
from gopay.
@hrach Did you mean stg like this? https://github.com/f3l1x/Gopay/commit/5691899f3a484b2a105bbd759911d2c56462b70e
Removed:
- allowChannel
- denyChannel
- addRowChannel
- $fetchedChannels
Added:
- onBeforePay - events that allow you to set channels & etc..
from gopay.
Rather not. I think:
- remove allow/deny
- rework addRowChannel to addChannel($code, $name, $logo, $offline, $description)
If you would you only event, it wouldn't be possible to bind buttons to form, would be?
from gopay.
@hrach
https://github.com/f3l1x/Gopay/commit/685fd3f6ae99326c7b714e33c5b6ee8f7d13ea8f - Is it better now?
https://github.com/f3l1x/Gopay/commit/7e096d74eb1b4435880974fad387f6351d24e36c - And do you think about pass channels via extension. I removed it.
from gopay.
yeah, it's seems to be the right way. about extension - dunno. maybe it should stay. in any cas, try it on your project and validate if the attitude is right :)
from gopay.
Related Issues (20)
- Bump 2.3 HOT 1
- [stable] v3.0.0 HOT 1
- Zrušenie recurrent platby HOT 10
- Tracy - tracking panel
- How to set SK lang HOT 8
- EET support HOT 7
- Ambiguous class App\Model\ShopModel resolution HOT 2
- https://testgw.gopay.cz ssl certificate expired HOT 11
- Move to PHP 7.1 HOT 6
- Dependencies - move nette to optional dependencies HOT 1
- ID objednavky muze byt string (nyni jen int) HOT 1
- Update readme
- Remove Nette\Object HOT 5
- Bitcoin platby HOT 4
- Movement ID, additional_params, is there a way how to set?
- Nette 3.0 HOT 1
- Contributte style docs folder
- Nastavení notification_url HOT 1
- Failing tests HOT 1
- trim(): Passing null to parameter #1 ($string) of type string is deprecated
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gopay.