This repository was archived by the owner on Sep 4, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
src/Request/Method/Payment Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Electrum \Request \Method \Payment ;
4+
5+ use Electrum \Request \AbstractMethod ;
6+ use Electrum \Request \MethodInterface ;
7+ use Electrum \Response \Exception \ElectrumResponseException ;
8+
9+ /**
10+ * Return a payment request.
11+ * @author Pascal Krason <p.krason@padr.io>
12+ */
13+ class Broadcast extends AbstractMethod implements MethodInterface
14+ {
15+
16+ /**
17+ * @var string
18+ */
19+ private $ method = 'broadcast ' ;
20+
21+ /**
22+ * @var string
23+ * Serialized transaction (hexadecimal)
24+ */
25+ private $ transaction = '' ;
26+
27+ /**
28+ * @param array $optional
29+ *
30+ * @return PaymentRequestResponse|null
31+ * @throws \Electrum\Request\Exception\BadRequestException
32+ * @throws \Electrum\Response\Exception\ElectrumResponseException
33+ */
34+ public function execute (array $ optional = [])
35+ {
36+ $ data = $ this ->getClient ()->execute ($ this ->method , array_merge ([
37+ 'tx ' => $ this ->getTransaction ()
38+ ], $ optional ));
39+
40+ return isset ($ data [1 ]) ? $ data [1 ] : null ;
41+ }
42+
43+ /**
44+ * Get the value of Transaction
45+ *
46+ * @return string
47+ */
48+ public function getTransaction ()
49+ {
50+ return $ this ->transaction ;
51+ }
52+
53+ /**
54+ * Set the value of Transaction
55+ *
56+ * @param string transaction
57+ *
58+ * @return self
59+ */
60+ public function setTransaction ($ transaction )
61+ {
62+ $ this ->transaction = $ transaction ;
63+
64+ return $ this ;
65+ }
66+
67+ }
You can’t perform that action at this time.
0 commit comments