Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Payment refunds and cancellations

Skip to contents in this page

Table of Contents

Request examples (HTTP POST)

Full refund:

Code Block
languagejava
<form method="post" action="https://test1.maksuturva.fi/PaymentCancel.pmt">
    <input type="hidden" name="pmtc_action"            value="CANCEL" />
    <input type="hidden" name="pmtc_version"           value="0005" />
    <input type="hidden" name="pmtc_sellerid"          value="ABC123DE" />
    <input type="hidden" name="pmtc_id"                value="1998524_1" />
    <input type="hidden" name="pmtc_amount"            value="568,10" />
    <input type="hidden" name="pmtc_currency"          value="EUR" />
    <input type="hidden" name="pmtc_canceltype"        value="FULL_REFUND" />
    <input type="hidden" name="pmtc_canceldescription" value="Valitettavasti tuotteet olivat päässeet loppumaan varastosta." />
    <input type="hidden" name="pmtc_cancelreason"      value="OUTOF" />
    <input type="hidden" name="pmtc_resptype"          value="XML" />
    <input type="hidden" name="pmtc_hashversion"       value="SHA-256" />
    <input type="hidden" name="pmtc_hash"              value="C1F6CBA732E925C15E7B42238ED4FEA31DAA54BE53BE6A09748DF4F8EAC94269" />
    <input type="hidden" name="pmtc_keygeneration"     value="1" />
    <input type="submit" value="Lähetä peruutussanoma" />                                           
</form>

Partial refund of 123,00 € and return of deliveries:

Code Block
languagejava
<form method="post" action="https://test1.maksuturva.fi/PaymentCancel.pmt">
    <input type="hidden" name="pmtc_action"            value="CANCEL" />
    <input type="hidden" name="pmtc_version"           value="0005" />
    <input type="hidden" name="pmtc_sellerid"          value="ABC123DE" />
    <input type="hidden" name="pmtc_id"                value="1998524_1" />
    <input type="hidden" name="pmtc_amount"            value="568,10" />
    <input type="hidden" name="pmtc_currency"          value="EUR" />
    <input type="hidden" name="pmtc_canceltype"        value="PARTIAL_REFUND_AND_RETURN_OF_DELIVERIES" />
    <input type="hidden" name="pmtc_cancelamount"      value="123,00" />
    <input type="hidden" name="pmtc_canceldescription" value="Ostaja palauttaa toisen tilaamistaan tuote A:sta" />
    <input type="hidden" name="pmtc_cancelreason"      value="DEFEC" />
    <input type="hidden" name="pmtc_resptype"          value="XML" />
    <input type="hidden" name="pmtc_hashversion"       value="SHA-256" />
    <input type="hidden" name="pmtc_hash"              value="E6495B9E0C05BE827F5BE97FA371193B793F59B4F2A4068165BD4DAEBA96E6F7" />
    <input type="hidden" name="pmtc_keygeneration"     value="1" />
    <input type="submit" value="Lähetä peruutussanoma" />                                           
</form>

XML Response examples (HTTP RESPONSE)

OK Response:

Code Block
languagexml
<pmtc>
    <pmtc_action>CANCEL</pmtc_action>
    <pmtc_version>0005</pmtc_version>
    <pmtc_sellerid>ABC123DE</pmtc_sellerid>
    <pmtc_id>1998524_1</pmtc_id>
    <pmtc_returncode>00</pmtc_returncode>
    <pmtc_returntext>Cancel received succesfully</pmtc_returntext>
    <pmtc_hash>E8343D1E9995854BA4A13BE5B6FB4E4DD61A362BE682336CA7A10145BC77FFEC</pmtc_hash>
</pmtc>

Error response:

(missing pmtc_cancelamount from the request e.g. in case of a partial refund)

Code Block
languagexml
<pmtc>
    <pmtc_action>CANCEL</pmtc_action>
    <pmtc_version>0005</pmtc_version>
    <pmtc_sellerid>ABC123DE</pmtc_sellerid>
    <pmtc_id>1998524_1</pmtc_id>
    <pmtc_returncode>90</pmtc_returncode>
    <pmtc_returntext>Errors in input data, specified in element errors</pmtc_returntext>
    <errors>
        <error name="pmtc_cancelamount" type="field">pmtc_cancelamount is invalid</error>
    </errors>
</pmtc>

Error response:

(pmtc_hash did not match the value calculated by Svea Payments)

Code Block
languagexml
<pmtc>
    <pmtc_action>CANCEL</pmtc_action>
    <pmtc_version>0005</pmtc_version>
    <pmtc_sellerid>ABC123DE</pmtc_sellerid>
    <pmtc_id>1998524_1</pmtc_id>
    <pmtc_returncode>90</pmtc_returncode>
    <pmtc_returntext>Errors in input data, specified in element errors</pmtc_returntext>
    <errors>
        <error name="pmtc_hash" type="field">pmtc_hash is invalid</error>
    </errors>
</pmtc>