forked from contributte/gopay
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
better check interface then type of submitted button
in example is checking of type of button submited, but you extended from Nette\Forms and you need getChanell function , so it should be better to implement interface public function gopayButtonsSubmittedForm(\Markette\Gopay\IPaymentButton $button) { $channel = $button->getChannel(); }
- Loading branch information
Showing
3 changed files
with
15 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Markette\Gopay; | ||
|
||
interface IPaymentButton | ||
{ | ||
|
||
|
||
|
||
|
||
|
||
function getChannel(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c6b5359
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bad example in documentation? need to check interface not type of button?
c6b5359
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly is this change good for?
c6b5359
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Markette/Gopay in README.md you have:
$gopay->bindPaymentButtons($form, array($this->submittedForm));
Předaný callback bude zavolán po úspěšném odeslání formuláře jedním z platebních tlačítek (tedy jako po zavolání ->onClick[] na daném tlačítku). Zvolený kanál lze získat z tlačítka:
public function submittedForm(Markette\Gopay\PaymentButton $button)
{
$channel = $button->getChannel();
}
and this typehint is quite problematic, because when I use METHOD_GOPAY as payment method, it crashes because METHOD_GOPAY uses Markette\Gopay\ImagePaymentButton instead of Markette\Gopay\PaymentButton
c6b5359
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see now, you're right. Oki.