Closed Adekoreday closed 4 years ago
Hello @Adekoreday,
Trust your compilers are cooperating!
Have you try using the request dto TransactionInitializeRequest
, viz:
var response = _api.Initialize(new TransactionInitializeRequest {
Email = "test@email.com",
AmountInKobo = 45000, // This is for N450.00k
CallbackUrl = "https://callback.domain.net/processor/path"
});
That would allow you to set all properties missing in the short-version of the Initialize(...)
method.
Hope that helps.
- Foluso.
I'm closing this issue, for now.
Kindly re-open if there is any comment/reservation on the suggestion provided, to get this issue resolved.
Regards,
- Foluso
Thanks for your response.
I have already done this since there are two overloads of the Initialize
method in the TransactionApi.cs class.
Just curious, is there a reason why you didn't include the callback url in the shorter version of initialize
Hello @Adekoreday,
Paystack makes it possible for a developer to set a global CallbackUrl from the Settings section on the account dashboard. As such, specifying a different CallbackUrl when initializing new transactions is optional, and only necessary when the global value is to be overwritten.
Since the shorter version of _api.Initialize(...)
is meant to help the very basic usage of initialize endpoint, the CallbackUrl
was omitted.
Hope this helps.
Regards.
- Foluso
Nice, thanks. it does.
TransactionInitializeResponse Initialize(string email, int amount);
out of the box. should support the optional callback URL. this is very important to allow users to get redirected to their platform after payment is made via PayStack.Also, documentation should clearly state that the amount is in kobo.
could fix this with a PR though if you find it worthy.