iGenezys's avatar

Omnipays - Questions

Hi. I created a e-commerce website, and naturally, I want to make the payment. I didn't know where to go, so I choose Omnipay, there was a tutorial, I tried this.

Actually I just want to make the PayPal Payment, and next, I'll maybe need some other informations.

But now, I have an error. By following the tutorial, I make this code :

use Omnipay\Omnipay;

$gateway = Omnipay::create('PayPal_Express');
        $gateway->setUsername('t*********r');
        $gateway->setPassword('QLK9UXC3BW');
        $gateway->setSignature('AFcWCpSSRl31A04jGP3hIGDvH-FodEDWEsGPdgGP');

        $gateway->setTestMode(true);

        $response = $gateway->purchase([
            'cancelUrl' => '/',
            'returnUrl' => '/',
            'description'=>'Vente de test',
            'amount' => 50.00,
            'currency' => 'EUR'
        ])->send();

        $response->redirect();

When I click on my "process to payment" button, it should take me to the paypal payment page.

But I have an error "RuntimeException in AbstractResponse.php line 127: This response does not support redirection."

Do you know what did I wrong ? Or what to do for resolve this problem ?

0 likes
0 replies

Please or to participate in this conversation.