0

I 'm trying to implement paypal payment with laravel into my website. I used omnipay laravel package and now I'm working with sandbox for testing. I verified I configured my request like this:

$gateway = Omnipay::create('PayPal_Express');
$gateway->setUsername('my_user_name_from_sandbox');
$gateway->setPassword('my_passwrd_from_sandbox');
$gateway->setSignature('my_signature_from_sandbox');

$gateway->setTestMode(true);

$response = $gateway->purchase(
array(
 'cancelUrl' => 'http://localhost/payment_cancel',
  'returnUrl' => 'http://localhost/payment_success',
  'name'    => 'item11',
 'description' => 'description',
 'amount' => '50.00',
 'currency' => 'USD'
)
)->send();

and in the success function I copied the above code :

$response = $gateway->completePurchase(
                array(
                    'cancelUrl' => 'http://localhost/payment_cancel',
                    'returnUrl' => 'http://localhost/payment_success', 
                    'amount' => '50.00',
                    'currency' => 'USD'
                )
        )->send();
  $data = $response->getData(); // this is the raw response object
  echo '<pre>';
  print_r($data);

as a result I get failure transaction:

Array
(
[TIMESTAMP] => 2014-10-29T20:55:40Z
[CORRELATIONID] => 34f24e6e8194c
[ACK] => Failure
[VERSION] => 85.0
[BUILD] => 13565888
[L_ERRORCODE0] => 10002
[L_SHORTMESSAGE0] => Security error
[L_LONGMESSAGE0] => Security header is not valid
[L_SEVERITYCODE0] => Error
)

I verified that the username,password and signature are the same as the sandbox parameters, and I verified that the returned url seperate parameters with &.

--edit--

I have read thisso that I checked the mentioned parameters in the omnipay package and I found this :

protected $liveEndpoint = 'https://api-3t.paypal.com/nvp';
protected $testEndpoint = 'https://api-3t.sandbox.paypal.com/nvp';

the error is : production.ERROR: exception 'Guzzle\Http\Exception\CurlException' with message '[curl] 6: Could not resolve host: api-3t.paypal.com Could you please help me to resolve this problem?

Community
  • 1
  • 1
Dev DOS
  • 1,018
  • 4
  • 18
  • 45
  • If the given duplicate does not cover your case, please make that clear in your question. Then ping me in comments. It's always good to show which of the many documented ways to solve that error have been tried so far by providing reference to existing Q&A and telling why those didn't work. See as well: http://stackoverflow.com/help/how-to-ask – hakre Oct 29 '14 at 21:16
  • @hakre I'm looking for a way to do the payment in test environment with the sandbox account. I have read the answers but it doesn't response to my question. – Dev DOS Oct 29 '14 at 21:22
  • Please outline what you could already identify as not being the cause of the error and provide reference to that *within your question*. This is important so that it becomes clear how your question is different from existing other questions asking about the same error message. – hakre Oct 29 '14 at 21:23
  • @hakre production.ERROR: exception 'Guzzle\Http\Exception\CurlException' with message '[curl] 6: Could not resolve host: api-3t.paypal.com – Dev DOS Oct 30 '14 at 04:47
  • That's a DNS problem. The hostname could not be resolved. – hakre Oct 30 '14 at 07:38

0 Answers0