douwen8424 2015-07-29 19:23
浏览 30
已采纳

通过composer在Laravel 5.1中使用Authorize.Net SDK

What is the best practice when using third-party SDKs with Laravel?

After loading Authorize.net SDK via composer like so...

composer require authorizenet/authorizenet:~1.8

Do I need to add AuthorizeNet class to providers list in /config/app.php

What needs to be added specifically and how to make class work in controller?

I'm trying to add Authorizenet\AuthorizeNetARB::class, to /config/app.php and use Authorizenet\AuthorizeNetARB; to my controller but getting this error: FatalErrorException in ProviderRepository.php line 146: Class 'Authorizenet\AuthorizeNetARB' not found

  • 写回答

1条回答 默认 最新

  • doumisha5081 2015-07-29 21:18
    关注

    No you don't need to add it to your config/app.php because it's not a Laravel-package.

    You can directly use AuthorizeNetARB because it's not namespaced.

    $example = New \AuthorizeNetARB();
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 u盘问题:盘符不显示 无媒体
  • ¥50 R语言读取nc按月均值转为tif
  • ¥30 智能车串级pid调参
  • ¥15 visual studio code翻译老是错误
  • ¥20 卫星测高数据的高程转换
  • ¥15 爬取招聘网站数据信息
  • ¥15 安装完tensorflow,import tensorflow as tf后报错,如何解决?
  • ¥15 ultralytics库导出onnx模型,模型失去预测能力
  • ¥15 linux下点对点协议连接2个USB串口的硬件流量控制问题
  • ¥15 SQL数据自动生成问题