Payment response

New Payment Response

The response data sent webstore by redirecting buyer's browser to the ok return address in cases where buyer has successfully confirmed the payment. The webstore may deliver the order immediately if wanted.

If the buyer interrupts the payment process, the buyer's browser will be redirected to the cancel return address.

If there was an error in the process, the buyer's browser will be redirected to the error return address.

These return scenarios have been briefly described already in section Payment.

NOTE: For interrupted/cancelled or erroneus payments, only querystring parameter pmt_id is appended to the response URL, and no other parameters.

Usually the pmt_sellercosts value in the response is exactly the same as the in the original new payment request. However, some payment methods make it possibly for the webstore to determine an additional invoicing fee or extra handling cost (a fixed money amount). In cases where the buyer chooses such payment method, the invoicing fee is added as a new order row to the order by Svea Payments. Also the pmt_sellercosts value is increased by the same fee amount. In these cases the response contains a pmt_sellercosts value that is greater than the original value in the request. The difference could be exactly the invoicing fee and nothing else.

Response validation

Fields that are generated by Svea Payments and submitted as part of the response, should be formally validated, as defined in the interface specification.

Hash must be calculated from the data in response and that hash must be compared with the pmt_hash field of the response. Calculated value may not differ from the one in response. The hash algorithm used for the response hash is THE SAME as was used for the corresponding payment request.

If the checks above are successful, the response can be handled as a valid one.

Skip to contents in this page

Field

Input name

Value

Format

C/O

Description

Action code

pmt_action

NEW_PAYMENT_EXTENDED

AN50

C

NEW_PAYMENT_EXTENDED

Message version

pmt_version

0004

AN4

C

Version of interface content. Same as in the input message.

Payment ID

pmt_id

AN20

C

Unique Identifying number given to the transaction by the webstore. Same as in the input message.

Reference number

pmt_reference

N20

C

Reference number given by the webstore and used when the order is settled to the seller. The reference number is in its technical format, i.e. with leading zeros, without spaces and with total length of 20 digits. The response hash is calculated with the reference number in this format. Same as in the input message.

Sum of products and services of the order

pmt_amount

AN17

C

The total gross sum of row types 1, 4, 5 and 6.
If the order does not contain any postal or handling cost rows (types 2 and 3), then this is the total amount of the order.
The amount is presented with two decimals. The decimal delimiter is a comma, e.g. 94,80

Payment currency

pmt_currency

EUR

AN3

C

Currency of the payment. Always EUR.

Sum of handling and delivery costs of the order

pmt_sellercosts

N17

C

The total gross sum of row types 2 and 3.
The amount must be presented with two decimals. The decimal delimiter is a comma, e.g. 7,40

Payment method

pmt_paymentmethod

AN4

C

Indicates what payment method the buyer chose. For available codes, see section Payment Method Codes.

Important! Please do not use the values of the table above in production. Instead, retrieve official payment method codes and names using GetPaymentMethods.pmt API (see chapter Retrieve Available Payment Methods).

Escrow is being used

pmt_escrow

Y/N

AN1

C

Tells whether escrow option is used with this payment. Values: Y/N
The value is always Y for services using Buyer’s Assistant. Correspondingly, the value is always N for Direct payment services (that do not use Buyer’s Assistant or return/refund tools). The value may be different than the value we received during the payment creation.

Hash

pmt_hash

AN128

C

Hash calculated from predefined message fields and the webstore's secret key. The following fields are used to calculate the hash:

  • pmt_action

  • pmt_version

  • pmt_id

  • pmt_reference

  • pmt_amount

  • pmt_currency

  • pmt_sellercosts

  • pmt_paymentmethod

  • pmt_escrow

For more details, see section Hash Calculation.