Janneman96
Janneman96

Reputation: 505

How do I get the payment status from the BuckarooSdk?

I'm trying to get the payment status of a payment. I've got the code below:

public bool HasBeenPayed(string transactionKey)
{
    var logger = new CustomLogger();
    var client = new SdkClient(() => logger);
    var request = client.CreateRequest().
        Authenticate(
            _websiteKey,
            _apiKey,
            _isLive,
            CultureInfo.GetCultureInfo("nl-nl"),
            BuckarooSdk.DataTypes.ChannelEnum.Web).
        TransactionStatusRequest().
        Status(transactionKey);

    var status = request.GetSingleStatus();
    var statusCode = status.Status.Code.Code;

    return statusCode == BuckarooSdk.Constants.Status.Success;
}

When I execute this, it freezes on executing request.GetSingleStatus();. It does not continue to the next line. The last thing logged in the custom CustomLogger is:

The serialized request in JSON format is: null

The documentation is limited, so I haven't found the answer there. There are not many Buckaroo posts on Stack Overflow either.

How do I get the status of a Buckaroo payment using the BuckarooSdk?

Upvotes: 0

Views: 198

Answers (0)

Related Questions