Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promoting v2 to master #124

Merged
merged 27 commits into from Apr 9, 2019

Conversation

Projects
None yet
6 participants
@bkuhl
Copy link
Contributor

commented Apr 9, 2019

@davidstanley01 has already archived master in a v1 branch and released v1.9.5 targeting that branch. This PR promotes v2 to be the new master, and thus the default documentation that will be seen when developers check out our SDK.

davidstanley01 and others added some commits Dec 13, 2018

Simplify client instantiation (#70)
* Use guzzle, update creation workflow, fix tests, use Auth objects

* Use invokable classes for handlers

* Fix tests and update readme

* Tell PHP Stan to ignore mock interface being given as argument

* Add codeclimate test coverage

* Codeclimate

* Adjust code coverage target

* Forgot to add target to command

* Update config

* More config fun

* Add retry decider

* Clean up composer deps

* PHP Version

* Fix sniff errors

* Remove artifact

* Fix typehint error

* Skip step and assign to property without intermediate variable

* Add documentation for the mock method
Remove HTTPlug dependencies (#72)
* Remove HTTPlug Guzzle adapter as a suggestion

* Remove HTTPlug common client as a dependency

* Format code
Update travis and composer (#73)
* update travis and composer

* Update readme, too

* Set minimum-stability and remove need for psr/container
Custom field filters (#78)
* Add conversation filter for customFieldIds and update readme

* Update conversation example

* Add return type-hints

* Update method names
Add convenience methods and make setters fluent (#82)
* Add convenience methods and make setters fluent

* Add fluent setters and type-hints to customer
Use email address when customer Id not available (#80)
* Ensure that either customer ID or customer email are present

* Fix sniff errors

* Consolidate logic into trait

* Fix getFirstEmail and update test to pass email object into collection

* Add convenience methods and make setters fluent (#82)

* Add convenience methods and make setters fluent

* Add fluent setters and type-hints to customer

* Ensure that either customer ID or customer email are present

* Fix sniff errors

* Consolidate logic into trait

* Fix getFirstEmail and update test to pass email object into collection

* Update composer and re-run fix command
Hydrating all Customer entries, always (#101)
* Updated serialization to handle both HasMany and HasOne embedded entities

* Added customers example

* Customer embedded entities are now properly eagerly populated

* Deprecating CustomerRequest since all entities are eager loaded

* Clarifying this applies to both collections and single objects
Conversation's createdBy now hydrates the User's name correctly (#110)
* Hydrating Users as the Conversation's createdBy now hydrates the name correctly

* hydrating the id is now optional
Add deprecation notices (#112)
* Add deprecation notices to indicate that LegacyCredentials and transition service will no longer function when v1 sunsets.

* Fix style issues

* Added deprecation notice to useLegacyToken()
Authorization code flow support (#109)
*  Beginning support for authorization code flow (#107)

* Adding support for authorization code flow
* Correcting whitespaces (I hate whitespaces :D)
* Adding useCodeToken() method into ApiClient

* Allow an authorization code to be easily exchanged for tokens

* Expanded on docs to provide clarity on what auth is used when

* phpcs
Deprecating Customer's Chat in favor of ChatHandle (#102)
* Removing previously missed CustomerRequest usage

* Deprecated "Chat" in favor of "ChatHandle"
Flagging the legacy token conversion method as deprecated (#113)
* Flagging the legacy token conversion method as deprecated

* Reworked phrasing
Creating Customer with Conversation or Thread (#120)
* Customer id and email now included in extraction

* No longer including empty array values for extracted Customers

* Now using generic Customer extraction for easier Customer creation

* Updating method name

* Added example for how to create a Customer

* Removing null values
Validate webhooks for parity with v1 SDK (#122)
* Add methods to process incoming webhooks

* Fix style issues

* Add tests

* Add continue statement and use other header type

* Update readme

* Add example

@bkuhl bkuhl requested a review from davidstanley01 Apr 9, 2019

@bkuhl bkuhl merged commit 0216d73 into master Apr 9, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@aclight

This comment has been minimized.

Copy link

commented on 21f25d7 Apr 9, 2019

It would be helpful if the example in README.md fleshed out exactly what would be used here:
$request = new Request(...);

If my .php file is being called by HelpScout directly, what do I put there? I'm not familiar with Guzzle so my apologies if this is a stupid question.

This comment has been minimized.

Copy link
Contributor

replied Apr 10, 2019

That's merely an example of some kind of request object because it would be different depending on your application. Since you're calling the file directly, you'll need to have a class that implements the PSR-7 standard and populate it what it needs to meet the interface. You could pull in https://github.com/guzzle/psr7 and use https://github.com/guzzle/psr7/blob/master/src/Request.php.

This comment has been minimized.

Copy link

replied Apr 10, 2019

Ben--thanks for your reply.

My point is that with v1, the example implementation of an incoming webhook (https://github.com/helpscout/helpscout-api-php/tree/v1) gives one all that is necessary to get started. The Webhook class in src/Webhook.php takes care of reading in the headers (from $_SERVER) and the data (using file_get_contents('php://input')).

In v2 of IncomingWebhook.php (and the corresponding example in incoming_webhook.php) it seems that somehow the data needs to be shoved into a Request object, but I don't know how to do that. So the v2 example is not at parity with the v1 example, even if the underlying API might be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.