thephpleague / omnipay

A framework agnostic, multi-gateway payment processing library for PHP 5.6+
http://omnipay.thephpleague.com/
MIT License
5.94k stars 927 forks source link

WorldPay extra parameters #64

Closed philipbrown closed 11 years ago

philipbrown commented 11 years ago

How would I inject extra parameters into the defaults?

For example, I need to be able to send MC_Order, or MC_Customer etc.

Is that possible? Is there a way to dynamically set defaults and then use them in request?

Thank you,

philipbrown commented 11 years ago
$response = $gateway->purchase(array(
  "amount"=>"300",
  "returnUrl" => "url",
  "MC" => array(
    "MC_Order" => 1,
    "MC_Customer" => 2
  )
));

And then in PurchaseRequest

    public function setMC($param){
        foreach($param as $key => $value){
            $this->setParameter($key, $value);
        }
    }

I can clean this up, write the tests and submit a PR if you are happy with this approach?

amacneil commented 11 years ago

Let's figure this out for all gateways in #82