| Total Complexity | 3 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | final class PayoutRequest |
||
| 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(Money $amount, Description $description) |
||
| 28 | { |
||
| 29 | $this->payload = [ |
||
| 30 | 'currency' => strval($amount->getCurrency()), |
||
| 31 | 'amount' => $this->formatToFloat($amount), |
||
| 32 | 'subject' => $description->getSubject(), |
||
| 33 | 'note' => $description->getText(), |
||
| 34 | ]; |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Your reference ID (must be unique if submitted). |
||
| 39 | * |
||
| 40 | * @param TransactionID $transactionId |
||
| 41 | * |
||
| 42 | * @return $this |
||
| 43 | */ |
||
| 44 | public function setReferenceTransaction(TransactionID $transactionId): self |
||
| 45 | { |
||
| 46 | $this->payload['frn_trn_id'] = strval($transactionId); |
||
| 47 | |||
| 48 | return $this; |
||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Set transaction_id of the original payment for quick checkout payouts |
||
| 53 | * |
||
| 54 | * @param TransactionID $transactionId instance |
||
| 55 | * @return $this |
||
| 56 | */ |
||
| 57 | public function setOriginalTransactionId(TransactionId $transactionId): self |
||
| 63 | } |
||
| 64 | } |
||
| 65 |