Created
July 10, 2018 23:35
-
-
Save davidchc/fdf693804217b7a1aa637da078ebbaf7 to your computer and use it in GitHub Desktop.
Gateway de pagamento
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
<?php | |
namespace Payment; | |
interface Gateway | |
{ | |
public function processPayment($order_id); | |
public function success($order_id); | |
public function callback(); | |
} |
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
<?php | |
class MethodPayment | |
{ | |
private $gateways; | |
public function __construct() | |
{ | |
$this->gateways = []; | |
} | |
public function addGateway(Gateway $gateway) | |
{ | |
$this->gateways[] = $gateway; | |
} | |
} |
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
<?php | |
namespace Payment; | |
class PagSeguro implements Gateway { | |
public function processPayment($order_id) | |
{ | |
} | |
public function success($order_id) | |
{ | |
} | |
public function callback() | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment