简体   繁体   English

使用Laravel 4的PayPal rest-api-sdk-php

[英]PayPal rest-api-sdk-php with Laravel 4

I'm trying to find out how to actually use the 'rest-api-sdk-php' with Laravel 4 ... I've updated composer and the library is ready to be used, but do I need to add an alias to the app.php file? 我正在尝试找出如何在Laravel 4中实际使用'rest-api-sdk-php'...我已经更新了作曲家,可以使用该库了,但是我是否需要在其中添加别名app.php文件?

I've tried calling $apiContext = new ApiContext but ApiContext cannot be found. 我尝试调用$apiContext = new ApiContext但是ApiContext

I just don't see any reference to how to actually use this library at all. 我只是根本看不到有关如何实际使用此库的任何参考。

Help initiating a call would be most apprecaited! 最适合帮助发起呼叫!

You can try this 你可以试试这个

A Paypal package for Laravel 4 if you need. 如果需要,可使用Laravel 4的Paypal软件包。 https://github.com/xroot/laravel-paypalpayment https://github.com/xroot/laravel-paypalpayment

It internally uses the REST SDK 它在内部使用REST SDK

Try inserting the following line as the PayPal classes are under their own namespace. 尝试插入以下行,因为PayPal类位于其自己的名称空间下。

use PayPal\Rest\ApiContext;

Do the same for the rest of the PayPal classes you will be using on your controller 对您将在控制器上使用的其余PayPal类执行相同的操作

You can try this using laravel-paypalpayment . 您可以使用laravel-paypalpayment尝试此操作。
It is a simple package that helps you to process direct credit card payments, stored credit card payments and PayPal account payments with your Laravel 4/5 projects using PayPal REST API SDK . 它是一个简单的程序包,可帮助您使用PayPal REST API SDK通过Laravel 4/5项目处理直接信用卡付款,已存储的信用卡付款和PayPal帐户付款。
Below is link given: 以下是给出的链接:
https://github.com/xroot/laravel-paypalpayment https://github.com/xroot/laravel-paypalpayment

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM