@@ -44,7 +44,7 @@ public function isValidAuth($merchant = '')
44
44
$ this ->initCurl (
45
45
$ this ->_endpoint .
46
46
'/merchants ' .
47
- ($ merchant ?'/ ' .$ merchant :'' ) .
47
+ urlencode ($ merchant ?'/ ' .$ merchant :'' ).
48
48
'/credentials '
49
49
);
50
50
curl_setopt ($ this ->ch , CURLOPT_CUSTOMREQUEST , 'GET ' );
@@ -153,9 +153,14 @@ public function getPaymentMethods($uri, $options = array())
153
153
curl_close ($ this ->ch );
154
154
}
155
155
156
- public function getCreditAgreements ($ amount , $ merchant )
156
+ public function getCreditAgreements ($ amount , $ merchant, $ locale = ' es-ES ' , $ country = ' ES ' , $ currency = ' EUR ' )
157
157
{
158
- $ uri = $ this ->_endpoint . '/merchants/ ' . $ merchant . '/credit_agreements?total_with_tax= ' . $ amount . '¤cy=EUR&locale=es-ES&country=ES ' ;
158
+ $ uri = $ this ->_endpoint .
159
+ '/merchants/ ' . urlencode ($ merchant ) .
160
+ '/credit_agreements?total_with_tax= ' . urlencode ($ amount ) .
161
+ '¤cy= ' . urlencode ($ currency ) .
162
+ '&locale= ' . urlencode ($ locale ) .
163
+ '&country= ' . urlencode ($ country );
159
164
$ this ->initCurl ($ uri );
160
165
curl_setopt ($ this ->ch , CURLOPT_CUSTOMREQUEST , 'GET ' );
161
166
$ this ->sendRequest ();
@@ -188,8 +193,8 @@ public function sendDeliveryReport($delivery_report)
188
193
public function orderUpdate ($ order )
189
194
{
190
195
$ uri = $ this ->_endpoint .
191
- '/merchants/ ' . $ order ['merchant ' ]['id ' ] .
192
- '/orders/ ' . $ order ['merchant_reference ' ]['order_ref_1 ' ];
196
+ '/merchants/ ' . urlencode ( $ order ['merchant ' ]['id ' ]) .
197
+ '/orders/ ' . urlencode ( $ order ['merchant_reference ' ]['order_ref_1 ' ]) ;
193
198
$ this ->initCurl ($ uri );
194
199
$ this ->verbThePayload ('PUT ' , array ('order ' => $ order ));
195
200
$ this ->dealWithResponse ();
0 commit comments