File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Paysafe \AccountManagement ;
4+
5+ /**
6+ * Class Merchant
7+ * @package Paysafe\AccountManagement
8+ *
9+ * @property string $id
10+ * @property string $name
11+ * @property \Paysafe\Link[] $links
12+ */
13+ class Merchant extends \Paysafe \JSONObject implements \Paysafe \Pageable {
14+
15+ public static function getPageableArrayKey () {
16+ return "merchant " ;
17+ }
18+
19+ protected static $ fieldTypes = array (
20+ 'id ' => 'string ' ,
21+ 'name ' => 'string ' ,
22+ 'links ' => 'array:\Paysafe\Link '
23+ );
24+ }
Original file line number Diff line number Diff line change 22
33namespace Paysafe ;
44
5+ use Paysafe \AccountManagement \Merchant ;
56use Paysafe \AccountManagement \MerchantAccount ;
67use Paysafe \AccountManagement \MerchantAccountAddress ;
78use Paysafe \AccountManagement \MerchantAccountBusinessOwner ;
@@ -411,4 +412,25 @@ function createMerchantSubAccount(MerchantSubAccount $subAccount)
411412
412413 return new MerchantSubAccount ($ response );
413414 }
415+
416+ /**
417+ * Add merchant account
418+ * @param Merchant $merchant
419+ * @return Merchant
420+ * @throws PaysafeException
421+ */
422+ function addMerchant (Merchant $ merchant )
423+ {
424+ $ merchant ->setRequiredFields (array (
425+ 'name '
426+ ));
427+ $ request = new Request (array (
428+ 'method ' => Request::POST ,
429+ 'uri ' => $ this ->prepareURI ('/merchants ' ),
430+ 'body ' => $ merchant
431+ ));
432+ $ response = $ this ->client ->processRequest ($ request );
433+
434+ return new Merchant ($ response );
435+ }
414436}
You can’t perform that action at this time.
0 commit comments