SDK .Net subscription cancel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
First, let me complain about Paypal integration.
The .NET NuGet packages are partial or obsolete in particular for the subscription/recurring payment. And it's quite the same for the other languages.
For a firm that got more than 400Millons € of net profit last year, it's quite disappointing...
So back to the problem. I use the last .net package
And completed it with my custom requests to manage subscriptions .
I manage to create and read plans. Same for subscriptions. But now, I want to cancel the subscription and I've got his error **The server does not support the request payload's media type.**
here my code:
public class SubscriptionCancelRequest : HttpRequest
{
public SubscriptionCancelRequest(string subscriptionId)
: base("/v1/billing/subscriptions/{subscriptionId}/cancel", HttpMethod.Post)
{
try
{
this.Path = this.Path.Replace("{subscriptionId}", Uri.EscapeDataString(Convert.ToString(subscriptionId)));
}
catch (IOException) { }
ContentType = "application/json";
}
}
In my service :
var requestCancel = new SubscriptionCancelRequest(paypalSubId);
var responseCancel = await _paypalClient.Execute(requestCancel); //_paypalClient is PayPalHttpClient for pkg
Can you tell me what I'm doing wrong?
Thx.
**EDIT**
I try :
public SubscriptionCancelRequest(string subscriptionId)
: base("/v1/billing/subscriptions/{subscriptionId}/cancel", HttpMethod.Post, typeof(void))
or change the contenttype without better result.
ContentType = "application/x-www-form-urlencoded";
- Labels:
-
REST SDK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I post the solution here:
https://stackoverflow.com/questions/62996879/paypal-api-net-cancel-subscription
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- can we assign a unique detail to every subscription creation? in NVP/SOAP APIs
- I want to implement subscription functionality. in REST APIs
- I need to integrate a recurring payment with a variable for a pay-as-you-go product in REST APIs
- Subscription notifications in PayPal Reporting
- Mandatory Account Creation Hindering Customer Experience in REST APIs