Skip to content

Commit

Permalink
feat(payments): push raw data in nats but not in benthos (#1012)
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-nicolas authored Dec 13, 2023
1 parent b1e0292 commit 8d57c67
Show file tree
Hide file tree
Showing 34 changed files with 36 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ data:
- bloblang: |
root = {
"document": {
"data": this.payload,
"data": this.payload.without("rawData"),
"indexed": {
"id": this.payload.id,
"reference": this.payload.reference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ data:
- bloblang: |
root = {
"document": {
"data": this.payload,
"data": this.payload.without("rawData"),
"indexed": {
"id": this.payload.id,
"reference": this.payload.reference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ data:
- bloblang: |
root = {
"document": {
"data": this.payload,
"data": this.payload.without("rawData"),
"indexed": {
"id": this.payload.id,
"reference": this.payload.reference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ data:
- bloblang: |
root = {
"document": {
"data": this.payload,
"data": this.payload.without("rawData"),
"indexed": {
"id": this.payload.id,
"reference": this.payload.reference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ data:
- bloblang: |
root = {
"document": {
"data": this.payload,
"data": this.payload.without("rawData"),
"indexed": {
"id": this.payload.id,
"reference": this.payload.reference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ data:
- bloblang: |
root = {
"document": {
"data": this.payload,
"data": this.payload.without("rawData"),
"indexed": {
"id": this.payload.id,
"reference": this.payload.reference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ data:
- bloblang: |
root = {
"document": {
"data": this.payload,
"data": this.payload.without("rawData"),
"indexed": {
"id": this.payload.id,
"reference": this.payload.reference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
template:
metadata:
annotations:
stack.formance.cloud/volumes-hash: -UoS45tOcCl3jiSwzxW_3wpgEP5fZtADgfvq9c999bk=
stack.formance.cloud/volumes-hash: zAMPIto8AXFdiwdNiCVG3o8e_2plT6XlsIrrlxf0NcA=
creationTimestamp: null
labels:
app.kubernetes.io/name: search-benthos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ data:
- bloblang: |
root = {
"document": {
"data": this.payload,
"data": this.payload.without("rawData"),
"indexed": {
"id": this.payload.id,
"reference": this.payload.reference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
template:
metadata:
annotations:
stack.formance.cloud/volumes-hash: -UoS45tOcCl3jiSwzxW_3wpgEP5fZtADgfvq9c999bk=
stack.formance.cloud/volumes-hash: zAMPIto8AXFdiwdNiCVG3o8e_2plT6XlsIrrlxf0NcA=
creationTimestamp: null
labels:
app.kubernetes.io/name: search-benthos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ data:
- bloblang: |
root = {
"document": {
"data": this.payload,
"data": this.payload.without("rawData"),
"indexed": {
"id": this.payload.id,
"reference": this.payload.reference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
template:
metadata:
annotations:
stack.formance.cloud/volumes-hash: ZCAv3TDE8_leBkgtrdIjpiELW6zKYWYZ_4UZz3IQZtk=
stack.formance.cloud/volumes-hash: iXL4EcTjD7D2Zkq9Qb1D6Bctp8pGhkzkiwtjjBeKSnU=
creationTimestamp: null
labels:
app.kubernetes.io/name: search-benthos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ data:
- bloblang: |
root = {
"document": {
"data": this.payload,
"data": this.payload.without("rawData"),
"indexed": {
"id": this.payload.id,
"reference": this.payload.reference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
template:
metadata:
annotations:
stack.formance.cloud/volumes-hash: -UoS45tOcCl3jiSwzxW_3wpgEP5fZtADgfvq9c999bk=
stack.formance.cloud/volumes-hash: zAMPIto8AXFdiwdNiCVG3o8e_2plT6XlsIrrlxf0NcA=
creationTimestamp: null
labels:
app.kubernetes.io/name: search-benthos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ data:
- bloblang: |
root = {
"document": {
"data": this.payload,
"data": this.payload.without("rawData"),
"indexed": {
"id": this.payload.id,
"reference": this.payload.reference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
template:
metadata:
annotations:
stack.formance.cloud/volumes-hash: -UoS45tOcCl3jiSwzxW_3wpgEP5fZtADgfvq9c999bk=
stack.formance.cloud/volumes-hash: zAMPIto8AXFdiwdNiCVG3o8e_2plT6XlsIrrlxf0NcA=
creationTimestamp: null
labels:
app.kubernetes.io/name: search-benthos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ data:
- bloblang: |
root = {
"document": {
"data": this.payload,
"data": this.payload.without("rawData"),
"indexed": {
"id": this.payload.id,
"reference": this.payload.reference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
template:
metadata:
annotations:
stack.formance.cloud/volumes-hash: -UoS45tOcCl3jiSwzxW_3wpgEP5fZtADgfvq9c999bk=
stack.formance.cloud/volumes-hash: zAMPIto8AXFdiwdNiCVG3o8e_2plT6XlsIrrlxf0NcA=
creationTimestamp: null
labels:
app.kubernetes.io/name: search-benthos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ data:
- bloblang: |
root = {
"document": {
"data": this.payload,
"data": this.payload.without("rawData"),
"indexed": {
"id": this.payload.id,
"reference": this.payload.reference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
template:
metadata:
annotations:
stack.formance.cloud/volumes-hash: -UoS45tOcCl3jiSwzxW_3wpgEP5fZtADgfvq9c999bk=
stack.formance.cloud/volumes-hash: zAMPIto8AXFdiwdNiCVG3o8e_2plT6XlsIrrlxf0NcA=
creationTimestamp: null
labels:
app.kubernetes.io/name: search-benthos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ data:
- bloblang: |
root = {
"document": {
"data": this.payload,
"data": this.payload.without("rawData"),
"indexed": {
"id": this.payload.id,
"reference": this.payload.reference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
template:
metadata:
annotations:
stack.formance.cloud/volumes-hash: -UoS45tOcCl3jiSwzxW_3wpgEP5fZtADgfvq9c999bk=
stack.formance.cloud/volumes-hash: zAMPIto8AXFdiwdNiCVG3o8e_2plT6XlsIrrlxf0NcA=
creationTimestamp: null
labels:
app.kubernetes.io/name: search-benthos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ data:
- bloblang: |
root = {
"document": {
"data": this.payload,
"data": this.payload.without("rawData"),
"indexed": {
"id": this.payload.id,
"reference": this.payload.reference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
template:
metadata:
annotations:
stack.formance.cloud/volumes-hash: -UoS45tOcCl3jiSwzxW_3wpgEP5fZtADgfvq9c999bk=
stack.formance.cloud/volumes-hash: zAMPIto8AXFdiwdNiCVG3o8e_2plT6XlsIrrlxf0NcA=
creationTimestamp: null
labels:
app.kubernetes.io/name: search-benthos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ data:
- bloblang: |
root = {
"document": {
"data": this.payload,
"data": this.payload.without("rawData"),
"indexed": {
"id": this.payload.id,
"reference": this.payload.reference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
template:
metadata:
annotations:
stack.formance.cloud/volumes-hash: ZCAv3TDE8_leBkgtrdIjpiELW6zKYWYZ_4UZz3IQZtk=
stack.formance.cloud/volumes-hash: iXL4EcTjD7D2Zkq9Qb1D6Bctp8pGhkzkiwtjjBeKSnU=
creationTimestamp: null
labels:
app.kubernetes.io/name: search-benthos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ data:
- bloblang: |
root = {
"document": {
"data": this.payload,
"data": this.payload.without("rawData"),
"indexed": {
"id": this.payload.id,
"reference": this.payload.reference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
template:
metadata:
annotations:
stack.formance.cloud/volumes-hash: F6bbZbx0MQNCbgZUdSGeciveDQa7otqWM4t6cfklKHU=
stack.formance.cloud/volumes-hash: ohqyd8i40N1OhA-WN_ifFolSeJokKiFPJd4m-8X3ybA=
creationTimestamp: null
labels:
app.kubernetes.io/name: search-benthos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ data:
- bloblang: |
root = {
"document": {
"data": this.payload,
"data": this.payload.without("rawData"),
"indexed": {
"id": this.payload.id,
"reference": this.payload.reference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
template:
metadata:
annotations:
stack.formance.cloud/volumes-hash: F6bbZbx0MQNCbgZUdSGeciveDQa7otqWM4t6cfklKHU=
stack.formance.cloud/volumes-hash: ohqyd8i40N1OhA-WN_ifFolSeJokKiFPJd4m-8X3ybA=
creationTimestamp: null
labels:
app.kubernetes.io/name: search-benthos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ data:
- bloblang: |
root = {
"document": {
"data": this.payload,
"data": this.payload.without("rawData"),
"indexed": {
"id": this.payload.id,
"reference": this.payload.reference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
template:
metadata:
annotations:
stack.formance.cloud/volumes-hash: ZCAv3TDE8_leBkgtrdIjpiELW6zKYWYZ_4UZz3IQZtk=
stack.formance.cloud/volumes-hash: iXL4EcTjD7D2Zkq9Qb1D6Bctp8pGhkzkiwtjjBeKSnU=
creationTimestamp: null
labels:
app.kubernetes.io/name: search-benthos
Expand Down
3 changes: 3 additions & 0 deletions components/payments/internal/messages/payments.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package messages

import (
"encoding/json"
"math/big"
"time"

Expand All @@ -18,6 +19,7 @@ type paymentMessagePayload struct {
Status models.PaymentStatus `json:"status"`
Scheme models.PaymentScheme `json:"scheme"`
Asset models.Asset `json:"asset"`
RawData json.RawMessage `json:"rawData"`

// TODO: Remove 'initialAmount' once frontend has switched to 'amount
InitialAmount *big.Int `json:"initialAmount"`
Expand All @@ -38,6 +40,7 @@ func NewEventSavedPayments(provider models.ConnectorProvider, payment *models.Pa
CreatedAt: payment.CreatedAt,
ConnectorID: payment.ConnectorID.String(),
Provider: provider.String(),
RawData: payment.RawData,
Metadata: func() map[string]string {
ret := make(map[string]string)
for _, m := range payment.Metadata {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pipeline:
- bloblang: |
root = {
"document": {
"data": this.payload,
"data": this.payload.without("rawData"),
"indexed": {
"id": this.payload.id,
"reference": this.payload.reference,
Expand Down

1 comment on commit 8d57c67

@vercel
Copy link

@vercel vercel bot commented on 8d57c67 Dec 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.