-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a22cadf
commit e6edc6f
Showing
10 changed files
with
2,951 additions
and
1,999 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
|
||
Environment.configure("my-domain-test","test_YkiZnDgc1MWyjlWRNBJgHsKCRSSB8cuDlS"); | ||
Result result = Customer.create() | ||
.id("acme-east") | ||
.company("Acme Eastern") | ||
.autoCollection(on) | ||
.cardNumber(4111111111111111) | ||
.cardCvv(100) | ||
.cardExpiryMonth(12) | ||
.cardExpiryYear(2022) | ||
.request(); | ||
Customer customer = result.customer(); | ||
Card card = result.card(); | ||
|
||
|
||
|
||
Result result = ItemFamily.create() | ||
.id("cloud-storage") | ||
.name("Cloud Storage") | ||
.request(); | ||
ItemFamily itemFamily = result.itemFamily(); | ||
|
||
|
||
|
||
Result result = Item.create() | ||
.id("silver-plan") | ||
.name("Silver Plan") | ||
.type(Type.PLAN) | ||
.itemFamilyId("cloud-storage") | ||
.request(); | ||
Item item = result.item(); | ||
|
||
|
||
|
||
Result result = ItemPrice.create() | ||
.id("silver-plan-USD-monthly") | ||
.itemId("silver-plan") | ||
.name("Silver USD monthly") | ||
.pricingModel(PricingModel.PER_UNIT) | ||
.price(50000) | ||
.externalName("Silver USD") | ||
.periodUnit(PeriodUnit.MONTH) | ||
.period(1) | ||
.request(); | ||
ItemPrice itemPrice = result.itemPrice(); | ||
|
||
|
||
|
||
Result result = Subscription.createWithItems("acme-east") | ||
.subscriptionItemItemPriceId(0,"silver-plan-USD-monthly") | ||
.subscriptionItemQuantity(0,4) | ||
.request(); | ||
Subscription subscription = result.subscription(); | ||
Customer customer = result.customer(); | ||
Card card = result.card(); | ||
Invoice invoice = result.invoice(); | ||
List<UnbilledCharge> unbilledCharges = result.unbilledCharges(); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
<dependency> | ||
<groupId>com.chargebee</groupId> | ||
<artifactId>chargebee-java</artifactId> | ||
<version>LATEST</version> | ||
</dependency> | ||
|
||
|
||
|
||
|
||
implementation group: 'com.chargebee', name: 'chargebee-java', version: '{VERSION}' | ||
|
||
|
||
|
||
Environment.configure("acmedoeswell-test","test_TsxhAdSxyvZ2Axio9YEj8rq24URhVkl3"); | ||
Result result = Customer.create() | ||
.id("acme-east") | ||
.company("Acme Eastern") | ||
.autoCollection(on) | ||
.cardNumber(4111111111111111) | ||
.cardCvv(100) | ||
.cardExpiryMonth(12) | ||
.cardExpiryYear(2022) | ||
.request(); | ||
Customer customer = result.customer(); | ||
Card card = result.card(); |
Oops, something went wrong.