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

Issue #2843999 by mglaman, bojanz, vasike: Implement IPN handler. #4

Open
wants to merge 11 commits into
base: 8.x-1.x
Choose a base branch
from

Conversation

vasike
Copy link
Contributor

@vasike vasike commented Feb 10, 2017

No description provided.

Copy link
Contributor

@mglaman mglaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of right now I do not need a requirement to have a process and a validate method. The IPN shouldn't be that different between each API that is needs to be overridden.

Also, @bojanz I'm still torn on the Trait vs abstract PayPalIPNGatewayBase class which just has these methods. Payflow Gateway would still extend proper base class, but EC/Standard would extend new class.

* @return \Drupal\commerce_payment\Entity\PaymentInterface
* Payment object.
*/
public function loadPaymentByRemoteId($remote_id) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an issue to port this to the payment storage? If so, let's make a @todo referencing it. If not, make the issue and make the @todo :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new issue and patch for Commerce
https://www.drupal.org/node/2856209
and i'll put in a comment as suggested
thanks

*/
public function processIpnRequest(Request $request) {
// Validate and get IPN request data.
$ipn_data = $this->getIpnRequestValidate($request);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this method is pretty empty, let's just keep validation in here as part of the process. We can always split out later if needed. Otherwise we'd just need to call "validate".

*/
public function getIpnRequestValidate(Request $request) {
// Get IPN request data.
$ipn_data = $this->getRequestDataArray($request->getContent());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in process, if we keep both methods. Process gets data, then sends it to be validated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants