Swedbank-SPP / swedbank-payment-portal

Swedbank Payment Portal API library for PHP
Other
36 stars 21 forks source link

[FATAL] PCDATA invalid Char value 28 in (line: 37, column: 33) #17

Open lkallas opened 7 years ago

lkallas commented 7 years ago

Using HCC card payment in test environment I receive this error in the very last step: [FATAL] PCDATA invalid Char value 28 in (line: 37, column: 33).

This error is triggered when this code returns:

$threeDresp = $this->spp->getPaymentCardHostedCardCaptureGateway()->threeDauthentication($ref, $pares);

stacktrace:

#0 /home/webshop/swedbank-spp/vendor/jms/serializer/src/JMS/Serializer/Serializer.php(127): JMS\Serializer\XmlDeserializationVisitor->prepare('<?xml version="...') 
#1 [internal function]: JMS\Serializer\Serializer->JMS\Serializer\{closure}(Object(JMS\Serializer\XmlDeserializationVisitor)) 
#2 /home/webshop/swedbank-spp/vendor/phpoption/phpoption/src/PhpOption/Some.php(89): call_user_func(Object(Closure), Object(JMS\Serializer\XmlDeserializationVisitor)) 
#3 /home/webshop/swedbank-spp/vendor/jms/serializer/src/JMS/Serializer/Serializer.php(131): PhpOption\Some->map(Object(Closure)) 
#4 /home/webshop/swedbank-spp/vendor/swedbank-spp/swedbank-payment-portal/src/Serializer.php(48): JMS\Serializer\Serializer->deserialize('<?xml version="...', 'SwedbankPayment...', 'xml') 
#5 /home/webshop/swedbank-spp/vendor/swedbank-spp/swedbank-payment-portal/src/Transaction/TransactionRepository.php(199): SwedbankPaymentPortal\Serializer->getObject('<?xml version="...', 'SwedbankPayment...') 
#6 /home/webshop/swedbank-spp/vendor/swedbank-spp/swedbank-payment-portal/src/Transaction/TransactionRepository.php(182): SwedbankPaymentPortal\Transaction\TransactionRepository->deSerializeFrame('a:2:{s:7:"reque...') 
#7 /home/webshop/swedbank-spp/vendor/swedbank-spp/swedbank-payment-portal/src/Transaction/TransactionRepository.php(82): SwedbankPaymentPortal\Transaction\TransactionRepository->deSerialize('a:7:{s:3:"key";...') 
#8 /home/webshop/swedbank-spp/vendor/swedbank-spp/swedbank-payment-portal/src/CC/HCCService/HCCService.php(244): SwedbankPaymentPortal\Transaction\TransactionRepository->get('161631451') 
#9 /home/webshop/swedbank-spp/vendor/swedbank-spp/swedbank-payment-portal/src/CC/HCCService/HCCService.php(131): SwedbankPaymentPortal\CC\HCCService\HCCService->hccQuery('161631451') 
#10 /home/webshop/swedbank-spp/vendor/swedbank-spp/swedbank-payment-portal/src/CC/HCCService/HCCService.php(230): SwedbankPaymentPortal\CC\HCCService\HCCService->callbackProcessing('161631451', Object(SwedbankPaymentPortal\SharedEntity\Type\TransactionResult), Object(SwedbankPaymentPortal\Transaction\TransactionContainer), Object(SwedbankPaymentPortal\Transaction\TransactionFrame)) 
#11 /home/webshop/swedbank-spp/src/Controllers/ThreeDeeController.php(40): SwedbankPaymentPortal\CC\HCCService\HCCService->threeDauthentication('161631451', 'eJzVWFmzokoSfud...') 
#12 [internal function]: Astro\Controllers\ThreeDeeController->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Array) 
#13 /home/webshop/swedbank-spp/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(41): call_user_func(Array, Object(Slim\Http\Request), Object(Slim\Http\Response), Array) 
#14 /home/webshop/swedbank-spp/vendor/slim/slim/Slim/Route.php(344): Slim\Handlers\Strategies\RequestResponse->__invoke(Array, Object(Slim\Http\Request), Object(Slim\Http\Response), Array) 
#15 /home/webshop/swedbank-spp/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(122): Slim\Route->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response)) 
#16 /home/webshop/swedbank-spp/vendor/slim/slim/Slim/Route.php(316): Slim\Route->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response)) 
#17 /home/webshop/swedbank-spp/vendor/slim/slim/Slim/App.php(476): Slim\Route->run(Object(Slim\Http\Request), Object(Slim\Http\Response)) 
#18 /home/webshop/swedbank-spp/vendor/akrabat/rka-ip-address-middleware/src/IpAddress.php(93): Slim\App->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response)) 
#19 [internal function]: RKA\Middleware\IpAddress->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\App)) 
#20 /home/webshop/swedbank-spp/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(RKA\Middleware\IpAddress), Array) 
#21 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\App)) 
#22 /home/webshop/swedbank-spp/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(73): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\App)) 
#23 /home/webshop/swedbank-spp/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(122): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response)) 
#24 /home/webshop/swedbank-spp/vendor/slim/slim/Slim/App.php(370): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response)) 
#25 /home/webshop/swedbank-spp/vendor/slim/slim/Slim/App.php(295): Slim\App->process(Object(Slim\Http\Request), Object(Slim\Http\Response)) 
#26 /home/webshop/swedbank-spp/public/index.php(33): Slim\App->run() 
#27 {main}

DEBUG XML:

-----
setup
<?xml version="1.0" encoding="UTF-8"?>
<Request version="2">
  <Authentication>
    <password>*******</password>
    <client>*******</client>
  </Authentication>
  <Transaction>
    <TxnDetails>
      <merchantreference>161631451</merchantreference>
      <amount currency="EUR">0.01</amount>
    </TxnDetails>
    <HpsTxn>
      <page_set_id>166</page_set_id>
      <method>setup</method>
      <return_url>http://dev.noom.ee/swedbank-spp/paymentresult/hcc/confirm/161631451</return_url>
      <expiry_url>http://dev.noom.ee/swedbank-spp/paymentresult/hcc/expired/161631451</expiry_url>
      <error_url>http://dev.noom.ee/swedbank-spp/paymentresult/hcc/failed/161631451</error_url>
      <DynamicData>
        <dyn_data_4>http://dev.noom.ee/swedbank-spp/</dyn_data_4>
      </DynamicData>
    </HpsTxn>
  </Transaction>
</Request>

<?xml version="1.0" encoding="UTF-8"?>
<Response version='2'>
  <HpsTxn>
    <hps_url>https://accreditation.datacash.com/hps-acq_a/</hps_url>
    <session_id>2f9af21b-13a4-476b-a5fe-9724e89f13e5</session_id>
  </HpsTxn>
  <datacash_reference>3200900018894479</datacash_reference>
  <merchantreference>161631451</merchantreference>
  <mode>LIVE</mode>
  <reason>ACCEPTED</reason>
  <status>1</status>
  <time>1508407546</time>
</Response>

-----
hccQueryRequest
<?xml version="1.0" encoding="UTF-8"?>
<Request version="2">
  <Authentication>
    <password>*******</password>
    <client>*******</client>
  </Authentication>
  <Transaction>
    <HistoricTxn>
      <method>query</method>
      <reference>3200900018894479</reference>
    </HistoricTxn>
  </Transaction>
</Request>

<?xml version="1.0" encoding="UTF-8"?>
<Response version='2'>
  <HpsTxn>
    <capture_status>populated</capture_status>
    <card_scheme>Debit Mastercard</card_scheme>
    <country>gbr</country>
    <cv2_captured>Yes</cv2_captured>
    <expirydate>0119</expirydate>
    <issuer>Unknown</issuer>
    <pan>557347******0001</pan>
  </HpsTxn>
  <datacash_reference>3200900018894479</datacash_reference>
  <information>You have queried an HPS transaction, which has stored data that has not yet been used</information>
  <merchantreference>161631451</merchantreference>
  <mode>LIVE</mode>
  <reason>ACCEPTED</reason>
  <status>1</status>
  <time>1508407555</time>
</Response>

-----
authorization
<?xml version="1.0" encoding="UTF-8"?>
<Request version="2">
  <Authentication>
    <password>*******</password>
    <client>*******</client>
  </Authentication>
  <Transaction>
    <TxnDetails>
      <Risk>
        <Action service="1">
          <MerchantConfiguration>
            <channel>W</channel>
            <merchant_location>Estonia</merchant_location>
          </MerchantConfiguration>
          <CustomerDetails>
            <OrderDetails>
              <BillingDetails>
                <state_province>tt</state_province>
                <name>Lennar Kallas</name>
                <zip_code>61408</zip_code>
                <address_line1>Puu 1 oks 2</address_line1>
                <address_line2/>
                <city>Tartu</city>
                <country>EE</country>
              </BillingDetails>
            </OrderDetails>
            <PersonalDetails>
              <first_name>Lennar</first_name>
              <surname>Kallas</surname>
              <telephone>51944863</telephone>
            </PersonalDetails>
            <ShippingDetails>
              <title>Mr.</title>
              <first_name>Lennar</first_name>
              <surname>Kallas</surname>
              <address_line1>Puu 1 oks 2</address_line1>
              <address_line2/>
              <city>Tartu</city>
              <country>EE</country>
              <zip_code>61408</zip_code>
            </ShippingDetails>
            <PaymentDetails>
              <payment_method>CC</payment_method>
            </PaymentDetails>
            <RiskDetails>
              <ip_address>80.235.19.38</ip_address>
              <email_address>lennar@noom.ee</email_address>
            </RiskDetails>
          </CustomerDetails>
        </Action>
      </Risk>
      <merchantreference>161631451</merchantreference>
      <amount currency="EUR">0.01</amount>
      <ThreeDSecure>
        <purchase_datetime>20171019 13:06:04</purchase_datetime>
        <verify>yes</verify>
        <Browser>
          <device_category>0</device_category>
        </Browser>
        <merchant_url>http://dev.noom.ee/swedbank-spp/</merchant_url>
        <purchase_desc>Demo makse</purchase_desc>
      </ThreeDSecure>
      <capturemethod>ecomm</capturemethod>
    </TxnDetails>
    <CardTxn>
      <method>auth</method>
      <card_details type="from_hps">3200900018894479</card_details>
    </CardTxn>
  </Transaction>
</Request>

<?xml version="1.0" encoding="UTF-8"?>
<Response version='2'>
  <CardTxn>
    <ThreeDSecure>
      <acs_url>https://accreditation.datacash.com/acs-acq_a</acs_url>
      <pareq_message>eJxdUttugjAYvvcpiPejraCAqU3cuJgXOrf5Ah38UeI42BYPe/q1YjlIQtLv0P5HujsIgPgbkloA
GzkOXYOUfA9Oli7GFXdJGEa+H0RjI2p5u/yCU3PW6AxCZmXBiIvdCUUWWnkNIjnwQllCUzw5va42
zMfh1PMoesBOz0GsYkaw/ShqmM5R8ByYvED6w4ujAqkoulOdIynrQokbCycziizo5Fr8soNS1Ryh
FM5uUZa5C4Dsky+yqhBFxmXrQM+F0G1tCNmPes1Sto6Xl8G/2/sfu0+8+TsuKDKOzp9yBWyCSUAw
iRzizfFsjn2K7nyvYbkpgGEXE92uBnRqZfJYPizG0Sd6HamFgCK5sSgIdUss6gxwrcoC9B09xfbc
yxVkwmLISyfnRwk6SUO07XnuBn17H4w8UXqC02ng+UE7WFNNIwyyyPSoSGTUB2iD2Dd1OLuDZjD3
bWUjioab/A8BB8Xq
</pareq_message>
    </ThreeDSecure>
    <card_scheme>Debit Mastercard</card_scheme>
    <country>United Kingdom</country>
    <token>1BB59F398746C6FDB87AD260847FFE94E5B47528</token>
  </CardTxn>
  <MAC>
    <outcome>ACCEPT</outcome>
  </MAC>
  <acquirer>Swedbank Baltic Latvia</acquirer>
  <datacash_reference>3200900018894479</datacash_reference>
  <merchantreference>161631451</merchantreference>
  <mid>1000000000</mid>
  <mode>LIVE</mode>
  <reason>3DS Payer Verification Required</reason>
  <status>150</status>
  <time>1508407564</time>
</Response>

-----
3dauthorization
<?xml version="1.0" encoding="UTF-8"?>
<Request version="2">
  <Authentication>
    <password>*******</password>
    <client>*******</client>
  </Authentication>
  <Transaction>
    <HistoricTxn>
      <reference>3200900018894479</reference>
      <pares_message>eJzVWFmzokoSfudXdPQ8ErdZXbhx+kQUO2ghqwhvKMgiosgqv37Qs9knzsz09DwNEYaSlZlVX+ZX&#13;
mWUhT3ZyiSLeinbNJXpGvn17glFVBXH0LQ1/fj8HP4j5nKHpGfP9NjgO68CMqs+DP6o0LqLwVWfU&#13;
aqNLlZ6KZ+IH/oN8wt5e34ZhdNklQVG/CUZRsCtZRXum8fmEop6w19eP8WN0UfhnAn97nrAXyZtL&#13;
7LPPJ725CarowUmfhs+QB90vHzumV7aBa8Ph5xN20/jQD4M6eiZxYkbgBPONoP7Gp3/j9BN2l3+o&#13;
nW8zgeOpGWfHceIJexR8qI0hvkTF7vrMzOZP2Pvbh0LUn09FNNqMIXv//Q7wM56nc1A8478+t7mD&#13;
jzjbmwfvdXp8BEPcwTBP2F3+oVbVQd1Uz94T9vrrAUDQts8ZAEAA6zwwHcVgx4+8PoOXZ4zfXeUB&#13;
0S59xm9oxu9f/YA8Pl3SOjk+Uy9WH4J3xG/LH7HfWPf6Yo1cGxd2ib71x7yof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RAScNxWL+1DuTr3vGvW8Gt&#13;
dzy2DuRPesfjBkT+ZAc+bkDkT3bg4wZE/qR3PLYO5Ld7xwJAwjdJfcV2jBqiXFtMKsBmiDz+45y5&#13;
vGLP+dN8wq0tbNKN9X5ryZeFI8+lLJjJIYGmeFihYozmxh5ro25POzMSVUTljISro+Mv06qTd1Hd&#13;
ZbnoeZhMi1DVrVC8XKqdMx7gdAVDkwvWlhaNM5TRbNKNaZQOLOkCSTOwMbz2ROWu3Heq4FPpulHC&#13;
RhUCgsCLY5qxMx2VmjxW18XRjuVSIyIjFWUlG1unGCLEIta3843nNuqWaLaqTV45pU1nhUq7qxgf&#13;
Y6pLC/wY4vnUk05Dn22mqDE5Oil2JBYorSD64dK5osYyy9M0B7LAqhOxRos9UFiJkhSIF6m+ozSZ&#13;
qpVGaaCL82XI2ty+W7rpXHa+bB3Y59uLJ+yXG46He5D7NTT2eg99M/31jvqf+nsPyg==&#13;
</pares_message>
      <method>threedsecure_authorization_request</method>
    </HistoricTxn>
  </Transaction>
</Request>

<?xml version="1.0" encoding="UTF-8"?>
<Response version='2'>
  <CardTxn>
    <Cv2Avs>
      <cv2avs_status>SECURITY CODE MATCH ONLY</cv2avs_status>
    </Cv2Avs>
    <ThreeDSecure>
      <aav>jAAAEAVlaRUIQBUIQHVpAAAAAAA=</aav>
      <cardholder_registered>yes</cardholder_registered>
      <cavvAlgorithm>3</cavvAlgorithm>
      <eci>02</eci>
      <xid>MDAwMDAwMDAwMDAwMTg4OTQ0Nzk=</xid>
    </ThreeDSecure>
    <authcode>361561</authcode>
    <card_scheme>Debit Mastercard</card_scheme>
    <country>United Kingdom</country>
  </CardTxn>
  <MAC>
    <outcome>ACCEPT</outcome>
  </MAC>
  <Risk>
    <action_response>
      <bankresult_response>
        <cpi_value></cpi_value>
        <response_code>00</response_code>
        <response_message>Successful</response_message>
        <transaction_id>3200900018894479</transaction_id>
      </bankresult_response>
      <screening_response>
        <additional_messages>
          <message></message>
        </additional_messages>
        <cpi_value></cpi_value>
        <response_code>00</response_code>
        <response_message>Transaction Approved</response_message>
        <transaction_id>3200900018894479</transaction_id>
      </screening_response>
    </action_response>
  </Risk>
  <acquirer>Swedbank Baltic Latvia</acquirer>
  <datacash_reference>3200900018894479</datacash_reference>
  <extended_response_message>Approved, OK</extended_response_message>
  <extended_status>000</extended_status>
  <merchantreference>3200900018894479</merchantreference>
  <mid>1000000000</mid>
  <mode>LIVE</mode>
  <reason>ACCEPTED</reason>
  <status>1</status>
  <time>1508407571</time>
</Response>

}
lkallas commented 7 years ago

I was able to somewhat debug it.

As this error occurs here by the stacktrace above:

/home/webshop/swedbank-spp/vendor/jms/serializer/src/JMS/Serializer/Serializer.php(127): JMS\Serializer\XmlDeserializationVisitor->prepare('<?xml version="...')

I printed out the variable $data in line 127 and I got this:

<?xml version="1.0" encoding="UTF-8"?>
<Response version="2">
  <time>1508410583</time>
  <reason>ACCEPTED</reason>
  <CardTxn>
    <Cv2Avs>
      <cv2avs_status>SECURITY CODE MATCH ONLY</cv2avs_status>
    </Cv2Avs>
    <ThreeDSecure>
      <aav>jAAAEBhVghUIQRUIQQWCAAAAAAA=</aav>
      <cardholder_registered>yes</cardholder_registered>
      <cavvAlgorithm>3</cavvAlgorithm>
      <eci>02</eci>
      <xid>MDAwMDAwMDAwMDAwMTg4OTQ2MzU=</xid>
    </ThreeDSecure>
    <authcode>907097</authcode>
    <card_scheme>Debit Mastercard</card_scheme>
  </CardTxn>
  <MAC>
    <outcome>ACCEPT</outcome>
  </MAC>
  <Risk>
    <action_response>
      <bankresult_response>
        <cpi_value>▒#▒</cpi_value>
        <response_code>00</response_code>
        <response_message>Successful</response_message>
        <transaction_id>3900900018894635</transaction_id>
      </bankresult_response>
      <screening_response>
        <additional_messages>
          <message>▒#▒</message>
        </additional_messages>
        <cpi_value>▒#▒</cpi_value>
        <response_code>00</response_code>
        <response_message>Transaction Approved</response_message>
        <transaction_id>3900900018894635</transaction_id>
      </screening_response>
    </action_response>
  </Risk>
  <acquirer>Swedbank Baltic Latvia</acquirer>
  <datacash_reference>3900900018894635</datacash_reference>
  <extended_response_message>Approved, OK</extended_response_message>
  <extended_status>000</extended_status>
  <merchantreference>3900900018894635</merchantreference>
  <mid>1000000000</mid>
  <mode>LIVE</mode>
  <status>1</status>
</Response>

But this time the error is: PCDATA invalid Char value 28 in (line: 34, column: 23)

As you can see there are weird characters inside this XML:

<cpi_value>▒#▒</cpi_value>
lkallas commented 7 years ago

Found a solution.

No XML errors when using ScreeningAction::postAuthorization() while calling HCC authorization() function. The error persists when using ScreeningAction::preAuthorization().

Please comment what is ScreeningAction and what is the difference between pre and post.

Swedbank-SPP commented 7 years ago

Hi Ikallas,

Making proper HCC example for you. From it will be clear how it works.