AliOrderArousePay.php 854 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace App\Modules\Trade\Pay;
  3. use App\Libs\Pay\PayFactory;
  4. use Exception;
  5. use Illuminate\Support\Facades\Log;
  6. class AliOrderArousePay extends OrderArousePayAbstract
  7. {
  8. public function arouse(array $data)
  9. {
  10. $ali_param = [
  11. 'body' => '小说阅读',
  12. 'subject' => '追书云',
  13. 'out_trade_no' => $data['trade_no'],
  14. 'timeout_express' => '90m',
  15. 'total_amount' => $data['price'] / 100,
  16. 'product_code' => 'QUICK_WAP_WAY',
  17. 'return_url' => '',
  18. 'type' => $data['type'],
  19. ];
  20. try {
  21. $pay = PayFactory::aliPay();
  22. $result = $pay->send($ali_param);
  23. return $result;
  24. } catch (Exception $e) {
  25. Log::error("创建支付宝订单失败: " . $e->getTraceAsString());
  26. }
  27. }
  28. }