Repository navigation
feat: payments through trackEvent, capturePayment removed (5.0.0) - #45
Open
ChetanBhosale wants to merge 6 commits into
Open
ChetanBhosale wants to merge 6 commits into
ChetanBhosale wants to merge 6 commits into
Conversation
…ovePayment trackEvent takes an optional EventPayment (amount, paymentId, currency, optional status), validated in Dart and passed to the native 5.0.0 trackEvent. capturePayment, removePayment, LRCapturePayment, LRRemovePayment and PaymentType are removed. Native SDKs and the package version move to 5.0.0. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
trackPayment(eventName, paymentId, userId, amount, currency, status, eventData) replaces capturePayment and sends through trackEvent with an EventPayment. EventPayment now takes a required userId and status defaults to PAYMENT_COMPLETED and is always sent. Android and iOS bridges pass userId to the native 5.0.0 EventPayment. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… old types Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Payments now go through
trackEvent. Putamount,paymentIdandcurrency(plususerIdand optionalstatus) ineventDataand the SDK sends it as a payment; anything else stays a custom event.capturePayment,removePaymentandtrackPaymentare removed. Version 5.0.0.Migration: rename
capturePaymenttotrackEvent, pass the oldtypeas the event name with the same spelling, and move the fields intoeventData(currencyis new and required). Refunds: samepaymentIdwithPAYMENT_CANCELLED.Rules
eventDatahasamount,paymentIdandcurrency(camelCase). They are moved to the top level of thecapture-eventrequest (amount,payment_id,currency,user_id,status); every other key stays inevent_data.amountand/orcurrencywithoutpaymentIdis a normal custom event, sent exactly as before.paymentIdwithamountorcurrencymissing fails withamount, paymentId and currency must be sent together, nothing is sent.amountis a number,0or more (negative fails);paymentIdnot blank;currency3 letters, sent uppercase;userIdrequired (""uses the user saved by signup/setUserData);statusoptional (PaymentStatusvalue or its name), defaultPAYMENT_COMPLETED.FIRST_PAYMENT) to match existing dashboard mappings.Changes
trackPayment, thepaymentparam,EventPayment/LRCapturePayment/LRRemovePaymentand their Dart validation. Native 5.0.0 does the payment check.PaymentStatusmoved tolr_payment_status.dart; aPaymentStatusineventData['status']is sent as its name.eventDatato nativetrackEventunchanged. Native Android 5.0.0, LinkrunnerKit 5.0.0.Testing
flutter test13/13 pass;dart analyze lib test7 info-level naming notes only. Android debug APK and iOS simulator builds compile against native 5.0.0.amount+currencywithoutpaymentId);FIRST_PAYMENT1200 (PaymentStatusenum sent as its name,userId: ""used the saved user, product keys kept inevent_data) and amount 0 stored as revenue; lowercasefirst_paymentkept as its own type;PAYMENT_FAILEDstored; partial payment and -5 threwPlatformException(TRACK_EVENT_FAILED, …)and never reached the gateway.Backend: https://github.com/linkrunner-labs/hazelnut/pull/884 (no change needed for this design). Docs: linkrunner-labs/docs#265
Linear: https://linear.app/linkrunner/issue/LIN-3231/in-app-events-trackevent-with-amount-becomes-the-payment-api
🤖 Generated with Claude Code