diff --git a/README.md b/README.md index fa26c484..e1ac5054 100644 --- a/README.md +++ b/README.md @@ -351,14 +351,9 @@ Suppose you have set IPN URL to **http://example.com/ipn/notify/** in PayPal. To */ public function postNotify(Request $request) { - $request->merge(['cmd' => '_notify-validate']); - $post = $request->all(); - - $response = $this->verifyIPN($post); - - session([ - 'ipn' => $response - ]); + $response = $this->parsePayPalIPN($request); + + // Parse IPN response accordingly to your requirements. } ``` diff --git a/src/Traits/IPNResponse.php b/src/Traits/IPNResponse.php index b065e280..377dbf50 100644 --- a/src/Traits/IPNResponse.php +++ b/src/Traits/IPNResponse.php @@ -12,15 +12,13 @@ trait IPNResponse * Retrieve IPN Response From PayPal. * * @param \Illuminate\Http\Request $request + * @return array */ - public function postNotify(Request $request) + protected function parsePayPalIPN(Request $request) { $request->merge(['cmd' => '_notify-validate']); $post = $request->all(); - $response = $this->verifyIPN($post); - session([ - 'ipn' => $response, - ]); + return $this->verifyIPN($post); } }