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 +4 -4
- data/README.md +3 -3
- data/lib/cekat_event_sdk/client.rb +3 -2
- data/lib/cekat_event_sdk/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 216d35febf471ce3c9d0f66cff1b59cc016d960557d72446c9882e23ed4fb8b3
|
|
4
|
+
data.tar.gz: 1ca66c6aaa916f9b572b550fdc9eb3e24aec4df9320eb3176f40c56168bbbb34
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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`
|
|
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.
|
|
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
|
-
|
|
48
|
-
|
|
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)
|