thephpleague / omnipay-paypal

PayPal driver for the Omnipay PHP payment processing library
MIT License
295 stars 174 forks source link

Custom parameter #265

Open Wikko0 opened 1 year ago

Wikko0 commented 1 year ago

Hi, try to add an extra parameter but it doesn't work. I tried the following ways:

     `$purchase = $this->gateway->purchase(array(
            'amount' => $request->amount,
            'currency' => $this->client->currency,
            'returnUrl' => url('success'),
            'cancelUrl' => url('error')
        ));
        $purchase->setParameter('custom', 'custom');
        $response = $purchase->send();`

Error- Call to protected method Omnipay\Common\Message\AbstractRequest::setParameter() from scope App\Http\Controllers\PaymentController

§

$purchase = $this->gateway->purchase(array( 'amount' => $request->amount, 'currency' => $this->client->currency, 'returnUrl' => url('success'), 'cancelUrl' => url('error') )); $data = $purchase->getData(); $data['RANDOM_DATA'] = 'hello'; $purchase->sendData($data);