@@ 38-62 (lines=25) @@ | ||
35 | * @param IPayload |
|
36 | * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
|
37 | */ |
|
38 | public function __construct( |
|
39 | IValidatorIterator $validators, |
|
40 | ISchemaValidator $schemaValidator, |
|
41 | IPayloadMap $payloadMap, |
|
42 | LoggerInterface $logger, |
|
43 | IPayload $parentPayload = null |
|
44 | ) { |
|
45 | $this->logger = $logger; |
|
46 | $this->validators = $validators; |
|
47 | $this->parentPayload = $parentPayload; |
|
48 | ||
49 | $this->extractionPaths = [ |
|
50 | 'description' => 'string(x:Description/x:Description)', |
|
51 | 'title' => 'string(x:Description/x:Title)', |
|
52 | 'lineNumber' => 'number(@webLineId)', |
|
53 | 'itemId' => 'string(@itemId)', |
|
54 | 'quantity' => 'number(@quantity)', |
|
55 | ]; |
|
56 | $this->optionalExtractionPaths = [ |
|
57 | 'color' => 'x:Description/x:Color', |
|
58 | 'colorId' => 'x:Description/x:Color/@id', |
|
59 | 'size' => 'x:Description/x:Size', |
|
60 | 'sizeId' => 'x:Description/x:Size/@id', |
|
61 | ]; |
|
62 | } |
|
63 | ||
64 | public function getLineNumber() |
|
65 | { |
@@ 47-68 (lines=22) @@ | ||
44 | * @param IPayload |
|
45 | * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
|
46 | */ |
|
47 | public function __construct( |
|
48 | IValidatorIterator $validators, |
|
49 | ISchemaValidator $schemaValidator, |
|
50 | IPayloadMap $payloadMap, |
|
51 | LoggerInterface $logger, |
|
52 | IPayload $parentPayload = null |
|
53 | ) { |
|
54 | $this->logger = $logger; |
|
55 | $this->validators = $validators; |
|
56 | $this->schemaValidator = $schemaValidator; |
|
57 | $this->parentPayload = $parentPayload; |
|
58 | ||
59 | $this->extractionPaths = [ |
|
60 | 'responseCode' => 'string(x:ResponseCode)', |
|
61 | 'transactionId' => 'string(x:TransactionID)', |
|
62 | 'errorMessage' => 'string(x:ErrorMessage)', |
|
63 | 'orderId' => 'string(x:OrderId)', |
|
64 | 'paymentStatus' => 'string(x:PaymentInfo/x:PaymentStatus)', |
|
65 | 'pendingReason' => 'string(x:PaymentInfo/x:PendingReason)', |
|
66 | 'reasonCode' => 'string(x:PaymentInfo/x:ReasonCode)', |
|
67 | ]; |
|
68 | } |
|
69 | ||
70 | /** |
|
71 | * The description of error like "10413:The totals of the cart item amounts do not match order amounts". |
@@ 57-81 (lines=25) @@ | ||
54 | * @param IPayload |
|
55 | * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
|
56 | */ |
|
57 | public function __construct( |
|
58 | IValidatorIterator $validators, |
|
59 | ISchemaValidator $schemaValidator, |
|
60 | IPayloadMap $payloadMap, |
|
61 | LoggerInterface $logger, |
|
62 | IPayload $parentPayload = null |
|
63 | ) { |
|
64 | $this->logger = $logger; |
|
65 | $this->validators = $validators; |
|
66 | $this->schemaValidator = $schemaValidator; |
|
67 | $this->parentPayload = $parentPayload; |
|
68 | ||
69 | $this->extractionPaths = [ |
|
70 | 'orderId' => 'string(x:PaymentContext/x:OrderId)', |
|
71 | 'cardNumber' => 'string(x:PaymentContext/x:PaymentAccountUniqueId)', |
|
72 | 'responseCode' => 'string(x:ResponseCode)', |
|
73 | 'amountRedeemed' => 'number(x:AmountRedeemed)', |
|
74 | 'amountRedeemedCurrencyCode' => 'string(x:AmountRedeemed/@currencyCode)', |
|
75 | 'balanceAmount' => 'number(x:BalanceAmount)', |
|
76 | 'balanceAmountCurrencyCode' => 'string(x:BalanceAmount/@currencyCode)', |
|
77 | ]; |
|
78 | $this->booleanExtractionPaths = [ |
|
79 | 'panIsToken' => 'string(x:PaymentContext/x:PaymentAccountUniqueId/@isToken)', |
|
80 | ]; |
|
81 | } |
|
82 | ||
83 | public function getAmountRedeemed() |
|
84 | { |
@@ 51-76 (lines=26) @@ | ||
48 | * @param IPayload |
|
49 | * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
|
50 | */ |
|
51 | public function __construct( |
|
52 | IValidatorIterator $validators, |
|
53 | ISchemaValidator $schemaValidator, |
|
54 | IPayloadMap $payloadMap, |
|
55 | LoggerInterface $logger, |
|
56 | IPayload $parentPayload = null |
|
57 | ) { |
|
58 | $this->logger = $logger; |
|
59 | $this->validators = $validators; |
|
60 | $this->schemaValidator = $schemaValidator; |
|
61 | $this->parentPayload = $parentPayload; |
|
62 | ||
63 | $this->extractionPaths = [ |
|
64 | 'orderId' => 'string(x:PaymentContext/x:OrderId)', |
|
65 | 'cardNumber' => 'string(x:PaymentContext/x:PaymentAccountUniqueId)', |
|
66 | 'amount' => 'number(x:Amount)', |
|
67 | 'currencyCode' => 'string(x:Amount/@currencyCode)', |
|
68 | 'requestId' => 'string(@requestId)', |
|
69 | ]; |
|
70 | $this->booleanExtractionPaths = [ |
|
71 | 'panIsToken' => 'string(x:PaymentContext/x:PaymentAccountUniqueId/@isToken)', |
|
72 | ]; |
|
73 | $this->optionalExtractionPaths = [ |
|
74 | 'pin' => 'x:Pin', |
|
75 | ]; |
|
76 | } |
|
77 | ||
78 | /** |
|
79 | * The result of the request transaction. |
@@ 48-73 (lines=26) @@ | ||
45 | * @param IPayload |
|
46 | * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
|
47 | */ |
|
48 | public function __construct( |
|
49 | IValidatorIterator $validators, |
|
50 | ISchemaValidator $schemaValidator, |
|
51 | IPayloadMap $payloadMap, |
|
52 | LoggerInterface $logger, |
|
53 | IPayload $parentPayload = null |
|
54 | ) { |
|
55 | $this->logger = $logger; |
|
56 | $this->validators = $validators; |
|
57 | $this->schemaValidator = $schemaValidator; |
|
58 | $this->parentPayload = $parentPayload; |
|
59 | ||
60 | $this->extractionPaths = [ |
|
61 | 'orderId' => 'string(x:PaymentContext/x:OrderId)', |
|
62 | 'cardNumber' => 'string(x:PaymentContext/x:PaymentAccountUniqueId)', |
|
63 | 'amount' => 'number(x:Amount)', |
|
64 | 'currencyCode' => 'string(x:Amount/@currencyCode)', |
|
65 | 'requestId' => ' string(@requestId)', |
|
66 | ]; |
|
67 | $this->optionalExtractionPaths = [ |
|
68 | 'pin' => 'x:Pin', |
|
69 | ]; |
|
70 | $this->booleanExtractionPaths = [ |
|
71 | 'panIsToken' => 'string(x:PaymentContext/x:PaymentAccountUniqueId/@isToken)' |
|
72 | ]; |
|
73 | } |
|
74 | ||
75 | /** |
|
76 | * Name, value pairs of root attributes |