File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,11 @@ public function getData()
15
15
{
16
16
$ data = array ();
17
17
$ data ['token ' ] = $ this ->getToken ();
18
- $ data ['parameters ' ] = $ this ->parameters ->get ('paymentMethodOptions ' );
18
+ $ options = $ this ->parameters ->get ('paymentMethodOptions ' );
19
+
20
+ if (null !== $ options ) {
21
+ $ data ['options ' ] = $ options ;
22
+ }
19
23
20
24
return $ data ;
21
25
}
@@ -28,7 +32,7 @@ public function getData()
28
32
*/
29
33
public function sendData ($ data )
30
34
{
31
- $ response = $ this ->braintree ->paymentMethod ()->update ($ data ['token ' ], $ data ['parameters ' ]);
35
+ $ response = $ this ->braintree ->paymentMethod ()->update ($ data ['token ' ], $ data ['options ' ]);
32
36
33
37
return $ this ->createResponse ($ response );
34
38
}
Original file line number Diff line number Diff line change @@ -20,16 +20,16 @@ public function testGetData()
20
20
{
21
21
$ this ->request ->initialize (
22
22
array (
23
- 'token ' => 'abcd1234 ' ,
24
- 'makeDefault ' => true ,
23
+ 'paymentMethodToken ' => 'abcd1234 ' ,
24
+ 'options ' => array (
25
+ 'makeDefault ' => true ,
26
+ )
25
27
)
26
28
);
27
29
$ expected = array (
28
30
'token ' => 'abcd1234 ' ,
29
- 'parameters ' => array (
30
- 'options ' => array (
31
- 'makeDefault ' => true ,
32
- ),
31
+ 'options ' => array (
32
+ 'makeDefault ' => true ,
33
33
),
34
34
);
35
35
$ this ->assertSame ($ expected , $ this ->request ->getData ());
@@ -39,7 +39,7 @@ public function testGetDataNoParameters()
39
39
{
40
40
$ this ->request ->initialize (
41
41
array (
42
- 'token ' => 'abcd1234 ' ,
42
+ 'paymentMethodToken ' => 'abcd1234 ' ,
43
43
)
44
44
);
45
45
$ expected = array (
You can’t perform that action at this time.
0 commit comments