PayPal rest-api-sdk-php with Laravel 4 - php

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!

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

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

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

Related

Laravel Stripe Cashier to Delete a Customer

How do I delete a customer in Stripe using Laravel's Cashier built-in method?
I know there's a way to delete a customer through Stripe's API - https://stripe.com/docs/api/customers/delete But I want to use Laravel's Cashier method because it is much cleaner in my code instead of creating another code to use Guzzle in working on Stripe API.
Any help or tips is greatly appreciated! Thanks!
There doesn't appear to be a delete method for Customers with Laravel Cashier. You'll need to make that API call to Stripe directly.

Stripe take payment using saved card laravel php

How can i use saved card in stripe for next payment in future using stripe in Laravel framework?
I have tried to find out in Stripe official documentation but i could not find the best solution.
You may want to ask the Laravel/Cashier community for more advice, but it looks like you can retrieve a customer's payment methods like this (docs):
$paymentMethods = $user->paymentMethods();
If you're referring to use with future invoices (eg for subscriptions) you may want to set a default (docs):
$user->updateDefaultPaymentMethod($paymentMethod);
I have found the solution with the help of stripe document.
Here is the reference link https://stripe.com/docs/payments/save-and-reuse?platform=web
With the use of demo i got success. And its working properly.
Thanks for another answers.
One way to do it is using Stripe's future payments. On that documentation one can find PHP examples that can be translated into Laravel.
Depending on the use case, Laravel Cashier might also be of relevance.
A Stripe account will be required (here's the Sign Up page).
Here one can find how to get up and running with a Stripe integration in PHP.
Even though related with Django, my answer here on a similar issue might be of relevance.

How to set and use includeTransactions with Authorize.net PHP SDK?

I and others have been working with the Authorize.net automatic recurring billing (ARB) portion of the API, trying to retrieve recent transactions related to a subscription.
The documentation (https://developer.authorize.net/api/reference/#recurring-billing-get-subscription-status) for ARBGetSubscriptionRequest states that there is an optional parameter includeTransactions that will return recent transactions associated with the subscription.
The PHP SDK seems to be missing the parameter includeTransactions.
In my call to Authorize.net, the following results in an error:
$subscription->setIncludeTransactions(true);
Has anyone managed to get it working?
Related github issues: #120, #280
I suspect that includeTransactions support has been implemented in the underlying Authorize.net API; however, the PHP SDK is woefully out of date. And no sample code has been forthcoming from Authorize.net (earliest request is from June 2016)
So, for my purposes, I forked the PHP SDK:
https://github.com/sjordan1975/sdk-php
I implemented get ARB Transaction from Get Subscription sufficient for what I needed.
Specifically, I modified the following 4 files:
lib/net/authorize/api/contract/v1/ARBGetSubscriptionRequest.php
lib/net/authorize/api/contract/v1/ARBSubscriptionMaskedType.php
lib/net/authorize/api/yml/v1/ARBGetSubscriptionRequest.yml
lib/net/authorize/api/yml/v1/ARBSubscriptionMaskedType.yml
Immediately after setting setSubscriptionID in the sample code (https://github.com/AuthorizeNet/sample-code-php/blob/master/RecurringBilling/get-subscription-status.php) add the following:
$request->setIncludeTransactions(true);
Note: I have used TransactionDetailsType whereas I suspect the actual type should be something like ARBTransactionType, but the yaml definition is missing and I have not defined it
The result is for now not all transaction data is populated; HOWEVER, transId IS populated and this is good enough to make an additional API call to get Transaction Details.
Feel free to have at it. Code provided AS IS to the Community. YMMV

Paypal: How to create recurring profile in payflow

I need to create recurring profile using payflow. Is there any good library for this which I can use.
I know what parameters I have to pass. But, which method I need to call is confusing me.
I am new to this. So, I am not getting exactly what I have to do. I have my payflow details. I can login into my manager.paypal.com and I can see its activated. I have used angelleye library. But, there isn't any library for creating recurring profile using PayFlow.
Please Help.
You can use my library to get this done the same you would anything else you do with PayFlow. Just open up that PayFlow file that's included with my library and adjust the parameters accordingly.
PayPal provides detailed documentation on recurring billing with PayFlow. Any parameters that are shown there but aren't included with my library file can simply be added.

Integrating DoDirect API using php in PayPal

I am trying to get the Paypal issue resolved whereby the users are made to make payments using the Do Direct method of Paypal... please suggest me some sort of tutorial for this implementation..
Check the paypal integration center, I think what you're calling "do direct" is the Express checkout process.
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_SetExpressCheckout
For Direct payment you have to use the NVP api.
Here's an example using Cake PHP and cURL but I think you can port it easily to pure PHP.
http://bakery.cakephp.org/articles/view/paypal-datasource
official paypal docs as SleepyCod pointed out
_https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_NVPAPIOverview#id09C2F060QRO
and
here is a sample code
https://cms.paypal.com/cms_content/US/en_US/files/developer/nvp_DoDirectPayment_php.txt

Categories