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()
1515 {
1616 $ data = array ();
1717 $ 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+ }
1923
2024 return $ data ;
2125 }
@@ -28,7 +32,7 @@ public function getData()
2832 */
2933 public function sendData ($ data )
3034 {
31- $ response = $ this ->braintree ->paymentMethod ()->update ($ data ['token ' ], $ data ['parameters ' ]);
35+ $ response = $ this ->braintree ->paymentMethod ()->update ($ data ['token ' ], $ data ['options ' ]);
3236
3337 return $ this ->createResponse ($ response );
3438 }
Original file line number Diff line number Diff line change @@ -20,16 +20,16 @@ public function testGetData()
2020 {
2121 $ this ->request ->initialize (
2222 array (
23- 'token ' => 'abcd1234 ' ,
24- 'makeDefault ' => true ,
23+ 'paymentMethodToken ' => 'abcd1234 ' ,
24+ 'options ' => array (
25+ 'makeDefault ' => true ,
26+ )
2527 )
2628 );
2729 $ expected = array (
2830 'token ' => 'abcd1234 ' ,
29- 'parameters ' => array (
30- 'options ' => array (
31- 'makeDefault ' => true ,
32- ),
31+ 'options ' => array (
32+ 'makeDefault ' => true ,
3333 ),
3434 );
3535 $ this ->assertSame ($ expected , $ this ->request ->getData ());
@@ -39,7 +39,7 @@ public function testGetDataNoParameters()
3939 {
4040 $ this ->request ->initialize (
4141 array (
42- 'token ' => 'abcd1234 ' ,
42+ 'paymentMethodToken ' => 'abcd1234 ' ,
4343 )
4444 );
4545 $ expected = array (
You can’t perform that action at this time.
0 commit comments