From ad6b924f7f2d97aef65cdd3507a9036ca6bde16f Mon Sep 17 00:00:00 2001 From: Daniel Dudzic Date: Tue, 9 Apr 2024 14:31:22 +0200 Subject: [PATCH 1/3] Save Card Last Digits in order meta (PCP-2935) --- .../src/Processor/CreditCardOrderInfoHandlingTrait.php | 2 +- package.json | 3 ++- yarn.lock | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/ppcp-wc-gateway/src/Processor/CreditCardOrderInfoHandlingTrait.php b/modules/ppcp-wc-gateway/src/Processor/CreditCardOrderInfoHandlingTrait.php index 4cd9e07ed..7a1b09035 100644 --- a/modules/ppcp-wc-gateway/src/Processor/CreditCardOrderInfoHandlingTrait.php +++ b/modules/ppcp-wc-gateway/src/Processor/CreditCardOrderInfoHandlingTrait.php @@ -140,7 +140,7 @@ trait CreditCardOrderInfoHandlingTrait { ); $wc_order->add_order_note( $cvv_response_order_note ); - $meta_details = array_merge( $fraud_responses, array( 'card_brand' => $card_brand ) ); + $meta_details = array_merge( $fraud_responses, array( 'card_brand' => $card_brand, 'card_last_digits' => $card_last_digits ) ); $wc_order->update_meta_data( PayPalGateway::FRAUD_RESULT_META_KEY, $meta_details ); $wc_order->save_meta_data(); diff --git a/package.json b/package.json index a0e2d325a..beed09ccb 100644 --- a/package.json +++ b/package.json @@ -86,6 +86,7 @@ }, "dependencies": { "dotenv": "^16.0.3", - "npm-run-all": "^4.1.5" + "npm-run-all": "^4.1.5", + "run-s": "^0.0.0" } } diff --git a/yarn.lock b/yarn.lock index 9316efe59..b9ab4e05f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -454,6 +454,11 @@ resolve@^1.10.0: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" +run-s@^0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/run-s/-/run-s-0.0.0.tgz#599912be20c00ba7698655c9936d075d31b71754" + integrity sha512-KPDNauF2Tpnm3nG0+0LJuJxwBFrhAdthpM8bVdDvjWQA7pWP7QoNwEl1+dJ7WVJj81AQP/i6kl6JUmAk7tg3Og== + safe-regex-test@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.0.tgz#793b874d524eb3640d1873aad03596db2d4f2295" From 4f2e98e9cc57d57cdd90b42523119a9d5d62d9e3 Mon Sep 17 00:00:00 2001 From: Daniel Dudzic Date: Tue, 9 Apr 2024 14:43:00 +0200 Subject: [PATCH 2/3] Remove the yarn.lock and package.json changes --- package.json | 3 +-- yarn.lock | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/package.json b/package.json index beed09ccb..a0e2d325a 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,6 @@ }, "dependencies": { "dotenv": "^16.0.3", - "npm-run-all": "^4.1.5", - "run-s": "^0.0.0" + "npm-run-all": "^4.1.5" } } diff --git a/yarn.lock b/yarn.lock index b9ab4e05f..9316efe59 100644 --- a/yarn.lock +++ b/yarn.lock @@ -454,11 +454,6 @@ resolve@^1.10.0: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" -run-s@^0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/run-s/-/run-s-0.0.0.tgz#599912be20c00ba7698655c9936d075d31b71754" - integrity sha512-KPDNauF2Tpnm3nG0+0LJuJxwBFrhAdthpM8bVdDvjWQA7pWP7QoNwEl1+dJ7WVJj81AQP/i6kl6JUmAk7tg3Og== - safe-regex-test@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.0.tgz#793b874d524eb3640d1873aad03596db2d4f2295" From ac81bb5e5ac5dc223fb57e2e7fdd781f1c6176a3 Mon Sep 17 00:00:00 2001 From: Daniel Dudzic Date: Tue, 9 Apr 2024 15:35:19 +0200 Subject: [PATCH 3/3] Fix PHPCS errors --- .../src/Processor/CreditCardOrderInfoHandlingTrait.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/ppcp-wc-gateway/src/Processor/CreditCardOrderInfoHandlingTrait.php b/modules/ppcp-wc-gateway/src/Processor/CreditCardOrderInfoHandlingTrait.php index 7a1b09035..51a3a741c 100644 --- a/modules/ppcp-wc-gateway/src/Processor/CreditCardOrderInfoHandlingTrait.php +++ b/modules/ppcp-wc-gateway/src/Processor/CreditCardOrderInfoHandlingTrait.php @@ -140,7 +140,13 @@ trait CreditCardOrderInfoHandlingTrait { ); $wc_order->add_order_note( $cvv_response_order_note ); - $meta_details = array_merge( $fraud_responses, array( 'card_brand' => $card_brand, 'card_last_digits' => $card_last_digits ) ); + $meta_details = array_merge( + $fraud_responses, + array( + 'card_brand' => $card_brand, + 'card_last_digits' => $card_last_digits, + ) + ); $wc_order->update_meta_data( PayPalGateway::FRAUD_RESULT_META_KEY, $meta_details ); $wc_order->save_meta_data();