Viincenttt / MollieApi

This project allows you to easily add the Mollie payment provider to your application.
MIT License
148 stars 85 forks source link

Subscription API: Reference to a non-shared member requires an object reference. #262

Closed neo1992 closed 2 years ago

neo1992 commented 2 years ago

I have this code, but I get this design time error on line Dim subscriptionResponse As Mollie.Api.Models.Subscription.SubscriptionResponse = Await Mollie.Api.Client.SubscriptionClient.CreateSubscriptionAsync("{customerId}", subscriptionRequest)

Reference to a non-shared member requires an object reference.

Protected Async Sub StartPayment()
    Dim mollieCurrency As String = "EUR"
    mollieCurrency = Mollie.Api.Models.Currency.EUR

    Dim subscriptionClient As Mollie.Api.Client.Abstract.ISubscriptionClient = New Mollie.Api.Client.SubscriptionClient(ConfigurationManager.AppSettings("mollie_api_testkey"))

    Dim subscriptionRequest As Mollie.Api.Models.Subscription.SubscriptionRequest = New Mollie.Api.Models.Subscription.SubscriptionRequest() With {
    .Amount = New Mollie.Api.Models.Amount(mollieCurrency, "5.00"),
    .Interval = "1 month",
    .Description = "{uniqueIdentifierForSubscription}"
}
    Dim subscriptionResponse As Mollie.Api.Models.Subscription.SubscriptionResponse = Await Mollie.Api.Client.SubscriptionClient.CreateSubscriptionAsync("{customerId}", subscriptionRequest)

End Sub
Viincenttt commented 2 years ago

I'm glad the issue is resolved. I was afraid I would have to install the VB.NET development tools ;)

neo1992 commented 2 years ago

LOL. I'm sorry to do this to you, struggling through this myself too :) Also I'm not sure if you want me to open these questions here or rather on Stackoverflow. But I have another one that relates to the customer API: https://github.com/Viincenttt/MollieApi/issues/263