gebeer Posted April 4, 2023 Share Posted April 4, 2023 15 hours ago, Gadgetto said: Hey guys, I'm indeed starting further development on this module in the next days! It needs a lot of work to be done. The main part will be the transition to Snipcart 3.0 engine + a robust EU VAT tax integration. As usual I'll report the progress to this thread. Please stay tuned! Greetings, Martin This is great news and highly appreciated. The module as is works great for the most parts. But to make it work with snipcart v3, it does need some adjustments. Other than that I have it running without major issues. Since I thought that it won't be continued, I did quite some changes to the code in my install. Might turn that into a fork. Maybe there's something you can make use of. EDIT: Oh, I just saw that I had already forked it. But needs some cleanup, I guess... Link to comment Share on other sites More sharing options...
Gadgetto Posted August 14, 2023 Author Share Posted August 14, 2023 With the next SnipWire release I plan to support only V3 of the Snipcart engine. Supporting both versions would be too much effort. How do you think about this? 3 Link to comment Share on other sites More sharing options...
Gadgetto Posted August 14, 2023 Author Share Posted August 14, 2023 Which min. required PHP version would be OK for you? How many of you are still running your servers with PHP < 7.4? Link to comment Share on other sites More sharing options...
Tiberium Posted August 15, 2023 Share Posted August 15, 2023 22 hours ago, Gadgetto said: With the next SnipWire release I plan to support only V3 of the Snipcart engine. Supporting both versions would be too much effort. How do you think about this? After 4 years, it should be okay in my opinion. 22 hours ago, Gadgetto said: Which min. required PHP version would be OK for you? How many of you are still running your servers with PHP < 7.4? All my E-Commerce are on 8.x. I personal see no reason for 7.4. Since SnipCart self is again awake in developing, maybe a major version bump on the module side for a chance to cut old branches? 2 Link to comment Share on other sites More sharing options...
gebeer Posted August 15, 2023 Share Posted August 15, 2023 23 hours ago, Gadgetto said: Which min. required PHP version would be OK for you? How many of you are still running your servers with PHP < 7.4? Same for me here, PHP 8 is ok. Also Snipcart v3 only. Thanks for updating the module! 2 Link to comment Share on other sites More sharing options...
JoshoB Posted September 26, 2023 Share Posted September 26, 2023 I am looking for an ecommerce solution with ProcessWire and this seems to fit the bill. Supporting the latest version of SnipCart and enforcing use of PHP 8 are both fine, I think. Link to comment Share on other sites More sharing options...
gebeer Posted April 24 Share Posted April 24 @Gadgetto I am struggling with webhooks :-) In the docs it says: * All hookable event handler methods will return an array containing payload Snipcart sent to your endpoint. * In addition, the following class properties will be set: * * $this->payload (The payload Snipcart sent to your endpoint) * $this->responseStatus (The response status your endpoint sent to Snipcart) * $this->responseBody (The response body your endpoint sent to Snipcart) * * (Use the appropriate getter methods to receive these values!) * * How to use the hookable event handler methods (sample): * ~~~~~ * $webhooks->addHookAfter('handleOrderCompleted', function($event) { * $payload = $event->return; * //... your code here ... * }); * ~~~~~ * * PLEASE NOTE: those hooks will currently only work when placed in init.php or init() or ready() module methods! * I have setup a hook for order.completed in the init method of a custom autoload module public function init() { ... // SnipWire Webhooks $this->wire->webhooks->addHookAfter('handleOrderCompleted', $this, 'handleOrderCompleted'); } Issueing post requests to the endpoint returns an empty response body While in the docs it says: Quote * In addition, the following class properties will be set: * * $this->payload (The payload Snipcart sent to your endpoint) * $this->responseStatus (The response status your endpoint sent to Snipcart) * $this->responseBody (The response body your endpoint sent to Snipcart) when I var_dump($event->object->getResponseBody()) in my handler method, it gives an empty string which explains why the response body is empty. How can I set responseBody from within my hook handler method? There is no setter for that and Webhooks::responseBody is private, so I have no way to set it in my handler. To solve this, I introduced a setter method to the Webhooks class /** * Setter for responseBody. * * @param string $responseBody * @return void * */ public function setResponseBody(string $responseBody) { $this->responseBody = $responseBody; } Now in my handler method I can do $event->object->setResponseBody('{"test": "test"}'); Which results in While I was at it, I also added a setter for responseStatus. Not sure if you still maintain this module, so I will add this to my fork just in case anyone still needs it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now