add-shop-term-or-term.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * 1.3 商户信息变更 -> 增网增终接口(400商户)
  4. * 接口:/api/v3/tkbs/open_merchant_addShopTermOrTerm
  5. * 请求加密:SM4 返回解密:SM4
  6. * shop_id 为空走增店增终逻辑,不为空走增终逻辑
  7. */
  8. $config = require __DIR__ . '/bootstrap.php';
  9. $api = new \Lakala\OpenAPISDK\V3\Api\LakalaApi($config, \Lakala\OpenAPISDK\V3\Api\EncryptMode::BOTH);
  10. $request = new \Lakala\OpenAPISDK\V3\Model\ModelRequest();
  11. $request->setReqData([
  12. 'org_code' => JINGJIAN_ORG_CODE,
  13. 'merchant_no' => '8222240581208PS',
  14. 'customer_no' => '100134759',
  15. 'shop_id' => null,
  16. 'shop_name' => '5000015-xxxpro青橙哈哇哦',
  17. 'city_code' => '3610',
  18. 'city_name' => '合肥市',
  19. 'province_code' => '3600',
  20. 'province_name' => '安徽省',
  21. 'shop_dist_code' => '110010',
  22. 'shop_dist_name' => '东丽区',
  23. 'shop_addr' => '安徽省-合肥市-东丽区-空港环河北路76号333333',
  24. 'shop_contact_name' => '于丽',
  25. 'shop_contact_mobile' => '13516288004',
  26. 'term_num' => 1,
  27. 'bz_pos' => 'WECHAT_PAY',
  28. 'fees' => [
  29. ['fee' => 0.45, 'fee_type' => 'DEBIT_CARD', 'top_fee' => 20],
  30. ['fee' => 0.6, 'fee_type' => 'CREDIT_CARD'],
  31. ],
  32. 'attachments' => [],
  33. ]);
  34. try {
  35. $response = $api->tradeApi('/api/v3/tkbs/open_merchant_addShopTermOrTerm', $request);
  36. print_r($response->getRespData());
  37. echo $response->getCode();
  38. print_r($response->getHeaders());
  39. echo $response->getOriginalText();
  40. } catch (\Lakala\OpenAPISDK\V3\ApiException $e) {
  41. echo $e->getMessage();
  42. }