FastPayCardTest.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace app\api\controller\tests;
  3. use AdaPay;
  4. use PHPUnit\Framework\TestCase;
  5. class FastPayCardTest extends TestCase
  6. {
  7. public function testCardBind()
  8. {
  9. $adaPay = new AdaPay\AdaPay();
  10. $adaPay->gateWayType = 'page';
  11. # 初始化结算账户对象类
  12. $obj = new \AdaPaySdk\FastPayCard();
  13. $fpc_params = array(
  14. 'app_id' => 'app_7d87c043-aae3-4357-9b2c-269349a980d6',
  15. 'card_id' => '666666666666666666666666',
  16. 'tel_no' => '13888888888',
  17. 'member_id' => 'member_id_test',
  18. 'vip_code' => '321',
  19. 'expiration' => '0225'
  20. );
  21. $obj->cardBind($fpc_params);
  22. print("创建快捷支付对象" . $obj->isError() . '=>' . json_encode($obj->result) . "\n");
  23. $this->assertTrue($obj->isError());
  24. }
  25. public function testCardBindConfirm()
  26. {
  27. $adaPay = new AdaPay\AdaPay();
  28. $adaPay->gateWayType = 'page';
  29. # 初始化结算账户对象类
  30. $obj = new \AdaPaySdk\FastPayCard();
  31. $fpc_params = array(
  32. 'sms_code' => '0177857511167541248',
  33. 'apply_id' => '123456',
  34. 'notify_url' => '"https://xxxx.com/xxxx',
  35. );
  36. $obj->cardBindConfirm($fpc_params);
  37. print("创建快捷支付确认对象" . $obj->isError() . '=>' . json_encode($obj->result) . "\n");
  38. $this->assertTrue($obj->isError());
  39. }
  40. public function testCardBindList()
  41. {
  42. $adaPay = new AdaPay\AdaPay();
  43. $adaPay->gateWayType = 'page';
  44. $obj = new \AdaPaySdk\FastPayCard();
  45. $fpc_params = array(
  46. 'app_id' => 'app_7d87c043-aae3-4357-9b2c-269349a980d6',
  47. 'token_no' => '10000067502',
  48. 'member_id' => 'member_id_test'
  49. );
  50. $obj->queryCardList($fpc_params);
  51. print("创建快捷支付查询对象" . $obj->isError() . '=>' . json_encode($obj->result) . "\n");
  52. $this->assertTrue($obj->isError());
  53. }
  54. }