File tree Expand file tree Collapse file tree 4 files changed +73
-0
lines changed
tests/Omnipay/PayPal/Message Expand file tree Collapse file tree 4 files changed +73
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ public function getDefaultParameters()
30
30
$ settings = parent ::getDefaultParameters ();
31
31
$ settings ['solutionType ' ] = array ('Sole ' , 'Mark ' );
32
32
$ settings ['landingPage ' ] = array ('Billing ' , 'Login ' );
33
+ $ settings ['headerImageUrl ' ] = '' ;
33
34
34
35
return $ settings ;
35
36
}
@@ -54,6 +55,25 @@ public function setLandingPage($value)
54
55
return $ this ->setParameter ('landingPage ' , $ value );
55
56
}
56
57
58
+ public function getHeaderImageUrl ()
59
+ {
60
+ return $ this ->getParameter ('headerImageUrl ' );
61
+ }
62
+
63
+ /**
64
+ * Header Image URL (Optional)
65
+ *
66
+ * URL for the image you want to appear at the top left of the payment page.
67
+ * The image has a maximum size of 750 pixels wide by 90 pixels high.
68
+ * PayPal recommends that you provide an image that is stored on a secure (https) server.
69
+ * If you do not specify an image, the business name displays.
70
+ * Character length and limitations: 127 single-byte alphanumeric characters
71
+ */
72
+ public function setHeaderImageUrl ($ value )
73
+ {
74
+ return $ this ->setParameter ('headerImageUrl ' , $ value );
75
+ }
76
+
57
77
public function authorize (array $ parameters = array ())
58
78
{
59
79
return $ this ->createRequest ('\Omnipay\PayPal\Message\ExpressAuthorizeRequest ' , $ parameters );
Original file line number Diff line number Diff line change @@ -69,6 +69,16 @@ public function setLandingPage($value)
69
69
return $ this ->setParameter ('landingPage ' , $ value );
70
70
}
71
71
72
+ public function getHeaderImageUrl ()
73
+ {
74
+ return $ this ->getParameter ('headerImageUrl ' );
75
+ }
76
+
77
+ public function setHeaderImageUrl ($ value )
78
+ {
79
+ return $ this ->setParameter ('headerImageUrl ' , $ value );
80
+ }
81
+
72
82
protected function getBaseData ($ method )
73
83
{
74
84
$ data = array ();
Original file line number Diff line number Diff line change @@ -36,6 +36,10 @@ public function getData()
36
36
$ data ['RETURNURL ' ] = $ this ->getReturnUrl ();
37
37
$ data ['CANCELURL ' ] = $ this ->getCancelUrl ();
38
38
39
+ if ($ headerImageUrl = $ this ->getHeaderImageUrl ()) {
40
+ $ data ['HDRIMG ' ] = $ headerImageUrl ;
41
+ }
42
+
39
43
if ($ card = $ this ->getCard ()) {
40
44
$ data ['PAYMENTREQUEST_0_SHIPTONAME ' ] = $ card ->getName ();
41
45
$ data ['PAYMENTREQUEST_0_SHIPTOSTREET ' ] = $ card ->getAddress1 ();
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Omnipay package.
5
+ *
6
+ * (c) Adrian Macneil <adrian@adrianmacneil.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ namespace Omnipay \PayPal \Message ;
13
+
14
+ use Omnipay \TestCase ;
15
+
16
+ class ExpressAuthorizeRequestTest extends TestCase
17
+ {
18
+ public function setUp ()
19
+ {
20
+ parent ::setUp ();
21
+
22
+ $ this ->request = new ExpressAuthorizeRequest ($ this ->getHttpClient (), $ this ->getHttpRequest ());
23
+ $ this ->request ->initialize (
24
+ array (
25
+ 'amount ' => 1000 ,
26
+ 'returnUrl ' => 'https://www.example.com/return ' ,
27
+ 'cancelUrl ' => 'https://www.example.com/cancel ' ,
28
+ )
29
+ );
30
+ }
31
+
32
+ public function testHeaderImageUrl ()
33
+ {
34
+ $ this ->request ->setHeaderImageUrl ('https://www.example.com/image.jpg ' );
35
+
36
+ $ data = $ this ->request ->getData ();
37
+ $ this ->assertEquals ('https://www.example.com/image.jpg ' , $ data ['HDRIMG ' ]);
38
+ }
39
+ }
You can’t perform that action at this time.
0 commit comments