2

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?

I've tried calling $apiContext = new ApiContext but ApiContext cannot be found.

I just don't see any reference to how to actually use this library at all.

Help initiating a call would be most apprecaited!

2
  • 1
    Have you tried composer dump-auto? This command adds the classes to Composer's autoload mapping. Commented Aug 21, 2013 at 18:54
  • Yeah, that didn't make a difference. I just don't know how I'm supposed to initiate the API. Commented Aug 21, 2013 at 21:53

3 Answers 3

2

You can try this

A Paypal package for Laravel 4 if you need. https://github.com/xroot/laravel-paypalpayment

It internally uses the REST SDK

Sign up to request clarification or add additional context in comments.

Comments

1

Try inserting the following line as the PayPal classes are under their own namespace.

use PayPal\Rest\ApiContext;

Do the same for the rest of the PayPal classes you will be using on your controller

2 Comments

Yeah, this got me past my first hurdle ... but now I'm dealing with the fact that there is no JSON response whatsoever ... the PayPal API is the WORST!
Do you have any idea what the Service Provider should be?
0

You can try this using 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.
Below is link given:
https://github.com/xroot/laravel-paypalpayment

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.