Last active
June 20, 2018 19:24
-
-
Save young-steveo/e6771bdcf02590aef8d058c2f7080d71 to your computer and use it in GitHub Desktop.
Array Oriented Programming - Refined Transaction
This file contains hidden or 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 | |
final class Payment { | |
public function subscribe(PostParams $data) : Transaction { | |
$transaction = Transaction::fromPost($data); | |
$model = new TransactionModel(); | |
$model->create($transaction); | |
$processor = $model->getProcessor($transaction); // a Processor object | |
$model->process($processor, $transaction); // status is encapsulated elsewhere. | |
return $transaction->sanitized(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment