Removes the currently applied discount on a subscription.
curl https://api.stripe.com/v1/subscriptions/sub_CBbgnZGMJwa9ta/discount \
-u STRIPE_SECRET_KEY: \
-X DELETE
// Important: Don't forget to include the call to System.loadLibrary
// as shown at the bottom of this code sample.
package com.test;
import android.app.Activity;
import com.chilkatsoft.*;
import android.widget.TextView;
import android.os.Bundle;
public class SimpleActivity extends Activity {
private static final String TAG = "Chilkat";
// Called when the activity is first created.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
CkRest rest = new CkRest();
boolean success;
// URL: https://api.stripe.com/v1/subscriptions/sub_CBbgnZGMJwa9ta/discount
boolean bTls = true;
int port = 443;
boolean bAutoReconnect = true;
success = rest.Connect("api.stripe.com",port,bTls,bAutoReconnect);
if (success != true) {
Log.i(TAG, "ConnectFailReason: " + String.valueOf(rest.get_ConnectFailReason()));
Log.i(TAG, rest.lastErrorText());
return;
}
rest.SetAuthBasic("STRIPE_SECRET_KEY","");
CkStringBuilder sbResponseBody = new CkStringBuilder();
success = rest.FullRequestNoBodySb("DELETE","/v1/subscriptions/sub_CBbgnZGMJwa9ta/discount",sbResponseBody);
if (success != true) {
Log.i(TAG, rest.lastErrorText());
return;
}
CkJsonObject jsonResponse = new CkJsonObject();
jsonResponse.LoadSb(sbResponseBody);
boolean deleted;
String id;
deleted = jsonResponse.BoolOf("deleted");
id = jsonResponse.stringOf("id");
}
static {
System.loadLibrary("chilkat");
// Note: If the incorrect library name is passed to System.loadLibrary,
// then you will see the following error message at application startup:
//"The application <your-application-name> has stopped unexpectedly. Please try again."
}
}
{
"deleted": true,
"id": "di_1BnETLGswQrCoh0Xe991uMc7"
}