Mercurial Hosting > luan
changeset 728:11839152caef
remove stripe
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 10 Jun 2016 14:58:46 -0600 |
parents | d6a191618c60 |
children | 4ce68aad92b7 |
files | scripts/build-luan.sh stripe/ext/gson-2.2.4.jar stripe/ext/stripe-java-1.27.0.jar stripe/src/luan/modules/stripe/Stripe.luan |
diffstat | 4 files changed, 0 insertions(+), 84 deletions(-) [+] |
line wrap: on
line diff
diff -r d6a191618c60 -r 11839152caef scripts/build-luan.sh --- a/scripts/build-luan.sh Fri Jun 10 14:55:26 2016 -0600 +++ b/scripts/build-luan.sh Fri Jun 10 14:58:46 2016 -0600 @@ -59,12 +59,6 @@ jar cvf $LUAN_BUILD/luan/jars/luan-lucene-$VERSION.jar `find . -name *.class -o -name *.luan` cp $LUAN_HOME/lucene/ext/* $LUAN_BUILD/luan/jars -cd $LUAN_HOME -SRC=stripe/src -cd $SRC -jar cvf $LUAN_BUILD/luan/jars/luan-stripe-$VERSION.jar `find . -name *.luan` -cp $LUAN_HOME/stripe/ext/* $LUAN_BUILD/luan/jars - cp $LUAN_HOME/scripts/install.sh $LUAN_BUILD/luan chmod +x $LUAN_BUILD/luan/install.sh cp $LUAN_HOME/scripts/uninstall.sh $LUAN_BUILD/luan
diff -r d6a191618c60 -r 11839152caef stripe/ext/gson-2.2.4.jar Binary file stripe/ext/gson-2.2.4.jar has changed
diff -r d6a191618c60 -r 11839152caef stripe/ext/stripe-java-1.27.0.jar Binary file stripe/ext/stripe-java-1.27.0.jar has changed
diff -r d6a191618c60 -r 11839152caef stripe/src/luan/modules/stripe/Stripe.luan --- a/stripe/src/luan/modules/stripe/Stripe.luan Fri Jun 10 14:55:26 2016 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -java() -local Luan = require "luan:Luan.luan" -local error = Luan.error -local assert_integer = Luan.assert_integer -local Table = require "luan:Table.luan" -local Stripe = require "java:com.stripe.Stripe" -local Customer = require "java:com.stripe.model.Customer" -local Charge = require "java:com.stripe.model.Charge" - -local M = {} - -M.currency = "usd" - -function M.init(api_key) - Stripe.apiKey = api_key -end - - -local function customer_table(java_customer) - - local function subscription() - local list = java_customer.getSubscriptions().getData() - local size = list.size() - size <= 1 or error "more than 1 subscription" - return size == 1 and list.get(0) or nil - end - - local this = Table.new_property_table() - local meta = Luan.get_metatable(this) - - meta.get.id = java_customer.getId - - function meta.get.subscription_status() - local s = subscription() - return s and s.getStatus() - end - - function this.cancel_subscription() - local s = subscription() - s and s.cancel(nil) - end - - return this -end - - -local function charge_table(java_charge) - local this = Table.new_property_table() - local meta = Luan.get_metatable(this) - - meta.get.id = java_charge.getId - meta.get.amount = java_charge.getAmount - - return this -end - - -function M.create_customer(params) - local java_customer = Customer.create(params) - return customer_table(java_customer) -end - -function M.retrieve_customer(id) - local java_customer = Customer.retrieve(id) - return customer_table(java_customer) -end - -function M.create_charge(params) - params.amount or error "missing parameter 'amount'" - params.amount = assert_integer(params.amount) - params.currency = params.currency or M.currency - local java_charge = Charge.create(params) - return charge_table(java_charge) -end - -return M - --- http://javadox.com/com.stripe/stripe-java/1.2.1/overview-summary.html