merchant-encry.php 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /**
  3. * 1.1 商户进件 -> 新增商户进件
  4. * 接口:/api/v3/tkbs/merchant_encry
  5. * 请求加密:SM4 返回解密:SM4
  6. */
  7. $config = require __DIR__ . '/bootstrap.php';
  8. $api = new \Lakala\OpenAPISDK\V3\Api\LakalaApi($config, \Lakala\OpenAPISDK\V3\Api\EncryptMode::BOTH);
  9. $request = new \Lakala\OpenAPISDK\V3\Model\ModelRequest();
  10. $request->setReqData([
  11. 'org_code' => JINGJIAN_ORG_CODE,
  12. 'user_no' => JINGJIAN_USER_NO,
  13. 'email' => '2804711849@qq.com',
  14. 'busi_code' => 'WECHAT_PAY',
  15. 'mer_reg_name' => '花掌柜进件测试',
  16. 'mer_type' => 'TP_PERSONAL',
  17. 'mer_name' => '花掌柜进件测试商户',
  18. 'mer_addr' => '柳州市解放南路金鱼巷1号花旗壹号楼15-10',
  19. 'province_code' => '6100',
  20. 'city_code' => '6140',
  21. 'county_code' => '986140',
  22. 'license_name' => '烟酒行批发24小时',
  23. 'license_no' => '92450202MA5MWYQK23',
  24. 'license_dt_start' => '2017-11-21',
  25. 'license_dt_end' => '9999-12-31',
  26. 'latitude' => '114.034257',
  27. 'longtude' => '22.663572',
  28. 'source' => 'H5',
  29. 'business_content' => '烟酒行批发24小时',
  30. 'lar_name' => '徐哈哈',
  31. 'lar_id_type' => '01',
  32. 'lar_id_card' => '460027200111297612',
  33. 'lar_id_card_start' => '2015-01-16',
  34. 'lar_id_card_end' => '2035-01-16',
  35. 'contact_mobile' => '18276770550',
  36. 'contact_name' => '徐哈哈',
  37. 'openning_bank_code' => '103614010818',
  38. 'openning_bank_name' => '中国农业银行广西柳州市柳南支行营业室',
  39. 'clearing_bank_code' => '103100000026',
  40. 'settle_province_code' => '45',
  41. 'settle_province_name' => '广西',
  42. 'settle_city_code' => '6140',
  43. 'settle_city_name' => '柳州市',
  44. 'account_no' => '6228480850854176714',
  45. 'account_name' => '徐丽',
  46. 'account_type' => '58',
  47. 'account_id_card' => '460027200111297612',
  48. 'account_id_dt_start' => '2015-01-16',
  49. 'account_id_dt_end' => '2035-01-16',
  50. 'settle_type' => 'D1',
  51. 'settlement_type' => 'AUTOMATIC',
  52. 'biz_content' => [
  53. 'term_num' => '1',
  54. 'mcc' => '11002',
  55. 'activity_id' => '37',
  56. 'fees' => [
  57. ['fee_code' => 'WECHAT', 'fee_value' => '0.60'],
  58. ['fee_code' => 'ALIPAY', 'fee_value' => '0.60'],
  59. ['fee_code' => 'SCAN_PAY', 'fee_value' => '0.60'],
  60. ['fee_code' => 'DEBIT_CARD', 'fee_value' => '0.38', 'top_fee' => '20'],
  61. ['fee_code' => 'CREDIT_CARD', 'fee_value' => '0.6'],
  62. ['fee_code' => 'UNIONPAY_WALLET_DEBIT_FEE', 'fee_value' => '0.38', 'top_fee' => '20'],
  63. ['fee_code' => 'UNIONPAY_WALLET_CREDIT_FEE', 'fee_value' => '0.6'],
  64. ],
  65. ],
  66. 'attchments' => [
  67. ['id' => 'merchant/null/20231227172245221010CHECKSTAND_IMG.png', 'type' => 'CHECKSTAND_IMG'],
  68. ['id' => 'merchant/null/20231227172251776083SHOP_OUTSIDE_IMG.png', 'type' => 'SHOP_OUTSIDE_IMG'],
  69. ],
  70. ]);
  71. try {
  72. $response = $api->tradeApi('/api/v3/tkbs/merchant_encry', $request);
  73. // print_r($response->getRespData());
  74. // echo $response->getCode();
  75. // print_r($response->getHeaders());
  76. echo $response->getOriginalText();
  77. } catch (\Lakala\OpenAPISDK\V3\ApiException $e) {
  78. echo $e->getMessage();
  79. }