-1

I'm integrating card payments into a web portal using SagePay UK's Server protocol.

I'd like to know when the transaction has been settled with the bank, so that update the status in the backend. I've looked in MySagePay on the test environment and all our transactions say "Settlement Info: This transaction has not been settled."

Is there a way I can access this settlement info through the Reporting and Admin API? Perhaps one of the fields on either getTransactionDetail or getBatchDetail contain this information - but I can't tell from reading the documentation.

2 Answers2

0

You won't be able to test settlement on the test server - it is a dummy system, hence the settlement processes required to populate the batchid aren't run.

In the live situation, you have two options:

You can use getBatchList to determine which batches of transactions have been sent for settlement (and reported back as settled), then use getBatchDetail to determine which transactions were settled in that batch.

Or you can use getTransactionDetail to establish if there is a batchid for the specific transaction you wish to check.

Rik Blacow
  • 1,139
  • 1
  • 7
  • 12
0

The getTransactionDetail endpoint returns a lot of transaction data, including the status, on the basis of the transaction-code.

You can use this NuGet package to call, for example, the getTransactionDetail endpoint:

https://www.nuget.org/packages/Joe.Opayo.Admin.Api.Client/1.1.0

The client app allows code like this:

var client = new OpayoAdminApiClient();
var isTest = true;
var request = new OpayoApiRequest(ApiCommandType.GetTransactionDetail, "password", isTest, "user-name", "vendor-name");
var commandSpecificXml = "<vendortxcode>01Jan2010Transaction12345</vendortxcode>"; 
return await client.ProcessApiCommandAsync<TransactionDetail>(request, commandSpecificXml);
Joe Ratzer
  • 18,176
  • 3
  • 37
  • 51