public class RecurlyClient extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
FETCH_RESOURCE |
static String |
RECURLY_DEBUG_KEY |
static String |
RECURLY_PAGE_SIZE_KEY |
| Constructor and Description |
|---|
RecurlyClient(String apiKey) |
RecurlyClient(String apiKey,
String host,
int port,
String version) |
| Modifier and Type | Method and Description |
|---|---|
Subscription |
cancelSubscription(Subscription subscription)
Cancel a subscription
Cancel a subscription so it remains active and then expires at the end of the current bill cycle.
|
void |
clearBillingInfo(String accountCode)
Clear an account's billing info
You may remove any stored billing information for an account.
|
void |
close()
Close the underlying http client
|
void |
closeAccount(String accountCode)
Close Account
Marks an account as closed and cancels any active subscriptions.
|
Account |
createAccount(Account account)
Create Account
Creates a new account.
|
Adjustment |
createAccountAdjustment(String accountCode,
Adjustment adjustment) |
Coupon |
createCoupon(Coupon coupon)
Create a
Coupon
|
BillingInfo |
createOrUpdateBillingInfo(BillingInfo billingInfo)
Update an account's billing info
When new or updated credit card information is updated, the billing information is only saved if the credit card
is valid.
|
Plan |
createPlan(Plan plan)
Create a Plan's info
|
AddOn |
createPlanAddOn(String planCode,
AddOn addOn)
Create an AddOn to a Plan
|
Subscription |
createSubscription(Subscription subscription)
Create a subscription
Creates a subscription for an account.
|
Transaction |
createTransaction(Transaction trans)
Creates a
Transaction through the Recurly API. |
void |
deleteAccountAdjustment(String accountCode) |
void |
deleteAddOn(String planCode,
String addOnCode)
Deletes a
AddOn for a Plan
|
void |
deleteCoupon(String couponCode)
Delete a
Coupon
|
void |
deleteCouponRedemption(String accountCode)
Deletes a coupon from an account.
|
void |
deletePlan(String planCode)
Deletes a
Plan
|
<T> T |
doGETWithFullURL(Class<T> clazz,
String url) |
BillingInfo |
fetchBillingInfo(String recurlyToken)
Fetch BillingInfo
Returns billing info from a recurly.js token.
|
Invoice |
fetchInvoice(String recurlyToken)
Fetch Invoice
Returns invoice from a recurly.js token.
|
Subscription |
fetchSubscription(String recurlyToken)
Fetch Subscription
Returns subscription from a recurly.js token.
|
Account |
getAccount(String accountCode)
Get Account
Returns information about a single account.
|
Adjustments |
getAccountAdjustments(String accountCode,
Adjustments.AdjustmentType type) |
Adjustments |
getAccountAdjustments(String accountCode,
Adjustments.AdjustmentType type,
Adjustments.AdjustmentState state) |
Invoices |
getAccountInvoices(String accountCode)
Lookup an account's invoices
Returns the account's invoices
|
Accounts |
getAccounts()
Get Accounts
Returns information about all accounts.
|
Subscriptions |
getAccountSubscriptions(String accountCode)
Get the subscriptions for an
Account. |
Subscriptions |
getAccountSubscriptions(String accountCode,
String status)
Get the subscriptions for an account.
|
Transactions |
getAccountTransactions(String accountCode)
Lookup an account's transactions history
Returns the account's transaction history
|
AddOn |
getAddOn(String planCode,
String addOnCode)
Get an AddOn's details
|
AddOns |
getAddOns(String planCode)
|
BillingInfo |
getBillingInfo(String accountCode)
Lookup an account's billing info
Returns only the account's current billing information.
|
Coupon |
getCoupon(String couponCode)
Get a Coupon
|
Redemption |
getCouponRedemptionByAccount(String accountCode)
Lookup a coupon redemption on an invoice.
|
Redemption |
getCouponRedemptionByInvoice(Integer invoiceNumber)
Lookup a coupon redemption on an invoice.
|
Coupons |
getCoupons() |
static Integer |
getPageSize()
Returns the page Size to use when querying.
|
static String |
getPageSizeGetParam() |
Plan |
getPlan(String planCode)
Get a Plan's details
|
Plans |
getPlans()
Return all the plans
|
Subscription |
getSubscription(String uuid)
Get a particular
Subscription by it's UUID
Returns information about a single account. |
Transaction |
getTransaction(String transactionId)
Lookup a transaction
|
void |
open()
Open the underlying http client
|
Subscription |
reactivateSubscription(Subscription subscription)
Reactivating a canceled subscription
Reactivate a canceled subscription so it renews at the end of the current bill cycle.
|
Redemption |
redeemCoupon(String couponCode,
Redemption redemption)
Redeem a
Coupon on an account. |
void |
refundTransaction(String transactionId,
BigDecimal amount)
Refund a transaction
|
void |
terminateSubscription(Subscription subscription,
RefundOption refund)
Terminate a particular
Subscription by it's UUID |
Account |
updateAccount(String accountCode,
Account account)
Update Account
Updates an existing account.
|
Subscription |
updateSubscription(String uuid,
SubscriptionUpdate subscriptionUpdate)
Update a particular
Subscription by it's UUID
Returns information about a single account. |
public static final String RECURLY_DEBUG_KEY
public static final String RECURLY_PAGE_SIZE_KEY
public static final String FETCH_RESOURCE
public RecurlyClient(String apiKey)
public RecurlyClient(String apiKey, String host, int port, String version)
public static Integer getPageSize()
public static String getPageSizeGetParam()
public void open()
public void close()
public Account createAccount(Account account)
account - account objectpublic Accounts getAccounts()
public Coupons getCoupons()
public Account getAccount(String accountCode)
accountCode - recurly account idpublic Account updateAccount(String accountCode, Account account)
accountCode - recurly account idaccount - account objectpublic void closeAccount(String accountCode)
accountCode - recurly account idpublic Adjustments getAccountAdjustments(String accountCode, Adjustments.AdjustmentType type)
public Adjustments getAccountAdjustments(String accountCode, Adjustments.AdjustmentType type, Adjustments.AdjustmentState state)
public Adjustment createAccountAdjustment(String accountCode, Adjustment adjustment)
public void deleteAccountAdjustment(String accountCode)
public Subscription createSubscription(Subscription subscription)
subscription - Subscription objectpublic Subscription getSubscription(String uuid)
Subscription by it's UUID
Returns information about a single account.uuid - UUID of the subscription to lookuppublic Subscription cancelSubscription(Subscription subscription)
subscription - Subscription objectpublic void terminateSubscription(Subscription subscription, RefundOption refund)
Subscription by it's UUIDsubscription - Subscription to terminatepublic Subscription reactivateSubscription(Subscription subscription)
subscription - Subscription objectpublic Subscription updateSubscription(String uuid, SubscriptionUpdate subscriptionUpdate)
Subscription by it's UUID
Returns information about a single account.uuid - UUID of the subscription to updatepublic Subscriptions getAccountSubscriptions(String accountCode)
accountCode - recurly account idpublic Subscriptions getAccountSubscriptions(String accountCode, String status)
accountCode - recurly account idstatus - Only accounts in this status will be returnedpublic BillingInfo createOrUpdateBillingInfo(BillingInfo billingInfo)
billingInfo - billing info object to create or updatepublic BillingInfo getBillingInfo(String accountCode)
accountCode - recurly account idpublic void clearBillingInfo(String accountCode)
accountCode - recurly account idpublic Transactions getAccountTransactions(String accountCode)
accountCode - recurly account idpublic Transaction getTransaction(String transactionId)
transactionId - recurly transaction idpublic Transaction createTransaction(Transaction trans)
Transaction through the Recurly API.trans - The Transaction to createTransaction objectpublic void refundTransaction(String transactionId, @Nullable BigDecimal amount)
transactionId - recurly transaction idamount - amount to refund, null for full refundpublic Invoices getAccountInvoices(String accountCode)
accountCode - recurly account idpublic Plan createPlan(Plan plan)
plan - The plan to create on recurlypublic Plan getPlan(String planCode)
planCode - recurly id of planpublic Plans getPlans()
public void deletePlan(String planCode)
Plan
planCode - The Plan object to delete.public AddOn createPlanAddOn(String planCode, AddOn addOn)
public AddOns getAddOns(String planCode)
AddOn objects as identified by the passed plan IDpublic void deleteAddOn(String planCode, String addOnCode)
AddOn for a Plan
public Coupon createCoupon(Coupon coupon)
Coupon
coupon - The coupon to create on recurlyCoupon objectpublic void deleteCoupon(String couponCode)
Coupon
couponCode - The code for the Couponpublic Redemption redeemCoupon(String couponCode, Redemption redemption)
Coupon on an account.couponCode - redeemed coupon idCoupon objectpublic Redemption getCouponRedemptionByAccount(String accountCode)
accountCode - recurly account idpublic Redemption getCouponRedemptionByInvoice(Integer invoiceNumber)
invoiceNumber - invoice numberpublic void deleteCouponRedemption(String accountCode)
accountCode - recurly account idpublic Subscription fetchSubscription(String recurlyToken)
recurlyToken - token given by recurly.jspublic BillingInfo fetchBillingInfo(String recurlyToken)
recurlyToken - token given by recurly.jspublic Invoice fetchInvoice(String recurlyToken)
recurlyToken - token given by recurly.jspublic <T> T doGETWithFullURL(Class<T> clazz, String url)
Copyright © 2012-2014. All Rights Reserved.