FastPayTest.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. use PHPUnit\Framework\TestCase;
  3. class FastPayTest extends TestCase
  4. {
  5. public function testPayConfirm()
  6. {
  7. AdaPay\AdaPay::$gateWayType = 'api';
  8. # 初始化快捷支付对象
  9. $obj = new \AdaPaySdk\FastPay();
  10. $fp_params = array(
  11. 'app_id'=> 'app_7d87c043-aae3-4357-9b2c-269349a980d6',
  12. 'payment_id'=> '002112020012010545810065165317376983040',
  13. 'sms_code'=> '123456'
  14. );
  15. # 创建快捷支付确认
  16. $obj->payConfirm($fp_params);
  17. print("创建快捷支付对象".$obj->isError().'=>'.json_encode($obj->result)."\n");
  18. $this->assertTrue($obj->isError());
  19. }
  20. public function testSmsCode()
  21. {
  22. AdaPay\AdaPay::$gateWayType = 'api';
  23. # 初始化快捷支付对象
  24. $obj = new \AdaPaySdk\FastPay();
  25. $fp_params = array(
  26. 'payment_id'=> '20190912'
  27. );
  28. # 创建快捷支付短信发送
  29. $obj->paySmsCode($fp_params);
  30. print("创建快捷支付对象".$obj->isError().'=>'.json_encode($obj->result)."\n");
  31. $this->assertTrue($obj->isError());
  32. }
  33. }