Gem Version Analytics

Clt SDK

API client for President Collect Service.

Installation

Add this line to your application's Gemfile:

gem "clt-sdk"

And then execute:

$ bundle

Or install it yourself as:

$ gem install clt-sdk

Usage

Initialize

require "clt-sdk"

Clt.setup do |config|
  config.cvs_cust_id = "CVS_CUST_ID"
  config.cvs_cust_password = "CVS_CUST_PASSWORD"
  config.cvs_default_expire_day = 1
  config.cocs_link_id = "COCS_LINK_ID"
  config.cocs_hash_base = "COCS_HASH_BASE"
end

cvs_default_expire_day: Optional. ibon code will expired after this day (Default: 1)

Example

  • ibon
  cvs_client = Clt::Cvs.new

#### Order Create

  result = cvs_client.order_create(
    service_url: "SERVICE_URL",
    cust_order_number: "TESTORDER000001",
    order_amount: 100,
    payer_mobile: "0987654321",
    payer_email: "[email protected]"
  )

Optional parameters: expire_date, payer_name, payer_postcode, payer_address

expired_date will overwrite cvs_default_expire_day setting.

#### Order Query

  result = cvs_client.order_query(
    service_url: "SERVICE_URL",
    process_code_update_time_begin: "2016-08-08T00:00:00+08:00",
    process_code_update_time_end: "2016-08-08T23:59:59+08:00"
  )
  • Credit Card
  cocs_client = Clt::CreditCard.new

chk will be automatically generated by default.

#### Order Create

  result = cocs_client.order_create(
    service_url: "SERVICE_URL",
    cust_order_no: "TESTORDER000001",
    order_amount: 100,
    order_detail: "Order Test"
  )

Optional parameters: cust_order_no, limit_product_id, chk

cust_order_no will be automatically generated if empty.

#### Order Cancel

  result = cocs_client.order_cancel(
    service_url: "SERVICE_URL",
    cust_order_no: "TESTORDER000001",
    order_amount: 100
  )

Optional parameters: chk

#### Order Refund

  result = cocs_client.order_refund(
    service_url: "SERVICE_URL",
    cust_order_no: "TESTORDER000001",
    order_amount: 100,
    refund_amount: 100
  )

Optional parameters: chk

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/CalvertYang/clt-sdk.

License

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