srmklive / laravel-paypal-demo Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://laravel-paypal-demo.srmk.info/
Home Page: https://laravel-paypal-demo.srmk.info/
I am using laravel 5.5 and when I click express checkout link this error fires:
The Response content must be a string or object implementing __toString(), "object" given.
in PayPalRequest.php line 188
at HandleExceptions->handleError(8, 'Undefined index: billing_type', '/var/www/html/paypaldemo/vendor/srmklive/paypal/src/Traits/PayPalRequest.php', 188,array('credentials' => array('mode' => 'sandbox', 'sandbox' => array('username' => 'testmerchant_api1.srmk.info', 'password' => '4C4ADYAFC495VDP2', 'secret' => 'AFcWxV21C7fd0v3bYYYRCpSSRl31AALp5e0GQK12fLrxYB.TY6Er883L', 'certificate' => '', 'app_id' => 'APP-80W284485P519543T'), 'live' =>array('username' => '', 'password' => '', 'secret' => '', 'certificate' => '', 'app_id' => ''), 'payment_action' => 'Sale', 'currency' => 'USD', 'notify_url' => '', 'locale' => '', 'invoice_prefix' => 'PAYPALDEMOAPP')))
I get a 500 Internal server error when I try to access any route withing the application.
an error "Method [getCheckoutData] does not exist." occurs while clicking on express checkout link and it triggers the getExpressCheckout() function. its happening in line:
$cart = $this->getCheckoutData($recurring);
By the way i am using laravel 5.4 if it may change anything.
I am using your package. But after getting response i am getting txn_id from paypal. can you please help us for this issue?
$response = $this->provider->getExpressCheckoutDetails($token);
//echo "<pre>"; print_r($response); die;
if (in_array(strtoupper($response['ACK']), ['SUCCESS', 'SUCCESSWITHWARNING'])) {
}
Using IPN, response status is always invalid.
App\IPNStatus {#2992
id: "3",
payload: "{"cmd":"_notify-validate","mc_gross":"19.97","invoice":"PAYPALDEMOAPP_4","protection_eligibility":"Ineligible","item_number1":null,"tax":"0.00","item_number2":null,"payer_id":"N87V6EEYMMFH8","payment_date":"08:42:40 Mar 28, 2019 PDT","payment_status":"Pending","charset":"windows-1252","mc_shipping":"0.00","mc_handling":"0.00","first_name":"province","mc_fee":"1.27","notify_version":"3.9","custom":null,"payer_status":"verified","business":"[email protected]","num_cart_items":"2","verify_sign":"Ap3sPGZCsD.bcspiEoTLsIgAYzcaAMXw5tkMl0iWWntrioF9bZcy98gz","payer_email":"[email protected]","tax1":"0.00","tax2":"0.00","txn_id":"61Y501985S406590F","payment_type":"instant","last_name":"law","item_name1":"Product 1","receiver_email":"[email protected]","item_name2":"Product 2","payment_fee":"1.27","shipping_discount":"0.00","quantity1":"1","insurance_amount":"0.00","quantity2":"2","receiver_id":"P2WU42H3J3YZC","pending_reason":"paymentreview","txn_type":"cart","discount":"0.00","mc_gross_1":"9.99","mc_currency":"USD","mc_gross_2":"9.98","residence_country":"US","test_ipn":"1","shipping_method":"Default","transaction_subject":"Order #4 Invoice","payment_gross":"19.97","ipn_track_id":"7d2945332dda3"}",
status: "INVALID",
created_at: "2019-03-28 15:42:51",
updated_at: "2019-03-28 15:42:51",
},
App\IPNStatus {#2993
id: "4",
payload: "{"cmd":"_notify-validate","mc_gross":"19.97","invoice":"PAYPALDEMOAPP_5","protection_eligibility":"Ineligible","item_number1":null,"tax":"0.00","item_number2":null,"payer_id":"N87V6EEYMMFH8","payment_date":"08:44:51 Mar 28, 2019 PDT","payment_status":"Pending","charset":"windows-1252","mc_shipping":"0.00","mc_handling":"0.00","first_name":"province","mc_fee":"1.27","notify_version":"3.9","custom":null,"payer_status":"verified","business":"[email protected]","num_cart_items":"2","verify_sign":"AFln1XTG5ic49NimQuUsEdesIkJ1AW.45Rgerqjo7ovlcMN.hpjszzRw","payer_email":"[email protected]","tax1":"0.00","tax2":"0.00","txn_id":"8MT76151B97892834","payment_type":"instant","last_name":"law","item_name1":"Product 1","receiver_email":"[email protected]","item_name2":"Product 2","payment_fee":"1.27","shipping_discount":"0.00","quantity1":"1","insurance_amount":"0.00","quantity2":"2","receiver_id":"P2WU42H3J3YZC","pending_reason":"paymentreview","txn_type":"cart","discount":"0.00","mc_gross_1":"9.99","mc_currency":"USD","mc_gross_2":"9.98","residence_country":"US","test_ipn":"1","shipping_method":"Default","transaction_subject":"Order #5 Invoice","payment_gross":"19.97","ipn_track_id":"11243bba6f712"}",
status: "INVALID",
created_at: "2019-03-28 15:44:58",
updated_at: "2019-03-28 15:44:58",
},
App\IPNStatus {#2994
id: "5",
payload: "{"cmd":"_notify-validate","mc_gross":"19.97","invoice":"PAYPALDEMOAPP_6","protection_eligibility":"Eligible","item_number1":null,"tax":"0.00","item_number2":null,"payer_id":"N87V6EEYMMFH8","payment_date":"01:26:51 Mar 31, 2019 PDT","payment_status":"Completed","charset":"windows-1252","mc_shipping":"0.00","mc_handling":"0.00","first_name":"province","mc_fee":"1.27","notify_version":"3.9","custom":null,"payer_status":"verified","business":"[email protected]","num_cart_items":"2","verify_sign":"Azu.agFazBhPwZk8zKunBXtnXCpaARofGSszkWLL6SAIE6rAW0gSltEK","payer_email":"[email protected]","tax1":"0.00","tax2":"0.00","txn_id":"7Y93689832816493H","payment_type":"instant","last_name":"law","item_name1":"Product 1","receiver_email":"[email protected]","item_name2":"Product 2","payment_fee":"1.27","shipping_discount":"0.00","quantity1":"1","insurance_amount":"0.00","quantity2":"2","receiver_id":"P2WU42H3J3YZC","txn_type":"cart","discount":"0.00","mc_gross_1":"9.99","mc_currency":"USD","mc_gross_2":"9.98","residence_country":"US","test_ipn":"1","shipping_method":"Default","transaction_subject":"Order #6 Invoice","payment_gross":"19.97","ipn_track_id":"4bc55b0a2b9c"}",
status: "INVALID",
created_at: "2019-03-31 08:26:58",
updated_at: "2019-03-31 08:26:58",
},
Hi i copy this project and typing this code
$options = [
'SOLUTIONTYPE' => 'Sole',
];
try {
$response = $this->provider->addOptions($options)->setExpressCheckout($cart, $recurring);
return redirect($response['paypal_link']);
} catch (\Exception $e) {
$invoice = $this->createInvoice($cart, 'Invalid');
session()->put(['code' => 'danger', 'message' => "Error processing PayPal payment for Order $invoice->id!"]);
}
but still return paypal login page
Hello sir, I just copy this repository and I do the instruction but there's some error,
in line
$response = $this->provider->setExpressCheckout($cart, $recurring);
return redirect($response['paypal_link']);
// line 54
the response is error and paypal_link is null, is there something that I missing?
Please help me. Thanks :)
I get this error while executing Express Checkout
The Response content must be a string or object implementing __toString(), "object" given.
I tried dd($response)
, I get this response
array:3 [▼
"type" => "error"
"message" => ""
"paypal_link" => null
]
I am using laravel 5.5.14
Hi, i'm trying to make a recurring payment with these exact steps
And i'm getting this message when redirecting me to paypal account
Sorry, we weren’t able to complete your payment or set up preapproved payments at this time.
Is this issue related to the mechant account settings or what? How can i solve it ???
Hello @srmklive,
Thank you for this nice package!
I am looking at the demo code and noticed the following when creating a new invoice:
if (!strcasecmp($status, 'Completed') || !strcasecmp($status, 'Processed')) {
$invoice->paid = 1;
} else {
$invoice->paid = 0;
}
The code above marks an invoice as paid when it is not completed or processed. Is this the correct logic? Shouldn't be the other way around?
Thanks
Bilal
As titled.
If you click on a link you get
Call to undefined function App\Http\Controllers\express_checkout()
Set validate_ssl to true, when using a self-signed certificate, it seems to be useless, how to set the certificate parameter
Would it be possible to create a new demo that shows the version 2 and version 3 syntax?
Why doesn't it show a Pay with Debit or Credit Card
sandbox mode is working fine, but when i add live api details it giving this errors,
i am using express checkout
"srmklive/paypal": "~1.0",
controller code
$payable_amount = $price_plan_details->price;
$currency_code = get_static_option('site_global_currency');
if (!is_paypal_supported_currency()){
$payable_amount = get_amount_in_usd($payable_amount,get_static_option('site_global_currency'));
if ($payable_amount < 1){
return $payable_amount.__('USD amount is not supported by paypal');
}
$currency_code = 'USD';
}
$product = [];
$product['items'] = [
[
'name' => $price_plan_details->title,
'price' =>$payable_amount,
'desc' => 'Payment For Order Id: #'.$order_details->id.' Package Name: '.$price_plan_details->title.' Payer Name: '.$request->name.' Payer Email:'.$request->email,
'qty' => 1
]
];
$product['invoice_id'] = $order_details->id;
$product['invoice_description'] = 'Payment For Order Id: #'.$order_details->id.' Package Name: '.$price_plan_details->title.' Payer Name: '.$request->name.' Payer Email:'.$request->email;
$product['return_url'] = route('frontend.paypal.ipn',$order_details->id);
$product['cancel_url'] = route('frontend.order.payment.cancel',$order_details->id);
$product['custom'] = $order_details->track;
$product['total'] = $payable_amount;
$paypalModule = new ExpressCheckout;
$res = $paypalModule->setCurrency($currency_code);
$res = $paypalModule->setExpressCheckout($product);
$res = $paypalModule->setExpressCheckout($product, true);
return redirect($res['paypal_link']);
TypeError
Argument 1 passed to Symfony\Component\HttpFoundation\Response::setContent() must be of the type string or null, object given, called in /home/mygaming/public_html/distro/@core/vendor/laravel/framework/src/Illuminate/Http/Response.php on line 65
Whoops, looks like something went wrong.
1/1
ErrorException in ExpressCheckout.php line 125:
Undefined index: TOKEN
in ExpressCheckout.php line 125
at HandleExceptions->handleError(8, 'Undefined index: TOKEN', 'C:\xampp\htdocs\paydemo\vendor\srmklive\paypal\src\Services\ExpressCheckout.php', 125, array('data' => array('items' => array(array('name' => 'Product 1', 'price' => 9.9900000000000002, 'qty' => 1), array('name' => 'Product 2', 'price' => 4.9900000000000002, 'qty' => 2)), 'return_url' => 'http://localhost/paydemo/public/paypal/ec-checkout-success', 'invoice_id' => 'PAYPALDEMOAPP_4', 'invoice_description' => 'Order #4 Invoice', 'cancel_url' => 'http://localhost/paydemo/public', 'total' => 19.969999999999999), 'subscription' => false, 'response' => array('type' => 'error', 'message' => ''))) in ExpressCheckout.php line 125
at ExpressCheckout->setExpressCheckout(array('items' => array(array('name' => 'Product 1', 'price' => 9.9900000000000002, 'qty' => 1), array('name' => 'Product 2', 'price' => 4.9900000000000002, 'qty' => 2)), 'return_url' => 'http://localhost/paydemo/public/paypal/ec-checkout-success', 'invoice_id' => 'PAYPALDEMOAPP_4', 'invoice_description' => 'Order #4 Invoice', 'cancel_url' => 'http://localhost/paydemo/public', 'total' => 19.969999999999999), false) in PayPalController.php line 42
at PayPalController->getExpressCheckout(object(Request))
at call_user_func_array(array(object(PayPalController), 'getExpressCheckout'), array(object(Request))) in Controller.php line 55
at Controller->callAction('getExpressCheckout', array(object(Request))) in ControllerDispatcher.php line 44
at ControllerDispatcher->dispatch(object(Route), object(PayPalController), 'getExpressCheckout') in Route.php line 204
at Route->runController() in Route.php line 160
at Route->run() in Router.php line 559
at Router->Illuminate\Routing{closure}(object(Request)) in Pipeline.php line 30
at Pipeline->Illuminate\Routing{closure}(object(Request)) in SubstituteBindings.php line 41
at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing{closure}(object(Request)) in VerifyCsrfToken.php line 65
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing{closure}(object(Request)) in StartSession.php line 64
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing{closure}(object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in Router.php line 561
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 520
at Router->dispatchToRoute(object(Request)) in Router.php line 498
at Router->dispatch(object(Request)) in Kernel.php line 174
at Kernel->Illuminate\Foundation\Http{closure}(object(Request)) in Pipeline.php line 30
at Pipeline->Illuminate\Routing{closure}(object(Request)) in TransformsRequest.php line 30
at TransformsRequest->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing{closure}(object(Request)) in TransformsRequest.php line 30
at TransformsRequest->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing{closure}(object(Request)) in ValidatePostSize.php line 27
at ValidatePostSize->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing{closure}(object(Request)) in CheckForMaintenanceMode.php line 46
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing{closure}(object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in Kernel.php line 149
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116
at Kernel->handle(object(Request)) in index.php line 53
Hi,
I installed demo and tried the following url http://localhost:8000/paypal/ec-checkout
(with last version of Laravel, 5.5)
ErrorException (E_RECOVERABLE_ERROR)
Object of class Illuminate\Routing\Redirector could not be converted to string
When I apply the shipping via conditions and checkout I get this error all my api details are correct in regards to the sandbox account info could someone please assist
Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users
add unique users_email_unique
(email
))
I've installed this demo successfully and published the config file with my own API credentials,
When i attempt to pay i get the wrong store name ( not the one i used while setting up the sandbox account)
And the sandbox business account wont get credited even though the buyer's account was debited .
Thanks
Hi i cloned your repository "laravel-paypal-demo" and configured the app exactly as you mentioned in installation steps , i replaced the Sandbox api credentials with mine , then when i run the app , and choose Express Checkout , it redirects me to paypal login and i enter my sandbox buyer account credentials , then after login i get redirected to this paypal page displaying " We’re sorry Things don’t appear to be working at the moment.
"
ErrorException
Undefined index: certificate
vendor/srmklive/paypal/src/Traits/PayPalRequest.php:234
did someone encounter this certificate error?
I put my paypal signature on it.
i integrate my project with paypal with this package
but if The Price is 9.99 Working But get the Price or Any input name get null Can One Help me
This is My Full Code In paypalController
https://codeshare.io/G6v6lg
How to get the Payment details of Adaptive Payment on success and cancel page ?
Object of class Illuminate\Routing\Redirector could not be converted to string
GET http://localhost:8000/paypal/ec-checkout 500 (Internal Server Error)
ErrorException (E_RECOVERABLE_ERROR)
Object of class Illuminate\Routing\Redirector could not be converted to string
I got this error after following all the steps how to run the demo. After clicking the links this error appears.
i've used this logo https://upload.wikimedia.org/wikipedia/commons/c/c3/Eye.png
$options = [ 'BRANDNAME' => 'Havendwell', 'LOGOIMG' => 'https://upload.wikimedia.org/wikipedia/commons/c/c3/Eye.png', 'CHANNELTYPE' => 'Merchant' ]; $provider->addOptions($options);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.