Retrieve transaction details
Once a paymentId (id) has been generated, you can retrieve transaction details at any stage of your payment processing.
Before you start
Before you start retrieving transatction details, you must have initialized the transaction.
Retrieve transaction details
To retrieve transaction details, you use the Payment Services API.
TAP Payment services base url (testing):
https://naa-payment-service-dgw-t.paas-test.bbsas.no
The endpoint for the retrieve transaction details call contains the paymentId (id).
/ms/aapay/v2/transaction/{id}/status
Apart from that, only your access token must be added as a header parameter.
The Retrieve transaction details call should be sent at least 2 seconds after the Initialize a transaction call to get a valid response. Please make sure to allow 2 seconds before repeating the request, if necessary.
Response - Retrieve transaction details
Below is an example for the retrieve transaction detail's response:
Response - Retrieve transaction details
{ "valid":true, "error":null, "response":null,
Verify the success of the transaction request
In the above example, the state
parameter is set to FINALIZED
and the accountState
parameter is set to COMMIT
. That means that the transaction request was successful.
Find a list of all possible values for state
in our API Reference
The diagram below shows the possible order of state
responses.
Verify the state of the transaction
In order to verify whether or not the payment was successful, you should check the respCode
value of the receipt
object.
In our example the respCode
value is PAID
, so the actual payment has been successful.
The values for the respCode
varies according to the third party payment service provider. Please fine a list of possible values below.
PSP | PURCHASE | REFUND | REVERSAL |
---|---|---|---|
SWISH | PAID, DECLINED, ERROR, CANCELLED | PAID, ERROR | PAID, DECLINED |
KLARNA | PAID, DECLINED | PAID, DECLINED | PAID, DECLINED |
SANTANDER | STATUS_ACCEPTED, REJECTED | PAID, DECLINED | PAID, DECLINED |
EASY | RESERVED | PAID, DECLINED | PAID, DECLINED |