@@ -88,8 +88,8 @@ discard block |
||
| 88 | 88 | $pagantisPublicKey = Configuration::get('pagantis_public_key'); |
| 89 | 89 | $pagantisPrivateKey = Configuration::get('pagantis_private_key'); |
| 90 | 90 | $okUrl = _PS_BASE_URL_SSL_.__PS_BASE_URI__ |
| 91 | - .'index.php?canonical=true&fc=module&module=pagantis&controller=notify&' |
|
| 92 | - .http_build_query($query) |
|
| 91 | + .'index.php?canonical=true&fc=module&module=pagantis&controller=notify&' |
|
| 92 | + .http_build_query($query) |
|
| 93 | 93 | ; |
| 94 | 94 | |
| 95 | 95 | $shippingAddress = new Address($cart->id_address_delivery); |
@@ -192,9 +192,9 @@ discard block |
||
| 192 | 192 | $productId = $item['id_product']; |
| 193 | 193 | $finalPrice = Product::getPriceStatic($productId); |
| 194 | 194 | $promotedMessage = 'Promoted Item: ' . $product->getDescription() . |
| 195 | - ' Price: ' . $finalPrice . |
|
| 196 | - ' Qty: ' . $product->getQuantity() . |
|
| 197 | - ' Item ID: ' . $item['id_product']; |
|
| 195 | + ' Price: ' . $finalPrice . |
|
| 196 | + ' Qty: ' . $product->getQuantity() . |
|
| 197 | + ' Item ID: ' . $item['id_product']; |
|
| 198 | 198 | $metadataOrder->addMetadata('promotedProduct', $promotedMessage); |
| 199 | 199 | } |
| 200 | 200 | $details->addProduct($product); |
@@ -64,30 +64,30 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | function testInit() |
| 66 | 66 | { |
| 67 | - $r = Request::init(); |
|
| 68 | - // Did we get a 'Request' object? |
|
| 69 | - $this->assertEquals('Httpful\Request', get_class($r)); |
|
| 67 | + $r = Request::init(); |
|
| 68 | + // Did we get a 'Request' object? |
|
| 69 | + $this->assertEquals('Httpful\Request', get_class($r)); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | function testDetermineLength() |
| 73 | 73 | { |
| 74 | - $r = Request::init(); |
|
| 75 | - $this->assertEquals(1, $r->_determineLength('A')); |
|
| 76 | - $this->assertEquals(2, $r->_determineLength('À')); |
|
| 77 | - $this->assertEquals(2, $r->_determineLength('Ab')); |
|
| 78 | - $this->assertEquals(3, $r->_determineLength('Àb')); |
|
| 79 | - $this->assertEquals(6, $r->_determineLength('世界')); |
|
| 74 | + $r = Request::init(); |
|
| 75 | + $this->assertEquals(1, $r->_determineLength('A')); |
|
| 76 | + $this->assertEquals(2, $r->_determineLength('À')); |
|
| 77 | + $this->assertEquals(2, $r->_determineLength('Ab')); |
|
| 78 | + $this->assertEquals(3, $r->_determineLength('Àb')); |
|
| 79 | + $this->assertEquals(6, $r->_determineLength('世界')); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | function testMethods() |
| 83 | 83 | { |
| 84 | - $valid_methods = array('get', 'post', 'delete', 'put', 'options', 'head'); |
|
| 85 | - $url = 'http://example.com/'; |
|
| 86 | - foreach ($valid_methods as $method) { |
|
| 84 | + $valid_methods = array('get', 'post', 'delete', 'put', 'options', 'head'); |
|
| 85 | + $url = 'http://example.com/'; |
|
| 86 | + foreach ($valid_methods as $method) { |
|
| 87 | 87 | $r = call_user_func(array('Httpful\Request', $method), $url); |
| 88 | 88 | $this->assertEquals('Httpful\Request', get_class($r)); |
| 89 | 89 | $this->assertEquals(strtoupper($method), $r->method); |
| 90 | - } |
|
| 90 | + } |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | function testDefaults() |
@@ -124,12 +124,12 @@ discard block |
||
| 124 | 124 | function testSettingStrictSsl() |
| 125 | 125 | { |
| 126 | 126 | $r = Request::init() |
| 127 | - ->withStrictSsl(); |
|
| 127 | + ->withStrictSsl(); |
|
| 128 | 128 | |
| 129 | 129 | $this->assertTrue($r->strict_ssl); |
| 130 | 130 | |
| 131 | 131 | $r = Request::init() |
| 132 | - ->withoutStrictSsl(); |
|
| 132 | + ->withoutStrictSsl(); |
|
| 133 | 133 | |
| 134 | 134 | $this->assertFalse($r->strict_ssl); |
| 135 | 135 | } |
@@ -11,17 +11,17 @@ discard block |
||
| 11 | 11 | { |
| 12 | 12 | |
| 13 | 13 | public $body, |
| 14 | - $raw_body, |
|
| 15 | - $headers, |
|
| 16 | - $raw_headers, |
|
| 17 | - $request, |
|
| 18 | - $code = 0, |
|
| 19 | - $content_type, |
|
| 20 | - $parent_type, |
|
| 21 | - $charset, |
|
| 22 | - $meta_data, |
|
| 23 | - $is_mime_vendor_specific = false, |
|
| 24 | - $is_mime_personal = false; |
|
| 14 | + $raw_body, |
|
| 15 | + $headers, |
|
| 16 | + $raw_headers, |
|
| 17 | + $request, |
|
| 18 | + $code = 0, |
|
| 19 | + $content_type, |
|
| 20 | + $parent_type, |
|
| 21 | + $charset, |
|
| 22 | + $meta_data, |
|
| 23 | + $is_mime_vendor_specific = false, |
|
| 24 | + $is_mime_personal = false; |
|
| 25 | 25 | |
| 26 | 26 | private $parsers; |
| 27 | 27 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | : $this->parent_type; |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - return Httpful::get($parse_with)->parse($body); |
|
| 107 | + return Httpful::get($parse_with)->parse($body); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
@@ -29,25 +29,25 @@ discard block |
||
| 29 | 29 | const MAX_REDIRECTS_DEFAULT = 25; |
| 30 | 30 | |
| 31 | 31 | public $uri, |
| 32 | - $method = Http::GET, |
|
| 33 | - $headers = array(), |
|
| 34 | - $raw_headers = '', |
|
| 35 | - $strict_ssl = false, |
|
| 36 | - $content_type, |
|
| 37 | - $expected_type, |
|
| 38 | - $additional_curl_opts = array(), |
|
| 39 | - $auto_parse = true, |
|
| 40 | - $serialize_payload_method = self::SERIALIZE_PAYLOAD_SMART, |
|
| 41 | - $username, |
|
| 42 | - $password, |
|
| 43 | - $serialized_payload, |
|
| 44 | - $payload, |
|
| 45 | - $parse_callback, |
|
| 46 | - $error_callback, |
|
| 47 | - $send_callback, |
|
| 48 | - $follow_redirects = false, |
|
| 49 | - $max_redirects = self::MAX_REDIRECTS_DEFAULT, |
|
| 50 | - $payload_serializers = array(); |
|
| 32 | + $method = Http::GET, |
|
| 33 | + $headers = array(), |
|
| 34 | + $raw_headers = '', |
|
| 35 | + $strict_ssl = false, |
|
| 36 | + $content_type, |
|
| 37 | + $expected_type, |
|
| 38 | + $additional_curl_opts = array(), |
|
| 39 | + $auto_parse = true, |
|
| 40 | + $serialize_payload_method = self::SERIALIZE_PAYLOAD_SMART, |
|
| 41 | + $username, |
|
| 42 | + $password, |
|
| 43 | + $serialized_payload, |
|
| 44 | + $payload, |
|
| 45 | + $parse_callback, |
|
| 46 | + $error_callback, |
|
| 47 | + $send_callback, |
|
| 48 | + $follow_redirects = false, |
|
| 49 | + $max_redirects = self::MAX_REDIRECTS_DEFAULT, |
|
| 50 | + $payload_serializers = array(); |
|
| 51 | 51 | |
| 52 | 52 | // Options |
| 53 | 53 | // private $_options = array( |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | // Curl Handle |
| 59 | 59 | public $_ch, |
| 60 | - $_debug; |
|
| 60 | + $_debug; |
|
| 61 | 61 | |
| 62 | 62 | // Template Request object |
| 63 | 63 | private static $_template; |
@@ -390,9 +390,9 @@ discard block |
||
| 390 | 390 | $this->payload[$key] = curl_file_create($file, $mimeType); |
| 391 | 391 | } else { |
| 392 | 392 | $this->payload[$key] = '@' . $file; |
| 393 | - if ($mimeType) { |
|
| 394 | - $this->payload[$key] .= ';type=' . $mimeType; |
|
| 395 | - } |
|
| 393 | + if ($mimeType) { |
|
| 394 | + $this->payload[$key] .= ';type=' . $mimeType; |
|
| 395 | + } |
|
| 396 | 396 | } |
| 397 | 397 | } |
| 398 | 398 | $this->sendsType(Mime::UPLOAD); |
@@ -813,10 +813,10 @@ discard block |
||
| 813 | 813 | |
| 814 | 814 | $request = new Request(); |
| 815 | 815 | return $request |
| 816 | - ->_setDefaults() |
|
| 817 | - ->method($method) |
|
| 818 | - ->sendsType($mime) |
|
| 819 | - ->expectsType($mime); |
|
| 816 | + ->_setDefaults() |
|
| 817 | + ->method($method) |
|
| 818 | + ->sendsType($mime) |
|
| 819 | + ->expectsType($mime); |
|
| 820 | 820 | } |
| 821 | 821 | |
| 822 | 822 | /** |
@@ -90,7 +90,7 @@ |
||
| 90 | 90 | $this->assertEquals($jsonExceptionResponse->getResult(), MerchantOrderNotFoundException::ERROR_MESSAGE); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - /** |
|
| 93 | + /** |
|
| 94 | 94 | * testSetExceptionWithMerchantConfigurationNotFoundException |
| 95 | 95 | */ |
| 96 | 96 | public function testSetExceptionWithMerchantConfigurationNotFoundException() |
@@ -47,7 +47,6 @@ |
||
| 47 | 47 | * @param $assistedSale |
| 48 | 48 | * |
| 49 | 49 | * @return $this |
| 50 | - |
|
| 51 | 50 | */ |
| 52 | 51 | public function setAssistedSale($assistedSale) |
| 53 | 52 | { |
@@ -70,8 +70,8 @@ |
||
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | - * testSetOk |
|
| 74 | - */ |
|
| 73 | + * testSetOk |
|
| 74 | + */ |
|
| 75 | 75 | public function testSetAuthorizedNotificationCallback() |
| 76 | 76 | { |
| 77 | 77 | $urls = new Urls(); |
@@ -88,8 +88,8 @@ discard block |
||
| 88 | 88 | $pagantisPublicKey = Configuration::get('pagantis_public_key'); |
| 89 | 89 | $pagantisPrivateKey = Configuration::get('pagantis_private_key'); |
| 90 | 90 | $okUrl = _PS_BASE_URL_SSL_.__PS_BASE_URI__ |
| 91 | - .'index.php?canonical=true&fc=module&module=pagantis&controller=notify&' |
|
| 92 | - .http_build_query($query) |
|
| 91 | + .'index.php?canonical=true&fc=module&module=pagantis&controller=notify&' |
|
| 92 | + .http_build_query($query) |
|
| 93 | 93 | ; |
| 94 | 94 | |
| 95 | 95 | $shippingAddress = new Address($cart->id_address_delivery); |
@@ -192,9 +192,9 @@ discard block |
||
| 192 | 192 | $productId = $item['id_product']; |
| 193 | 193 | $finalPrice = Product::getPriceStatic($productId); |
| 194 | 194 | $promotedMessage = 'Promoted Item: ' . $product->getDescription() . |
| 195 | - ' Price: ' . $finalPrice . |
|
| 196 | - ' Qty: ' . $product->getQuantity() . |
|
| 197 | - ' Item ID: ' . $item['id_product']; |
|
| 195 | + ' Price: ' . $finalPrice . |
|
| 196 | + ' Qty: ' . $product->getQuantity() . |
|
| 197 | + ' Item ID: ' . $item['id_product']; |
|
| 198 | 198 | $metadataOrder->addMetadata('promotedProduct', $promotedMessage); |
| 199 | 199 | } |
| 200 | 200 | $details->addProduct($product); |