Skip to content

Commit b500e0b

Browse files
eileenmcnaughtonbarryvdh
authored andcommitted
Add support for referrer code to Rest Gateway (thephpleague#226)
Referrer code is otherwise called BNCode or partner attribution id in paypal-land. I chose referrer code as something generic https://developer.paypal.com/docs/integration/direct/payments/#
1 parent 2028cc6 commit b500e0b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/Message/AbstractRestRequest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,24 @@ abstract class AbstractRestRequest extends \Omnipay\Common\Message\AbstractReque
6262
*/
6363
protected $payerId = null;
6464

65+
protected $referrerCode;
66+
67+
/**
68+
* @return string
69+
*/
70+
public function getReferrerCode()
71+
{
72+
return $this->referrerCode;
73+
}
74+
75+
/**
76+
* @param string $referrerCode
77+
*/
78+
public function setReferrerCode($referrerCode)
79+
{
80+
$this->referrerCode = $referrerCode;
81+
}
82+
6583
public function getClientId()
6684
{
6785
return $this->getParameter('clientId');
@@ -146,6 +164,7 @@ public function sendData($data)
146164
'Accept' => 'application/json',
147165
'Authorization' => 'Bearer ' . $this->getToken(),
148166
'Content-type' => 'application/json',
167+
'PayPal-Partner-Attribution-Id' => $this->getReferrerCode(),
149168
),
150169
$body
151170
);

0 commit comments

Comments
 (0)