I have a Problem with the paypal_url in a laravel package: return null.
I'm using this package: https://github.com/srmklive/laravel-paypal
This is the output of the variable $response:
`array:3 [▼
"type" => "error"
"message" => ""
"paypal_link" => null
]`
And the other output of $provider, return all my config:
ExpressCheckout {#309 ▼
-client: Client {#307 ▼
-config: array:8 [▼
"curl" => array:2 [▼
32 => 6
64 => false
]
"handler" => HandlerStack {#313 ▼
-handler: Closure {#316 ▼
class: "GuzzleHttp\Handler\Proxy"
parameters: {▼
$request: {▼
typeHint: "Psr\Http\Message\RequestInterface"
}
$options: {▼
typeHint: "array"
}
}
use: {▼
$default: Closure {#311 …}
$streaming: StreamHandler {#317 …}
}
file: "/Users/cuetodev/code/laravel-projects/ce-tickets/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php"
line: "49 to 53"
}
-stack: array:4 [▼
0 => array:2 [▼
0 => Closure {#319 ▼
class: "GuzzleHttp\Middleware"
parameters: {▶}
file: "/Users/cuetodev/code/laravel-projects/ce-tickets/vendor/guzzlehttp/guzzle/src/Middleware.php"
line: "54 to 69"
}
1 => "http_errors"
]
1 => array:2 [▼
0 => Closure {#320 ▼
class: "GuzzleHttp\Middleware"
parameters: {▼
$handler: {▼
typeHint: "callable"
}
}
file: "/Users/cuetodev/code/laravel-projects/ce-tickets/vendor/guzzlehttp/guzzle/src/Middleware.php"
line: "148 to 150"
}
1 => "allow_redirects"
]
2 => array:2 [▼
0 => Closure {#321 ▼
class: "GuzzleHttp\Middleware"
parameters: {▼
$handler: {▼
typeHint: "callable"
}
}
file: "/Users/cuetodev/code/laravel-projects/ce-tickets/vendor/guzzlehttp/guzzle/src/Middleware.php"
line: "27 to 43"
}
1 => "cookies"
]
3 => array:2 [▼
0 => Closure {#322 ▼
class: "GuzzleHttp\Middleware"
parameters: {▼
$handler: {▼
typeHint: "callable"
}
}
file: "/Users/cuetodev/code/laravel-projects/ce-tickets/vendor/guzzlehttp/guzzle/src/Middleware.php"
line: "216 to 218"
}
1 => "prepare_body"
]
]
-cached: Closure {#334 ▼
class: "GuzzleHttp\Middleware"
parameters: {▼
$request: {}
$options: {▼
typeHint: "array"
}
}
use: {▼
$handler: RedirectMiddleware {#330 …}
}
file: "/Users/cuetodev/code/laravel-projects/ce-tickets/vendor/guzzlehttp/guzzle/src/Middleware.php"
line: "55 to 68"
}
}
"allow_redirects" => array:5 [▼
"max" => 5
"protocols" => array:2 [▼
0 => "http"
1 => "https"
]
"strict" => false
"referer" => false
"track_redirects" => false
]
"http_errors" => true
"decode_content" => true
"verify" => true
"cookies" => false
"headers" => array:1 [▼
"User-Agent" => "GuzzleHttp/6.2.1 curl/7.54.0 PHP/7.0.17"
]
]
}
+mode: "sandbox"
#post: Collection {#328 ▼
#items: array:23 [▼
"L_PAYMENTREQUEST_0_NAME0" => "Otra vez COn Pendejadas-general"
"L_PAYMENTREQUEST_0_AMT0" => "82.28"
"L_PAYMENTREQUEST_0_QTY0" => 2
"L_PAYMENTREQUEST_0_NAME1" => "Puras Pendejadas-general"
"L_PAYMENTREQUEST_0_AMT1" => "77.44"
"L_PAYMENTREQUEST_0_QTY1" => 2
"PAYMENTREQUEST_0_ITEMAMT" => 319.44
"PAYMENTREQUEST_0_AMT" => 319.44
"PAYMENTREQUEST_0_PAYMENTACTION" => "Sale"
"PAYMENTREQUEST_0_CURRENCYCODE" => "USD"
"PAYMENTREQUEST_0_DESC" => "Order #13 Invoice"
"PAYMENTREQUEST_0_INVNUM" => "CETICKETS_13"
"NOSHIPPING" => 1
"RETURNURL" => "https://ce-tickets.dev/payment/success"
"CANCELURL" => "https://ce-tickets.dev/order/cancel"
"LOCALE" => "en_US"
"L_BILLINGTYPE0" => "MerchantInitiatedBilling"
"L_BILLINGAGREEMENTDESCRIPTION0" => "Order #13 Invoice"
"USER" => "xxx"
"PWD" => "xxxx"
"SIGNATURE" => "xxxx"
"VERSION" => 123
"METHOD" => "SetExpressCheckout"
]
}
-config: array:11 [▼
"username" => "xxxx"
"password" => "xxxx"
"secret" => "xxxx"
"certificate" => ""
"app_id" => "APP-xxx"
"signature" => "xx"
"api_url" => "https://api-3t.sandbox.paypal.com/nvp"
"gateway_url" => "https://www.sandbox.paypal.com"
"payment_action" => "Sale"
"notify_url" => ""
"locale" => ""
]
-currency: "USD"
-options: []
-paymentAction: "Sale"
-locale: "en_US"
-apiUrl: "https://api-3t.sandbox.paypal.com/nvp"
-notifyUrl: ""
-httpBodyParam: "form_params"
}
I don't know what I doing bad, Just I'm follow the documentation of the package. But Something should be wrong. Someone can help me?
When you are testing the checkout on localhost you must put this option flagged false:
'validate_ssl' => false
Otherwise it gives you that error.