Project

lakala

0.0
The project is in a healthy, maintained state
Lakala gem with some basic features
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
~> 5.0
~> 13.0
~> 3.19, >= 3.19.1
 Project Readme

Lakala

Lakala Ruby client with some basic features for Lakala APIs.

Installation

Install the gem and add to the application's Gemfile by executing:

$ bundle add lakala

If bundler is not being used to manage dependencies, install the gem by executing:

$ gem install lakala

Usage

# Create order -> http://open.lakala.com/#/home/document/detail?id=283
options = {
            merchant_no: '8221210594300JY',
            out_order_no: 'aa3c56712',
            total_amount: 200,
            order_info: 'Test Product',
            order_efficient_time: '20231113163310'
          }
Lakala::Client.new.create_order(options)
# or without encryption
Lakala::Client.new.create_order(options, encryption: false)

# Query order -> http://open.lakala.com/#/home/document/detail?id=284
Lakala::Client.new.query_order(merchant_no: '8221210594300JY', out_order_no: 'aa3c56712')

# Invoke refund -> http://open.lakala.com/#/home/document/detail?id=113
Lakala::Client.new.refund(
  merchant_no: '8221210594300JY',
  geo_location: '30.700323750778548, 104.0029400018854',
  request_ip: '222.209.111.239',
  refund_amount: 1,
  term_no: 'A0073841',
  out_trade_no: 'aa3c56723123',
  origin_trade_no: '2023120866210311384863'
)

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

License

The gem is available as open source under the terms of the MIT License.