| Total Complexity | 2 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | final class TransferRequest |
||
| 18 | { |
||
| 19 | use GetPayloadTrait; |
||
| 20 | use AmountFormatterTrait; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @param Email $recipientEmail |
||
| 24 | * @param Money $amount |
||
| 25 | * @param Description $description |
||
| 26 | */ |
||
| 27 | public function __construct(Email $recipientEmail, Money $amount, Description $description) |
||
| 28 | { |
||
| 29 | $this->payload = [ |
||
| 30 | 'bnf_email' => strval($recipientEmail), |
||
| 31 | 'currency' => strval($amount->getCurrency()), |
||
| 32 | 'amount' => $this->formatToFloat($amount), |
||
| 33 | 'subject' => $description->getSubject(), |
||
| 34 | 'note' => $description->getText(), |
||
| 35 | ]; |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Your reference ID (must be unique if submitted). |
||
| 40 | * |
||
| 41 | * @param TransactionID $transactionId |
||
| 42 | * |
||
| 43 | * @return $this |
||
| 44 | */ |
||
| 45 | public function setReferenceTransaction(TransactionID $transactionId): self |
||
| 50 | } |
||
| 51 | } |
||
| 52 |