| @@ 55-84 (lines=30) @@ | ||
| 52 | * @param IPayload |
|
| 53 | * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
|
| 54 | */ |
|
| 55 | public function __construct( |
|
| 56 | IValidatorIterator $validators, |
|
| 57 | ISchemaValidator $schemaValidator, |
|
| 58 | IPayloadMap $payloadMap, |
|
| 59 | LoggerInterface $logger, |
|
| 60 | IPayload $parentPayload = null |
|
| 61 | ) { |
|
| 62 | $this->logger = $logger; |
|
| 63 | $this->validators = $validators; |
|
| 64 | $this->payloadMap = $payloadMap; |
|
| 65 | $this->parentPayload = $parentPayload; |
|
| 66 | $this->payloadFactory = new PayloadFactory; |
|
| 67 | ||
| 68 | $this->extractionPaths = [ |
|
| 69 | 'id' => 'string(x:Id)', |
|
| 70 | 'amount' => 'number(x:Amount)', |
|
| 71 | ]; |
|
| 72 | $this->optionalExtractionPaths = [ |
|
| 73 | 'appliedCount' => '@appliedCount', |
|
| 74 | 'code' => 'x:Code', |
|
| 75 | 'description' => 'x:Description', |
|
| 76 | 'effectType' => 'x:EffectType', |
|
| 77 | 'taxClass' => 'x:TaxData/x:TaxClass', |
|
| 78 | ]; |
|
| 79 | $this->subpayloadExtractionPaths = [ |
|
| 80 | 'taxes' => 'x:TaxData/x:Taxes', |
|
| 81 | ]; |
|
| 82 | ||
| 83 | $this->taxes = $this->buildPayloadForInterface(static::TAX_ITERABLE_INTERFACE); |
|
| 84 | } |
|
| 85 | ||
| 86 | public function getAppliedCount() |
|
| 87 | { |
|
| @@ 52-82 (lines=31) @@ | ||
| 49 | * @param IPayload |
|
| 50 | * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
|
| 51 | */ |
|
| 52 | public function __construct( |
|
| 53 | IValidatorIterator $validators, |
|
| 54 | ISchemaValidator $schemaValidator, |
|
| 55 | IPayloadMap $payloadMap, |
|
| 56 | LoggerInterface $logger, |
|
| 57 | IPayload $parentPayload = null |
|
| 58 | ) { |
|
| 59 | $this->logger = $logger; |
|
| 60 | $this->validators = $validators; |
|
| 61 | $this->payloadMap = $payloadMap; |
|
| 62 | $this->parentPayload = $parentPayload; |
|
| 63 | $this->payloadFactory = new PayloadFactory; |
|
| 64 | ||
| 65 | $this->extractionPaths = [ |
|
| 66 | 'amount' => 'string(x:Amount)', |
|
| 67 | 'amountAuthorized' => 'string(x:AmountAuthorized)', |
|
| 68 | 'authorizationResponseCode' => 'string(x:Authorization/x:ResponseCode)', |
|
| 69 | 'orderId' => 'string(x:PaymentContext/x:PaymentSessionId)', |
|
| 70 | 'tenderType' => 'string(x:PaymentContext/x:TenderType)', |
|
| 71 | 'accountUniqueId' => 'string(x:PaymentContext/x:PaymentAccountUniqueId)', |
|
| 72 | 'paymentRequestId' => 'string(x:PaymentRequestId)', |
|
| 73 | ]; |
|
| 74 | $this->booleanExtractionPaths = [ |
|
| 75 | 'panIsToken' => 'string(x:PaymentContext/x:PaymentAccountUniqueId/@isToken)', |
|
| 76 | ]; |
|
| 77 | $this->subpayloadExtractionPaths = [ |
|
| 78 | 'customAttributes' => 'x:CustomAttributes', |
|
| 79 | ]; |
|
| 80 | ||
| 81 | $this->customAttributes = $this->buildPayloadForInterface(self::CUSTOM_ATTRIBUTE_ITERABLE_INTERFACE); |
|
| 82 | } |
|
| 83 | ||
| 84 | public function getAmount() |
|
| 85 | { |
|
| @@ 42-75 (lines=34) @@ | ||
| 39 | * @param IPayload |
|
| 40 | * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
|
| 41 | */ |
|
| 42 | public function __construct( |
|
| 43 | IValidatorIterator $validators, |
|
| 44 | ISchemaValidator $schemaValidator, |
|
| 45 | IPayloadMap $payloadMap, |
|
| 46 | LoggerInterface $logger, |
|
| 47 | IPayload $parentPayload = null |
|
| 48 | ) { |
|
| 49 | $this->logger = $logger; |
|
| 50 | $this->validators = $validators; |
|
| 51 | $this->schemaValidator = $schemaValidator; |
|
| 52 | $this->payloadMap = $payloadMap; |
|
| 53 | $this->parentPayload = $parentPayload; |
|
| 54 | $this->payloadFactory = new PayloadFactory(); |
|
| 55 | ||
| 56 | $this->adjustments = $this->buildPayloadForInterface( |
|
| 57 | static::ADJUSTMENT_ITERABLE_INTERFACE |
|
| 58 | ); |
|
| 59 | ||
| 60 | $this->extractionPaths = [ |
|
| 61 | 'description' => 'string(x:Description/x:Description)', |
|
| 62 | 'title' => 'string(x:Description/x:Title)', |
|
| 63 | 'lineNumber' => 'number(@webLineId)', |
|
| 64 | 'itemId' => 'string(@itemId)', |
|
| 65 | ]; |
|
| 66 | $this->optionalExtractionPaths = [ |
|
| 67 | 'color' => 'x:Description/x:Color', |
|
| 68 | 'colorId' => 'x:Description/x:Color/@id', |
|
| 69 | 'size' => 'x:Description/x:Size', |
|
| 70 | 'sizeId' => 'x:Description/x:Size/@id', |
|
| 71 | ]; |
|
| 72 | $this->subpayloadExtractionPaths = [ |
|
| 73 | 'adjustments' => 'x:Adjustments', |
|
| 74 | ]; |
|
| 75 | } |
|
| 76 | ||
| 77 | public function getLineNumber() |
|
| 78 | { |
|
| @@ 49-81 (lines=33) @@ | ||
| 46 | * @param IPayload |
|
| 47 | * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
|
| 48 | */ |
|
| 49 | public function __construct( |
|
| 50 | IValidatorIterator $validators, |
|
| 51 | ISchemaValidator $schemaValidator, |
|
| 52 | IPayloadMap $payloadMap, |
|
| 53 | LoggerInterface $logger, |
|
| 54 | IPayload $parentPayload = null |
|
| 55 | ) { |
|
| 56 | $this->logger = $logger; |
|
| 57 | $this->validators = $validators; |
|
| 58 | $this->schemaValidator = $schemaValidator; |
|
| 59 | $this->payloadMap = $payloadMap; |
|
| 60 | $this->parentPayload = $parentPayload; |
|
| 61 | $this->payloadFactory = new PayloadFactory; |
|
| 62 | ||
| 63 | $this->extractionPaths = [ |
|
| 64 | 'id' => 'string(@id)', |
|
| 65 | 'chargeType' => 'string(@chargeType)', |
|
| 66 | 'destinationId' => 'string(x:DestinationTarget/@ref)', |
|
| 67 | ]; |
|
| 68 | $this->optionalExtractionPaths = [ |
|
| 69 | 'giftId' => 'x:Gifting/@id', |
|
| 70 | 'giftItemId' => 'x:Gifting/x:ItemId', |
|
| 71 | 'giftDescription' => 'x:Gifting/x:ItemDesc', |
|
| 72 | ]; |
|
| 73 | $this->subpayloadExtractionPaths = [ |
|
| 74 | 'orderItems' => 'x:Items', |
|
| 75 | 'giftPricing' => 'x:Gifting/x:Pricing', |
|
| 76 | ]; |
|
| 77 | ||
| 78 | $this->orderItems = $this->buildPayloadForInterface( |
|
| 79 | static::ORDER_ITEM_ITERABLE_INTERFACE |
|
| 80 | ); |
|
| 81 | } |
|
| 82 | ||
| 83 | public function getChargeType() |
|
| 84 | { |
|