Skip to content

Conversation

phpmathan
Copy link

Adding support to send custom parameters.

send() method changed to send(array $datas = array(), $doMerge = true) to accept custom parameters.

use Omnipay\Common\GatewayFactory;

$gateway = GatewayFactory::create($gatewayName);
$gateway->initialize($gatewaySettings);

$defaultParams = array();
$request = $gateway->authorize($defaultParams);

$params = $request->getData();
$params['custom'] = 'value';

$response = $request->send($params, false);

@amacneil
Copy link
Contributor

amacneil commented Jul 9, 2013

I see the use case, but I don't particularly like this API, passing extra parameters to send() like that. Open to discussion though.

I think I'd prefer some sort of sendData() method, which was called internally by send(), e.g.:

function send()
{
    $data = $this->getData();
    return $this->sendData($data);
}

function sendData($data)
{
    // gateway implements this method
}

This was referenced Jul 9, 2013
@antranapp
Copy link

Any suggestion for passing custom parameters to the gateway. I also want to use mobile express checkout for paypal and need to pass a parameter to ExpressAuthorizeResponse to be able to choose the correct command "_express-checkout-mobile" for the redirection.

@amacneil
Copy link
Contributor

Fixed in #162

@amacneil amacneil closed this Nov 10, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants