Skip to content

Commit 2df6499

Browse files
committed
Add issuer and paymentMethod fields to AbstractRequest
1 parent 0b6d15a commit 2df6499

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

src/Omnipay/Common/Message/AbstractRequest.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,38 @@ public function setNotifyUrl($value)
321321
return $this->setParameter('notifyUrl', $value);
322322
}
323323

324+
public function getIssuer()
325+
{
326+
return $this->getParameter('issuer');
327+
}
328+
329+
/**
330+
* Set the payment issuer.
331+
*
332+
* This field is used by some European gateways, and normally represents
333+
* the bank where an account is held (separate from the card brand).
334+
*/
335+
public function setIssuer($value)
336+
{
337+
return $this->setParameter('issuer', $value);
338+
}
339+
340+
public function getPaymentMethod()
341+
{
342+
return $this->getParameter('paymentMethod');
343+
}
344+
345+
/**
346+
* Set the payment method.
347+
*
348+
* This field is used by some European gateways, which support
349+
* multiple payment providers with a single API.
350+
*/
351+
public function setPaymentMethod($value)
352+
{
353+
return $this->setParameter('paymentMethod', $value);
354+
}
355+
324356
public function send()
325357
{
326358
$data = $this->getData();

tests/Omnipay/Common/Message/AbstractRequestTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,18 @@ public function testNotifyUrl()
217217
$this->assertSame('https://www.example.com/notify', $this->request->getNotifyUrl());
218218
}
219219

220+
public function testIssuer()
221+
{
222+
$this->assertSame($this->request, $this->request->setIssuer('some-bank'));
223+
$this->assertSame('some-bank', $this->request->getIssuer());
224+
}
225+
226+
public function testPaymentMethod()
227+
{
228+
$this->assertSame($this->request, $this->request->setPaymentMethod('ideal'));
229+
$this->assertSame('ideal', $this->request->getPaymentMethod());
230+
}
231+
220232
public function testInitializedParametersAreSet()
221233
{
222234
$params = array('testMode' => 'success');

0 commit comments

Comments
 (0)