We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

Christopher • 7 years ago

why "php artisan vendor:publish doesn't make the file "paypal.php" on my "Config" folder? please help me

Hardik Savani • 7 years ago

Hi, Christopher
Maybe package install not properly
Can you uninstall and try again pls

Christopher • 7 years ago

i did it anyway... just i made manually the file and it work perfectly. THX for this post :D

Sharif Uddin Ahamed • 7 years ago

I have more then 1 item in database. I use following Code :

$order_discount = $order->invoice->discount;
$order_subtotal = $order->invoice->sub_total;
$order_grandtotal = $order->invoice->grand_total;

$i = 1;
$order_items = array();
foreach ($order->invoice->products as $product) {

$order_items[$i] = new Item();
$order_items[$i]->setName($product->name)
->setCurrency('USD')
->setQuantity($product->qty)
->setPrice($product->price);

$i++;
}

if ($order->order_discount > 0) {
$order_items[$i] = new Item();
$order_items[$i]->setName('Discount')
->setCurrency('USD')
->setQuantity(1)
->setPrice('-' . $order_discount);
}

$item_list = new ItemList();
$item_list->setItems($order_items);

$amount_details = new Details();
$amount_details->setSubtotal($order_subtotal);

$amount = new Amount();
$amount->setCurrency('USD')
->setDetails($amount_details)
->setTotal($order_grandtotal);
$transaction = new Transaction();
$transaction->setAmount($amount)
->setItemList($item_list)
->setDescription('Your transaction description')

But it return
PayPalConnectionException in PayPalHttpConnection.php line 154:
Got Http response code 400 when accessing https://api.sandbox.paypal.....

Eleazar Reséndez • 6 years ago

setPrice() and setTotal() must be equal

Sharif Uddin Ahamed • 6 years ago

I did not find any solution yet. here my controller code : https://pastebin.com/yR5L5i3G can you check please? https://uploads.disquscdn.c...

Eleazar Reséndez • 6 years ago

According to what I read, that problem is caused because the sum of the items must be equal to the total, sum all your items and verify if it is equal to what you put in total. (setPrice() and setTotal())

Try a simple test.

Put only one item, price 10 USD and total put 10 USD.
With that, you should open paypal and should not appear error 400.

Eleazar Reséndez • 7 years ago

Good day, could you tell me how you solved this problem?

Shalini Sebastian • 6 years ago

https://uploads.disquscdn.c...

After entering paypal account details, getting below error. Please help

Dawn Dawn • 6 years ago

someone please help me to work this tutorial on laravel 5.4

ojijo • 6 years ago

i am new to laravel but i have followed the steps but vendor publish doesn't create the config file, i had to create it manually but in the end am having an error,FatalThrowableError in AddMoneyController.php line 33:
Cannot call constructor https://uploads.disquscdn.c...

Dawn Dawn • 6 years ago

ojijo did you get help?

ojijo • 6 years ago

No i haven't maybe it's am using laravel 5.4 but it keeps on bringing that error in the line in the AddMoneyController line 33 where there is parent::__construct();

sahraoui • 6 years ago

FatalErrorException in AddMoneyController.php line 119: Class 'Input' not found

mlops • 7 years ago

nice.. tanks

Olanrewaju Abidogun • 7 years ago

Hi, thanks for the tutorial, it is very great. I cant get the value I paid from the paypal response. How can I do this so I can save the value in database and give value to user. Please help.

Hardik Savani • 7 years ago

You set this way on return url : $redirectUrls->setReturnUrl(route('getDone',['id'=>12]));