Post by pm-netti » Tue Sep 10, 2019 11:59 pm

Hi

Has anyone got to work on "custom headers" in Guzzlehttp ( system/storage/vendor/guzzlehttp/ )?
Last edited by pm-netti on Mon Sep 30, 2019 1:49 am, edited 1 time in total.

Image
- - - OpenCart Upgrade Service - - -


User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä-Finland

Post by pm-netti » Wed Sep 11, 2019 1:07 am

pm-netti wrote:
Tue Sep 10, 2019 11:59 pm
Hi

Has anyone got to work on "custom headers" in Guzzlehttp ( system/storage/vendor/guzzlehttp/ )?
Ps. Bin-test https://postb.in/

Code: Select all

$headers = array(
                         'checkout-account' => $checkout_merchant,
		         'checkout-algorithm' => 'sha256',
		         'checkout-method' => 'POST',
		         'checkout-nonce' => '564635208570151',
		         'checkout-timestamp' => date('Y-m-d\TH:i:s.Z\Z', time()),
                         'content-type' => 'application/json; charset=utf-8',
		         'checkout-transaction-id' => $this->session->data['order_id']
   );

            $client = new \GuzzleHttp\Client(array('headers' => $headers));
            $response = $client->post('https://postb.in/1568135374147-4690802653785',array());
            
Output:

Code: Select all

Headers
x-real-ip: 192.130.146.163
host: postb.in
connection: close
content-length: 0
user-agent: Guzzle/5.3.1 curl/7.65.3 PHP/5.6.40

Image
- - - OpenCart Upgrade Service - - -


User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä-Finland

Post by paulfeakins » Wed Sep 11, 2019 5:40 pm

Question not clear ...

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by pm-netti » Wed Sep 11, 2019 9:33 pm

One shortcoming of Opencart: It use Guzzlehttp version 5.3.1. I recommed use Guzzlehttp 6.3.3.
Other shortcomig: Not all files in the guzzlehttp library are included in the Opencart vendor. You still need to install guzzlehttp library with Composer.

Problem: Many use a windows computer. In it, installing the Guzzlehttp library using Composer is almost impossible.

Image
- - - OpenCart Upgrade Service - - -


User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä-Finland

Post by paulfeakins » Wed Sep 11, 2019 10:16 pm

pm-netti wrote:
Wed Sep 11, 2019 9:33 pm
Problem: Many use a windows computer.
Solution: Develop on a Linux server.

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by pm-netti » Wed Sep 11, 2019 10:22 pm

paulfeakins wrote:
Wed Sep 11, 2019 10:16 pm
pm-netti wrote:
Wed Sep 11, 2019 9:33 pm
Problem: Many use a windows computer.
Solution: Develop on a Linux server.
It is possible, if install Ubuntu. But current Opencart folder system/storage/vendor/guzzlehttp is useless.
Last edited by pm-netti on Wed Sep 11, 2019 10:36 pm, edited 2 times in total.

Image
- - - OpenCart Upgrade Service - - -


User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä-Finland

Post by paulfeakins » Wed Sep 11, 2019 10:25 pm

pm-netti wrote:
Wed Sep 11, 2019 10:22 pm
It is possible, if install Ubuntu.
You could use VirtualBox.

pm-netti wrote:
Wed Sep 11, 2019 10:22 pm
But current Openacrt folder system/vendor/guzzlehttp is useless.
Why not use the version from here?
https://www.opencart.com/index.php?route=cms/download

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by pm-netti » Wed Sep 11, 2019 10:35 pm

paulfeakins wrote:
Wed Sep 11, 2019 10:25 pm
Why not use the version from here?
https://www.opencart.com/index.php?route=cms/download
Is need you A2 Hosting? What there?

Image
- - - OpenCart Upgrade Service - - -


User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä-Finland

Post by paulfeakins » Wed Sep 11, 2019 10:54 pm

pm-netti wrote:
Wed Sep 11, 2019 10:35 pm
Is need you A2 Hosting? What there?
Image

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by paulfeakins » Wed Sep 11, 2019 10:55 pm

That's the standard OpenCart download link.

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by pm-netti » Wed Sep 11, 2019 11:05 pm

paulfeakins wrote:
Wed Sep 11, 2019 10:55 pm
That's the standard OpenCart download link.
I have all Opencart zip-packages between 1.4.7 - 3.0.3.2 and development version 3.1

Image
- - - OpenCart Upgrade Service - - -


User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä-Finland

Post by paulfeakins » Wed Sep 11, 2019 11:11 pm

So it's still not clear exactly why you are trying to modify headers?

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by pm-netti » Wed Sep 11, 2019 11:18 pm

paulfeakins wrote:
Wed Sep 11, 2019 11:11 pm
So it's still not clear exactly why you are trying to modify headers?
Current Opencart Guzzlehttp 5.3.1 is not work. You can see in up from postb.in, it create own "sweeping" header. Guzzle remove required headers from array $headers. Many currents extensions required Guzzlehttp 6.

Image
- - - OpenCart Upgrade Service - - -


User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä-Finland

Post by paulfeakins » Wed Sep 11, 2019 11:36 pm

pm-netti wrote:
Wed Sep 11, 2019 11:18 pm
Current Opencart Guzzlehttp 5.3.1 is not work.
You need to be clearer.

"is not work" is not a good description.

What *exactly* are you trying to do and what *exactly* is it doing instead?

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by pm-netti » Wed Sep 11, 2019 11:52 pm

paulfeakins wrote:
Wed Sep 11, 2019 11:36 pm
pm-netti wrote:
Wed Sep 11, 2019 11:18 pm
Current Opencart Guzzlehttp 5.3.1 is not work.
You need to be clearer.

"is not work" is not a good description.

What *exactly* are you trying to do and what *exactly* is it doing instead?
That postb.in should output:

Code: Select all

Headers
x-real-ip: 192.130.146.163
host: postb.in
connection: close
content-length:388
user-agent: Guzzle/5.3.1 curl/7.65.3 PHP/5.6.40
checkout-account: 346754
checkout-algorithm: sha256
checkout-method:POST
checkout-nonce: 564635208570151
checkout-timestamp: 2019-09-11T12:06:45.799Z
content-type: application/json; charset=utf-8
signature: pla pla pla
What this is difficult to understand? This is one new interface of Payment Gateway. The old interface disappears at some point.

Ps. This payment gateway is inessential. Main important is it, that system/storage/vendor/guzzlehttp is useless and dud.

Image
- - - OpenCart Upgrade Service - - -


User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä-Finland

Post by pm-netti » Thu Sep 12, 2019 2:41 am

Ps. Guzzlehttp 5.3.1 is released in the summer of 2016, version 6.3.3 in spring 2018 :)

https://packagist.org/packages/guzzlehttp/guzzle

Image
- - - OpenCart Upgrade Service - - -


User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä-Finland
Who is online

Users browsing this forum: No registered users and 19 guests