Skip to content

Commit 4909f03

Browse files
author
Vladislav Veselinov
committed
added "SUBJECT" to paypal request (allows executing api calls on behalf of a third-party)
added test for new value
1 parent 4928c24 commit 4909f03

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/Omnipay/PayPal/Message/AbstractRequest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ public function setSignature($value)
4949
return $this->setParameter('signature', $value);
5050
}
5151

52+
public function getSubject()
53+
{
54+
return $this->getParameter('subject');
55+
}
56+
57+
public function setSubject($value)
58+
{
59+
return $this->setParameter('subject', $value);
60+
}
61+
5262
public function getSolutionType()
5363
{
5464
return $this->getParameter('solutionType');
@@ -87,6 +97,7 @@ protected function getBaseData($method)
8797
$data['USER'] = $this->getUsername();
8898
$data['PWD'] = $this->getPassword();
8999
$data['SIGNATURE'] = $this->getSignature();
100+
$data['SUBJECT'] = $this->getSubject();
90101

91102
return $data;
92103
}

tests/Omnipay/PayPal/Message/ExpressAuthorizeRequestTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public function testGetData()
3939
'returnUrl' => 'https://www.example.com/return',
4040
'cancelUrl' => 'https://www.example.com/cancel',
4141
'notifyUrl' => 'https://www.example.com/notify',
42+
'subject' => '[email protected]',
4243
'headerImageUrl' => 'https://www.example.com/header.jpg',
4344
));
4445

@@ -51,6 +52,7 @@ public function testGetData()
5152
$this->assertSame('https://www.example.com/return', $data['RETURNURL']);
5253
$this->assertSame('https://www.example.com/cancel', $data['CANCELURL']);
5354
$this->assertSame('https://www.example.com/notify', $data['PAYMENTREQUEST_0_NOTIFYURL']);
55+
$this->assertSame('[email protected]', $data['SUBJECT']);
5456
$this->assertSame('https://www.example.com/header.jpg', $data['HDRIMG']);
5557
}
5658

0 commit comments

Comments
 (0)