public Account getAccount() { if (account != null && account.getCreatedAt() == null) { account = fetch(account, Account.class); } return account; }
public Invoice getInvoice() { if (invoice != null && invoice.getCreatedAt() == null) { invoice = fetch(invoice, Invoice.class); } return invoice; }
public Coupon getCoupon() { if (coupon != null && coupon.getCouponCode() == null) { coupon = fetch(coupon, Coupon.class); } return coupon; }
private void verifyPendingSubscription(final Subscription subscription) { Subscription pending = subscription.getPendingSubscription(); Assert.assertEquals(pending.getPlan().getPlanCode(), "silver"); Assert.assertEquals(pending.getPlan().getName(), "Silver plan"); Assert.assertEquals(pending.getUnitAmountInCents(), (Integer) 400); Assert.assertEquals(pending.getQuantity(), (Integer) 1); Assert.assertEquals(pending.getAddOns().size(), 0); } }
private void verifySubscriptionAddons(final Subscription subscription) { Assert.assertEquals(subscription.getAddOns().size(), 2); Assert.assertEquals(subscription.getAddOns().get(0).getAddOnCode(), "extra_users"); Assert.assertEquals(subscription.getAddOns().get(0).getQuantity(), (Integer) 2); Assert.assertEquals(subscription.getAddOns().get(0).getUnitAmountInCents(), (Integer) 1000); Assert.assertEquals(subscription.getAddOns().get(1).getAddOnCode(), "extra_ip"); Assert.assertEquals(subscription.getAddOns().get(1).getQuantity(), (Integer) 3); Assert.assertEquals(subscription.getAddOns().get(1).getUnitAmountInCents(), (Integer) 200); }
private CustomFields getTestFields() { CustomField cf = new CustomField(); cf.setName("acct_field"); cf.setValue("some account value"); CustomFields fields = new CustomFields(); fields.add(cf); return fields; }
private void verifySubscriptionCustomFields(final Subscription subscription) { Assert.assertEquals(subscription.getCustomFields().size(), 2); Assert.assertEquals(subscription.getCustomFields().get(0).getName(), "field1"); Assert.assertEquals(subscription.getCustomFields().get(0).getValue(), "one value"); Assert.assertEquals(subscription.getCustomFields().get(1).getName(), "field2"); Assert.assertEquals(subscription.getCustomFields().get(1).getValue(), "second value"); }
private void verifyPaginationData(final Subscription subscription) { // Verify nested attributes Assert.assertEquals(subscription.getAccount().getHref(), "https://api.recurly.com/v2/accounts/1"); Assert.assertEquals(subscription.getAccount().getAccountCode(), "1"); }
public AdjustmentRefund toAdjustmentRefund() { final AdjustmentRefund adjustmentRefund = new AdjustmentRefund(); adjustmentRefund.setUuid(uuid); adjustmentRefund.setQuantity(quantity); adjustmentRefund.setProrate(false); return adjustmentRefund; }
public Account getAccount() { if (account != null && account.getCreatedAt() == null) { account = fetch(account, Account.class); } return account; }
public Account getAccount() { if (account != null && account.getCreatedAt() == null) { account = fetch(account, Account.class); } return account; }
public Account getAccount() { if (account != null && account.getCreatedAt() == null) { account = fetch(account, Account.class); } return account; }
/** * Account object associated to this BillingInfo * <p> * Note: when fetching a BillingInfo object from Recurly, the account object is not guaranteed to be populated. * * @return account object */ public Account getAccount() { if (account != null && account.getCreatedAt() == null) { account = fetch(account, Account.class); } return account; }
/** * Builds a redemption request * * @param accountCode Account code to redeem * @return gift card redemption data for an account */ public static GiftCard.Redemption createRedemption(String accountCode) { Redemption redemption = new Redemption(); redemption.setAccountCode(accountCode); return redemption; }
/** * Sets the discount type for a {@link Coupon} * * @param discountType */ public void setDiscountType(final Object discountType) { this.discountType = enumOrNull(DiscountType.class, discountType); }
/** * Sets the coupon code for the {@link Coupon} * * @param couponCode The coupon code */ public void setCouponCode(final Object couponCode) { this.couponCode = stringOrNull(couponCode); }
private void verifyPendingSubscription(final Subscription subscription) { Subscription pending = subscription.getPendingSubscription(); Assert.assertEquals(pending.getPlan().getPlanCode(), "silver"); Assert.assertEquals(pending.getPlan().getName(), "Silver plan"); Assert.assertEquals(pending.getUnitAmountInCents(), (Integer) 400); Assert.assertEquals(pending.getQuantity(), (Integer) 1); Assert.assertEquals(pending.getAddOns().size(), 0); } }
private void verifySubscriptionAddons(final Subscription subscription) { Assert.assertEquals(subscription.getAddOns().size(), 2); Assert.assertEquals(subscription.getAddOns().get(0).getAddOnCode(), "extra_users"); Assert.assertEquals(subscription.getAddOns().get(0).getQuantity(), (Integer) 2); Assert.assertEquals(subscription.getAddOns().get(0).getUnitAmountInCents(), (Integer) 1000); Assert.assertEquals(subscription.getAddOns().get(1).getAddOnCode(), "extra_ip"); Assert.assertEquals(subscription.getAddOns().get(1).getQuantity(), (Integer) 3); Assert.assertEquals(subscription.getAddOns().get(1).getUnitAmountInCents(), (Integer) 200); }
private CustomFields getTestFields() { CustomField cf = new CustomField(); cf.setName("acct_field"); cf.setValue("some account value"); CustomFields fields = new CustomFields(); fields.add(cf); return fields; }
private void verifySubscriptionCustomFields(final Subscription subscription) { Assert.assertEquals(subscription.getCustomFields().size(), 2); Assert.assertEquals(subscription.getCustomFields().get(0).getName(), "field1"); Assert.assertEquals(subscription.getCustomFields().get(0).getValue(), "one value"); Assert.assertEquals(subscription.getCustomFields().get(1).getName(), "field2"); Assert.assertEquals(subscription.getCustomFields().get(1).getValue(), "second value"); }