File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed
app/code/Magento/Braintree
Test/Unit/Gateway/Response Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -41,24 +41,32 @@ class VaultDetailsHandler implements HandlerInterface
41
41
*/
42
42
protected $ config ;
43
43
44
+ /**
45
+ * @var \Magento\Framework\Serialize\SerializerInterface
46
+ */
47
+ private $ serializer ;
48
+
44
49
/**
45
50
* Constructor
46
51
*
47
52
* @param PaymentTokenInterfaceFactory $paymentTokenFactory
48
53
* @param OrderPaymentExtensionInterfaceFactory $paymentExtensionFactory
49
54
* @param Config $config
50
55
* @param SubjectReader $subjectReader
56
+ * @param \Magento\Framework\Serialize\SerializerInterface $serializer
51
57
*/
52
58
public function __construct (
53
59
PaymentTokenInterfaceFactory $ paymentTokenFactory ,
54
60
OrderPaymentExtensionInterfaceFactory $ paymentExtensionFactory ,
55
61
Config $ config ,
56
- SubjectReader $ subjectReader
62
+ SubjectReader $ subjectReader ,
63
+ \Magento \Framework \Serialize \SerializerInterface $ serializer
57
64
) {
58
65
$ this ->paymentTokenFactory = $ paymentTokenFactory ;
59
66
$ this ->paymentExtensionFactory = $ paymentExtensionFactory ;
60
67
$ this ->config = $ config ;
61
68
$ this ->subjectReader = $ subjectReader ;
69
+ $ this ->serializer = $ serializer ;
62
70
}
63
71
64
72
/**
@@ -133,7 +141,7 @@ private function getExpirationDate(Transaction $transaction)
133
141
*/
134
142
private function convertDetailsToJSON ($ details )
135
143
{
136
- $ json = \Zend_Json:: encode ($ details );
144
+ $ json = $ this -> serializer -> serialize ($ details );
137
145
return $ json ? $ json : '{} ' ;
138
146
}
139
147
Original file line number Diff line number Diff line change @@ -122,11 +122,20 @@ protected function setUp()
122
122
->method ('getCctypesMapper ' )
123
123
->willReturn ($ mapperArray );
124
124
125
+ $ this ->serializer = $ this ->getMock (
126
+ \Magento \Framework \Serialize \SerializerInterface::class,
127
+ [],
128
+ [],
129
+ '' ,
130
+ false
131
+ );
132
+
125
133
$ this ->paymentHandler = new VaultDetailsHandler (
126
134
$ this ->paymentTokenFactory ,
127
135
$ this ->paymentExtensionFactory ,
128
136
$ this ->config ,
129
- $ this ->subjectReader
137
+ $ this ->subjectReader ,
138
+ $ this ->serializer
130
139
);
131
140
}
132
141
You can’t perform that action at this time.
0 commit comments