Skip to content

Create SubscriptionDataRequest #84

@Almightywesley

Description

@Almightywesley

Unable to Create SubscriptionDataRequest Outside Buckaroo SDK

Issue

Currently, it is not possible to instantiate SubscriptionDataRequest from outside the Buckaroo SDK, making it difficult for programmers to create subscriptions.

Proposed Solution

To enable subscription creation, adding the following method to the ConfiguredDataRequest class would be beneficial:

public SubscriptionDataRequest Subscription()
{
    return new SubscriptionDataRequest(this);
}

Expected Usage

With this change, users will be able to create subscriptions as follows:

var buckarooRequest  = buckarooClient.CreateRequest()
                .Authenticate(WebsiteKey, SecretKey, isLive, culture)
                .DataRequest()
                .SetBasicFields(new DataBase { OriginalTransactionKey = transactionId })
                .Subscription()
                .CreateSubscription(subscriptionCreateRequest);
var result = await buckarooRequest.ExecuteAsync();

This enhancement would align SubscriptionDataRequest with other request types in the SDK, improving usability and consistency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions