-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Events to add ability to modify payment (including recurrent payment)…
… before charge remp/crm#2136
- Loading branch information
Showing
8 changed files
with
200 additions
and
101 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
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
10 changes: 10 additions & 0 deletions
10
src/dataproviders/PaymentReturnGatewayDataProviderInterface.php
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,10 @@ | ||
<?php | ||
|
||
namespace Crm\PaymentsModule\DataProvider; | ||
|
||
use Crm\ApplicationModule\DataProvider\DataProviderInterface; | ||
|
||
interface PaymentReturnGatewayDataProviderInterface extends DataProviderInterface | ||
{ | ||
public function provide(array $params): string; | ||
} |
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,20 @@ | ||
<?php | ||
|
||
namespace Crm\PaymentsModule\Events; | ||
|
||
use League\Event\AbstractEvent; | ||
|
||
class BeforePaymentBeginEvent extends AbstractEvent | ||
{ | ||
private $payment; | ||
|
||
public function __construct($payment) | ||
{ | ||
$this->payment = $payment; | ||
} | ||
|
||
public function getPayment() | ||
{ | ||
return $this->payment; | ||
} | ||
} |
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,34 @@ | ||
<?php | ||
|
||
namespace Crm\PaymentsModule\Events; | ||
|
||
use League\Event\AbstractEvent; | ||
|
||
class BeforeRecurrentPaymentChargeEvent extends AbstractEvent | ||
{ | ||
private $payment; | ||
|
||
private $token; | ||
|
||
/** | ||
* Same parameters that go to RecurrentPaymentInterface#charge() | ||
* | ||
* @param $payment | ||
* @param $token | ||
*/ | ||
public function __construct($payment, $token) | ||
{ | ||
$this->payment = $payment; | ||
$this->token = $token; | ||
} | ||
|
||
public function getPayment() | ||
{ | ||
return $this->payment; | ||
} | ||
|
||
public function getToken() | ||
{ | ||
return $this->token; | ||
} | ||
} |
Oops, something went wrong.