cekat-event-sdk 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f9238be53f82b0d930ef3504555edaac544bf5743094a78cbcea5d8c470f4a6
4
- data.tar.gz: 6f7f015e3391ad9782cfd0067208a5eda7250b19b030be4e5d67ef5b309cd124
3
+ metadata.gz: 216d35febf471ce3c9d0f66cff1b59cc016d960557d72446c9882e23ed4fb8b3
4
+ data.tar.gz: 1ca66c6aaa916f9b572b550fdc9eb3e24aec4df9320eb3176f40c56168bbbb34
5
5
  SHA512:
6
- metadata.gz: 457d2f820006ad24fb3fd5420765dd4b16d96d3970051cddcb278268d70c240290ceeba17e8b9dfa08d7df36adf2e63e4457f9e97a153f0469a130d5cb0b0e95
7
- data.tar.gz: afd34ab171c2eec29a7e312360dee784108feeac0617e9c63628ced136b83914f6e063afd046201c80ecebe9cfc08035c32796998534d5430822a9020e27ed81
6
+ metadata.gz: a61223263d0b5a16af69e7ffd7c8e28e45bdb3ba1557a7d3ffa7968d21ecd5e6d01ebd27936c6f6ac4c897d7b7840ee960d9e107231f478a4f6397dc1d31e41b
7
+ data.tar.gz: d675e81282c6f01751937ca88f84592a7bb4306f310b74c15adbec36ac072a7ab83aa22baf9c2437c562c6d230f1cdc0079bba8d23f5223fafd8431f50a45901
data/README.md CHANGED
@@ -19,13 +19,13 @@ CEKAT = CekatEventSdk::Client.new(access_token: ENV.fetch("CEKAT_ACCESS_TOKEN"))
19
19
 
20
20
  CEKAT.user_registration(email: "person@example.com", contact_name: "Person")
21
21
  CEKAT.user_login(phone_number: "+628123456789")
22
- CEKAT.order_created(email: "person@example.com", properties: { order_id: "o-1" })
22
+ CEKAT.order_created(email: "person@example.com", properties: { order_id: "o-1" }, amount: 125_000, currency: "IDR")
23
23
  CEKAT.form_submitted(email: "person@example.com", properties: { form_id: "contact" })
24
24
  CEKAT.order_paid(email: "person@example.com", properties: { order_id: "o-1" }, amount: 125_000, currency: "IDR")
25
25
  ack = CEKAT.custom_event("wishlist_updated", email: "person@example.com")
26
26
  ```
27
27
 
28
- `form_submitted` sends the common `form_submitted` event (`is_common: true`). Every event method also accepts a `CekatEventSdk::EventInput` or a Hash instead of keyword attributes. `order_paid` additionally requires a finite `amount:` (Integer, Float, BigDecimal, or Rational) and a nonblank `currency:`, sent as the `amount` and `currency` properties; do not also put those keys in `properties`.
28
+ `form_submitted` sends the common `form_submitted` event (`is_common: true`). Every event method also accepts a `CekatEventSdk::EventInput` or a Hash instead of keyword attributes. `order_created` and `order_paid` require a finite `amount:` (Integer, Float, BigDecimal, or Rational) and a nonblank `currency:`, sent as the `amount` and `currency` properties; do not also put those keys in `properties`. They differ only in their event key.
29
29
 
30
30
  An `Acknowledgement` means Cekat accepted the event for **asynchronous processing**. It does not confirm durable storage, identity resolution, delivery completion, or analytics availability.
31
31
 
@@ -145,7 +145,7 @@ The Net::HTTP transport opens a fresh connection per attempt, never follows redi
145
145
  bundle install
146
146
  bundle exec rake # core, Rack, and Rails specs plus RuboCop
147
147
  RAILS_VERSION="~> 8.0.0" RACK_VERSION="~> 2.2" bundle update && bundle exec rake spec
148
- ./scripts/package --version 0.3.0 --output /absolute/empty-directory
148
+ ./scripts/package --version 0.4.0 --output /absolute/empty-directory
149
149
  ```
150
150
 
151
151
  `scripts/package` runs the specs, RuboCop, and `bundle-audit`, then builds the gem and a SHA-256 `manifest.json`. It never pushes, signs, or tags; releases to RubyGems run from the repository's `release-ruby.yml` workflow when a `ruby/vX.Y.Z` tag is pushed. `scripts/conformance` runs the shared conformance fixtures (see `conformance/README.md`); the three caller-cancellation cases are reported as `not_applicable` for Ruby.
@@ -44,8 +44,9 @@ module CekatEventSdk
44
44
  track("user_login", true, event_from(event, attributes))
45
45
  end
46
46
 
47
- def order_created(event = nil, **attributes)
48
- track("order_created", true, event_from(event, attributes))
47
+ # Uses the same required amount/currency properties and validation as order_paid.
48
+ def order_created(event = nil, amount:, currency:, **attributes)
49
+ track("order_created", true, PayloadBuilder.with_order_paid_properties(amount, currency, event_from(event, attributes)))
49
50
  end
50
51
 
51
52
  def form_submitted(event = nil, **attributes)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CekatEventSdk
4
- VERSION = "0.3.0"
4
+ VERSION = "0.4.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cekat-event-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cekat