Skip to content

Commit 0bac0a3

Browse files
committed
PR requested changes.
1 parent a0d50f4 commit 0bac0a3

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

src/Plugin/Commerce/PaymentGateway/PaypalPaymentGatewayTrait.php

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ trait PaypalPaymentGatewayTrait {
1717
*
1818
* @return \Drupal\commerce_payment\Entity\PaymentInterface
1919
* Payment object.
20+
*
21+
* @todo: to be replaced by Commerce core payment storage method
22+
* @see https://www.drupal.org/node/2856209
2023
*/
2124
public function loadPaymentByRemoteId($remote_id) {
2225
/** @var \Drupal\commerce_payment\PaymentStorage $storage */
@@ -35,24 +38,6 @@ public function loadPaymentByRemoteId($remote_id) {
3538
* The request data array or FALSE.
3639
*/
3740
public function processIpnRequest(Request $request) {
38-
// Validate and get IPN request data.
39-
$ipn_data = $this->getIpnRequestValidate($request);
40-
41-
// ToDo other general validations for IPN data.
42-
return $ipn_data;
43-
}
44-
45-
/**
46-
* Validate an incoming IPN request and return the request data for extra
47-
* processing.
48-
*
49-
* @param Request $request
50-
* The request.
51-
*
52-
* @return mixed
53-
* The request data array or FALSE.
54-
*/
55-
public function getIpnRequestValidate(Request $request) {
5641
// Get IPN request data.
5742
$ipn_data = $this->getRequestDataArray($request->getContent());
5843

@@ -75,6 +60,8 @@ public function getIpnRequestValidate(Request $request) {
7560
\Drupal::logger('commerce_paypal')->alert('Invalid IPN received and ignored.');
7661
return FALSE;
7762
}
63+
64+
// ToDo other general validations for IPN data.
7865
return $ipn_data;
7966
}
8067

0 commit comments

Comments
 (0)