File tree Expand file tree Collapse file tree 2 files changed +403
-0
lines changed
app/code/Magento/PaypalGraphQl/Model
dev/tests/integration/testsuite/Magento/PaypalGraphQl/Model/Resolver/Customer Expand file tree Collapse file tree 2 files changed +403
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Copyright © Magento, Inc. All rights reserved.
4+ * See COPYING.txt for license details.
5+ */
6+ declare (strict_types=1 );
7+
8+ namespace Magento \PaypalGraphQl \Model ;
9+
10+ use Magento \Framework \GraphQl \Exception \GraphQlInputException ;
11+ use Magento \QuoteGraphQl \Model \Cart \Payment \AdditionalDataProviderInterface ;
12+
13+ /**
14+ * Get payment additional data for Payflow pro payment
15+ */
16+ class PayflowProCcVaultAdditionalDataProvider implements AdditionalDataProviderInterface
17+ {
18+ private const PATH_ADDITIONAL_DATA = 'payflowpro_cc_vault ' ;
19+ /**
20+ * Format Payflow input into value expected when setting payment method
21+ *
22+ * @param array $args
23+ * @return array
24+ */
25+ public function getData (array $ args ): array
26+ {
27+ if (!isset ($ args [self ::PATH_ADDITIONAL_DATA ])) {
28+ throw new GraphQlInputException (
29+ __ ('Required parameter "payflowpro_cc_vault" for "payment_method" is missing. ' )
30+ );
31+ }
32+
33+ if (!isset ($ args [self ::PATH_ADDITIONAL_DATA ]['public_hash ' ])) {
34+ throw new GraphQlInputException (
35+ __ ('Required parameter "public_hash" for "payflowpro_cc_vault" is missing. ' )
36+ );
37+ }
38+
39+ return $ args [self ::PATH_ADDITIONAL_DATA ];
40+ }
41+ }
You can’t perform that action at this time.
0 commit comments