@@ -107,6 +107,74 @@ public function setSecretKey($value)
107
107
return $ this ->setParameter ('secretKey ' , $ value );
108
108
}
109
109
110
+ /**
111
+ * Get the return method.
112
+ *
113
+ * @return string return method
114
+ */
115
+ public function getReturnMethod ()
116
+ {
117
+ return $ this ->formatMethod ($ this ->getParameter ('returnMethod ' ));
118
+ }
119
+
120
+ /**
121
+ * Set the return method.
122
+ *
123
+ * @param string $value return method
124
+ *
125
+ * @return self
126
+ */
127
+ public function setReturnMethod ($ value )
128
+ {
129
+ return $ this ->setParameter ('returnMethod ' , $ value );
130
+ }
131
+
132
+ /**
133
+ * Get the cancel method.
134
+ *
135
+ * @return string cancel method
136
+ */
137
+ public function getCancelMethod ()
138
+ {
139
+ return $ this ->formatMethod ($ this ->getParameter ('cancelMethod ' ));
140
+ }
141
+
142
+ /**
143
+ * Set the cancel method.
144
+ *
145
+ * @param string $value cancel method
146
+ *
147
+ * @return self
148
+ */
149
+ public function setCancelMethod ($ value )
150
+ {
151
+ return $ this ->setParameter ('cancelMethod ' , $ value );
152
+ }
153
+
154
+ /**
155
+ * Redirect method conversion table.
156
+ */
157
+ private static $ _methods = [
158
+ '1 ' => '1 ' ,
159
+ '2 ' => '2 ' ,
160
+ 'GET ' => '0 ' ,
161
+ 'POST ' => '1 ' ,
162
+ 'LINK ' => '2 ' ,
163
+ ];
164
+
165
+ /**
166
+ * Converts redirect method to WebMoney code: 0, 1 or 2.
167
+ *
168
+ * @param string $method
169
+ *
170
+ * @return string
171
+ */
172
+ public function formatMethod ($ method )
173
+ {
174
+ $ method = strtoupper ((string )$ method );
175
+ return isset (self ::$ _methods [$ method ]) ? self ::$ _methods [$ method ] : '0 ' ;
176
+ }
177
+
110
178
/**
111
179
* Get the SSL file.
112
180
*
0 commit comments