Skip to content

Commit 4df5073

Browse files
author
jeffyanta
authored
Payments with relationship accounts (#8)
* Refactor GetLatestByOwnerAddress * GetLatestByOwnerAddress refactor updates for dependent code * GetTokenAccountInfos returns relationship metadata * Hook up relationship accounts to Geyser external deposit handler * Private receive flows for relationship accounts * Public send flows for relationship accounts as a source * Public send flows for relationship accounts as a destination * Private send flows for relationship accounts * Payment request messaging flows with relationship accounts * Update Payment Received push, and a small caching optimization * Update payment history tests * Timelock account management state tests for SubmitIntent calls involving relationship accounts * Handle chat mute status for payment received notification when destination is a relationship account * Chat updates for merchant to user payments
1 parent ace4388 commit 4df5073

28 files changed

+1354
-406
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
firebase.google.com/go/v4 v4.8.0
77
github.com/aws/aws-sdk-go-v2 v0.17.0
88
github.com/bits-and-blooms/bloom/v3 v3.1.0
9-
github.com/code-payments/code-protobuf-api v1.3.0
9+
github.com/code-payments/code-protobuf-api v1.3.1-0.20231206151310-7246ff3de9a5
1010
github.com/emirpasic/gods v1.12.0
1111
github.com/envoyproxy/protoc-gen-validate v0.1.0
1212
github.com/golang-jwt/jwt/v5 v5.0.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH
108108
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
109109
github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I=
110110
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
111-
github.com/code-payments/code-protobuf-api v1.3.0 h1:0hhUq7BoTjBo1GwKpgC76VHMrThhvXkjh4B+bT5O1Ec=
112-
github.com/code-payments/code-protobuf-api v1.3.0/go.mod h1:pHQm75vydD6Cm2qHAzlimW6drysm489Z4tVxC2zHSsU=
111+
github.com/code-payments/code-protobuf-api v1.3.1-0.20231206151310-7246ff3de9a5 h1:A/h5RjpuoU0a8ypTVYGE/EsODATcPlUdnqWxIeWEoZA=
112+
github.com/code-payments/code-protobuf-api v1.3.1-0.20231206151310-7246ff3de9a5/go.mod h1:pHQm75vydD6Cm2qHAzlimW6drysm489Z4tVxC2zHSsU=
113113
github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6 h1:NmTXa/uVnDyp0TY5MKi197+3HWcnYWfnHGyaFthlnGw=
114114
github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
115115
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=

pkg/code/async/geyser/external_deposit.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,13 @@ func processPotentialExternalDeposit(ctx context.Context, data code_data.Provide
220220
return errors.Wrap(err, "error getting account info record")
221221
}
222222

223-
// Mark anything other than primary account as synced and move on without
223+
// Mark anything other than deposit accounts as synced and move on without
224224
// saving anything. There's a potential someone could overutilize our treasury
225225
// by depositing large sums into temporary or bucket accounts, which have
226-
// more lenient checks ATM. We'll deal with these adhoc as they arise. It
227-
// should be a rare case given anything other than primary isn't exposed to
228-
// users.
229-
if accountInfoRecord.AccountType != commonpb.AccountType_PRIMARY {
226+
// more lenient checks ATM. We'll deal with these adhoc as they arise.
227+
switch accountInfoRecord.AccountType {
228+
case commonpb.AccountType_PRIMARY, commonpb.AccountType_RELATIONSHIP:
229+
default:
230230
syncedDepositCache.Insert(cacheKey, true, 1)
231231
return nil
232232
}

pkg/code/balance/calculator.go

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import (
88

99
commonpb "github.com/code-payments/code-protobuf-api/generated/go/common/v1"
1010

11-
"github.com/code-payments/code-server/pkg/metrics"
12-
timelock_token "github.com/code-payments/code-server/pkg/solana/timelock/v1"
1311
"github.com/code-payments/code-server/pkg/code/common"
1412
code_data "github.com/code-payments/code-server/pkg/code/data"
1513
"github.com/code-payments/code-server/pkg/code/data/timelock"
14+
"github.com/code-payments/code-server/pkg/metrics"
15+
timelock_token "github.com/code-payments/code-server/pkg/solana/timelock/v1"
1616
)
1717

1818
const (
@@ -393,7 +393,7 @@ func GetTotalBalance(ctx context.Context, data code_data.Provider, owner *common
393393

394394
var accountRecordsBatch []*common.AccountRecords
395395
for _, accountRecords := range accountRecordsByType {
396-
accountRecordsBatch = append(accountRecordsBatch, accountRecords)
396+
accountRecordsBatch = append(accountRecordsBatch, accountRecords...)
397397
}
398398

399399
balanceByAccount, err := DefaultBatchCalculationWithAccountRecords(ctx, data, accountRecordsBatch...)
@@ -404,8 +404,10 @@ func GetTotalBalance(ctx context.Context, data code_data.Provider, owner *common
404404
}
405405

406406
var total uint64
407-
for _, records := range accountRecordsByType {
408-
total += balanceByAccount[records.General.TokenAccount]
407+
for _, batchRecords := range accountRecordsByType {
408+
for _, records := range batchRecords {
409+
total += balanceByAccount[records.General.TokenAccount]
410+
}
409411
}
410412
return total, nil
411413
}
@@ -438,12 +440,12 @@ func GetPrivateBalance(ctx context.Context, data code_data.Provider, owner *comm
438440

439441
var accountRecordsBatch []*common.AccountRecords
440442
for _, accountRecords := range accountRecordsByType {
441-
switch accountRecords.General.AccountType {
442-
case commonpb.AccountType_PRIMARY, commonpb.AccountType_LEGACY_PRIMARY_2022, commonpb.AccountType_REMOTE_SEND_GIFT_CARD:
443+
switch accountRecords[0].General.AccountType {
444+
case commonpb.AccountType_PRIMARY, commonpb.AccountType_LEGACY_PRIMARY_2022, commonpb.AccountType_REMOTE_SEND_GIFT_CARD, commonpb.AccountType_RELATIONSHIP:
443445
continue
444446
}
445447

446-
accountRecordsBatch = append(accountRecordsBatch, accountRecords)
448+
accountRecordsBatch = append(accountRecordsBatch, accountRecords...)
447449
}
448450

449451
balanceByAccount, err := DefaultBatchCalculationWithAccountRecords(ctx, data, accountRecordsBatch...)
@@ -454,8 +456,10 @@ func GetPrivateBalance(ctx context.Context, data code_data.Provider, owner *comm
454456
}
455457

456458
var total uint64
457-
for _, records := range accountRecordsByType {
458-
total += balanceByAccount[records.General.TokenAccount]
459+
for _, batchRecords := range accountRecordsByType {
460+
for _, records := range batchRecords {
461+
total += balanceByAccount[records.General.TokenAccount]
462+
}
459463
}
460464
return total, nil
461465
}

pkg/code/balance/calculator_test.go

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ import (
1212

1313
commonpb "github.com/code-payments/code-protobuf-api/generated/go/common/v1"
1414

15-
"github.com/code-payments/code-server/pkg/currency"
16-
timelock_token_v1 "github.com/code-payments/code-server/pkg/solana/timelock/v1"
17-
"github.com/code-payments/code-server/pkg/testutil"
1815
"github.com/code-payments/code-server/pkg/code/common"
1916
code_data "github.com/code-payments/code-server/pkg/code/data"
2017
"github.com/code-payments/code-server/pkg/code/data/account"
@@ -23,6 +20,10 @@ import (
2320
"github.com/code-payments/code-server/pkg/code/data/intent"
2421
"github.com/code-payments/code-server/pkg/code/data/payment"
2522
"github.com/code-payments/code-server/pkg/code/data/transaction"
23+
"github.com/code-payments/code-server/pkg/currency"
24+
"github.com/code-payments/code-server/pkg/pointer"
25+
timelock_token_v1 "github.com/code-payments/code-server/pkg/solana/timelock/v1"
26+
"github.com/code-payments/code-server/pkg/testutil"
2627
)
2728

2829
func TestDefaultCalculationMethods_NewCodeAccount(t *testing.T) {
@@ -45,7 +46,7 @@ func TestDefaultCalculationMethods_NewCodeAccount(t *testing.T) {
4546
require.NoError(t, err)
4647
assert.EqualValues(t, 0, balance)
4748

48-
balanceByAccount, err := DefaultBatchCalculationWithAccountRecords(env.ctx, env.data, accountRecords[commonpb.AccountType_PRIMARY])
49+
balanceByAccount, err := DefaultBatchCalculationWithAccountRecords(env.ctx, env.data, accountRecords[commonpb.AccountType_PRIMARY][0])
4950
require.NoError(t, err)
5051
require.Len(t, balanceByAccount, 1)
5152
assert.EqualValues(t, 0, balanceByAccount[newTokenAccount.PublicKey().ToBase58()])
@@ -91,7 +92,7 @@ func TestDefaultCalculationMethods_DepositFromExternalWallet(t *testing.T) {
9192
accountRecords, err := common.GetLatestTokenAccountRecordsForOwner(env.ctx, env.data, owner)
9293
require.NoError(t, err)
9394

94-
balanceByAccount, err := DefaultBatchCalculationWithAccountRecords(env.ctx, env.data, accountRecords[commonpb.AccountType_PRIMARY])
95+
balanceByAccount, err := DefaultBatchCalculationWithAccountRecords(env.ctx, env.data, accountRecords[commonpb.AccountType_PRIMARY][0])
9596
require.NoError(t, err)
9697
require.Len(t, balanceByAccount, 1)
9798
assert.EqualValues(t, 11, balanceByAccount[depositAccount.PublicKey().ToBase58()])
@@ -197,7 +198,7 @@ func TestDefaultCalculationMethods_MultipleIntents(t *testing.T) {
197198
accountRecords4, err := common.GetLatestTokenAccountRecordsForOwner(env.ctx, env.data, owner4)
198199
require.NoError(t, err)
199200

200-
balanceByAccount, err := DefaultBatchCalculationWithAccountRecords(env.ctx, env.data, accountRecords1[commonpb.AccountType_PRIMARY], accountRecords2[commonpb.AccountType_PRIMARY], accountRecords3[commonpb.AccountType_PRIMARY], accountRecords4[commonpb.AccountType_PRIMARY])
201+
balanceByAccount, err := DefaultBatchCalculationWithAccountRecords(env.ctx, env.data, accountRecords1[commonpb.AccountType_PRIMARY][0], accountRecords2[commonpb.AccountType_PRIMARY][0], accountRecords3[commonpb.AccountType_PRIMARY][0], accountRecords4[commonpb.AccountType_PRIMARY][0])
201202
require.NoError(t, err)
202203
require.Len(t, balanceByAccount, 4)
203204
assert.EqualValues(t, 11, balanceByAccount[a1.PublicKey().ToBase58()])
@@ -264,7 +265,7 @@ func TestDefaultCalculationMethods_BackAndForth(t *testing.T) {
264265
accountRecords2, err := common.GetLatestTokenAccountRecordsForOwner(env.ctx, env.data, owner2)
265266
require.NoError(t, err)
266267

267-
balanceByAccount, err := DefaultBatchCalculationWithAccountRecords(env.ctx, env.data, accountRecords1[commonpb.AccountType_PRIMARY], accountRecords2[commonpb.AccountType_PRIMARY])
268+
balanceByAccount, err := DefaultBatchCalculationWithAccountRecords(env.ctx, env.data, accountRecords1[commonpb.AccountType_PRIMARY][0], accountRecords2[commonpb.AccountType_PRIMARY][0])
268269
require.NoError(t, err)
269270
require.Len(t, balanceByAccount, 2)
270271
assert.EqualValues(t, 0, balanceByAccount[a1.PublicKey().ToBase58()])
@@ -316,7 +317,7 @@ func TestDefaultCalculationMethods_SelfPayments(t *testing.T) {
316317
accountRecords, err := common.GetLatestTokenAccountRecordsForOwner(env.ctx, env.data, ownerAccount)
317318
require.NoError(t, err)
318319

319-
balanceByAccount, err := DefaultBatchCalculationWithAccountRecords(env.ctx, env.data, accountRecords[commonpb.AccountType_PRIMARY])
320+
balanceByAccount, err := DefaultBatchCalculationWithAccountRecords(env.ctx, env.data, accountRecords[commonpb.AccountType_PRIMARY][0])
320321
require.NoError(t, err)
321322
require.Len(t, balanceByAccount, 1)
322323
assert.EqualValues(t, 1, balanceByAccount[tokenAccount.PublicKey().ToBase58()])
@@ -354,7 +355,7 @@ func TestDefaultCalculationMethods_NotManagedByCode(t *testing.T) {
354355
_, err = DefaultCalculation(env.ctx, env.data, tokenAccount)
355356
assert.Equal(t, ErrNotManagedByCode, err)
356357

357-
_, err = DefaultBatchCalculationWithAccountRecords(env.ctx, env.data, accountRecords[commonpb.AccountType_PRIMARY])
358+
_, err = DefaultBatchCalculationWithAccountRecords(env.ctx, env.data, accountRecords[commonpb.AccountType_PRIMARY][0])
358359
assert.Equal(t, ErrNotManagedByCode, err)
359360

360361
_, err = DefaultBatchCalculationWithTokenAccounts(env.ctx, env.data, tokenAccount)
@@ -419,7 +420,7 @@ func TestGetAggregatedBalances(t *testing.T) {
419420

420421
balance := uint64(math.Pow10(i))
421422
expectedTotalBalance += balance
422-
if accountType != commonpb.AccountType_PRIMARY {
423+
if accountType != commonpb.AccountType_PRIMARY && accountType != commonpb.AccountType_RELATIONSHIP {
423424
expectedPrivateBalance += balance
424425
}
425426

@@ -435,6 +436,9 @@ func TestGetAggregatedBalances(t *testing.T) {
435436
TokenAccount: timelockRecord.VaultAddress,
436437
AccountType: accountType,
437438
}
439+
if accountType == commonpb.AccountType_RELATIONSHIP {
440+
accountInfoRecord.RelationshipTo = pointer.String("example.com")
441+
}
438442
require.NoError(t, env.data.CreateAccountInfo(env.ctx, &accountInfoRecord))
439443

440444
actionRecord := action.Record{

pkg/code/chat/message_cash_transactions.go

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"github.com/pkg/errors"
88

99
chatpb "github.com/code-payments/code-protobuf-api/generated/go/chat/v1"
10+
commonpb "github.com/code-payments/code-protobuf-api/generated/go/common/v1"
1011

1112
"github.com/code-payments/code-server/pkg/code/common"
1213
code_data "github.com/code-payments/code-server/pkg/code/data"
@@ -18,13 +19,16 @@ import (
1819
// chat with exchange data content related to the submitted intent.
1920
//
2021
// Note: Tests covered in SubmitIntent history tests
22+
//
23+
// todo: How are we handling relationship account flows?
2124
func SendCashTransactionsExchangeMessage(ctx context.Context, data code_data.Provider, intentRecord *intent.Record) error {
25+
messageId := intentRecord.IntentId
26+
2227
exchangeData, ok := getExchangeDataFromIntent(intentRecord)
2328
if !ok {
2429
return nil
2530
}
2631

27-
messageId := intentRecord.IntentId
2832
verbByMessageReceiver := make(map[string]chatpb.ExchangeDataContent_Verb)
2933
switch intentRecord.IntentType {
3034
case intent.SendPrivatePayment:
@@ -39,7 +43,14 @@ func SendCashTransactionsExchangeMessage(ctx context.Context, data code_data.Pro
3943

4044
verbByMessageReceiver[intentRecord.InitiatorOwnerAccount] = chatpb.ExchangeDataContent_WITHDREW
4145
if len(intentRecord.SendPrivatePaymentMetadata.DestinationOwnerAccount) > 0 {
42-
verbByMessageReceiver[intentRecord.SendPrivatePaymentMetadata.DestinationOwnerAccount] = chatpb.ExchangeDataContent_DEPOSITED
46+
destinationAccountInfoRecord, err := data.GetAccountInfoByTokenAddress(ctx, intentRecord.SendPrivatePaymentMetadata.DestinationTokenAccount)
47+
if err != nil {
48+
return err
49+
} else if destinationAccountInfoRecord.AccountType != commonpb.AccountType_RELATIONSHIP {
50+
// Relationship accounts payments will show up in the verified
51+
// merchant chat
52+
verbByMessageReceiver[intentRecord.SendPrivatePaymentMetadata.DestinationOwnerAccount] = chatpb.ExchangeDataContent_DEPOSITED
53+
}
4354
}
4455
} else if intentRecord.SendPrivatePaymentMetadata.IsRemoteSend {
4556
verbByMessageReceiver[intentRecord.InitiatorOwnerAccount] = chatpb.ExchangeDataContent_SENT
@@ -54,7 +65,14 @@ func SendCashTransactionsExchangeMessage(ctx context.Context, data code_data.Pro
5465
if intentRecord.SendPublicPaymentMetadata.IsWithdrawal {
5566
verbByMessageReceiver[intentRecord.InitiatorOwnerAccount] = chatpb.ExchangeDataContent_WITHDREW
5667
if len(intentRecord.SendPublicPaymentMetadata.DestinationOwnerAccount) > 0 {
57-
verbByMessageReceiver[intentRecord.SendPublicPaymentMetadata.DestinationOwnerAccount] = chatpb.ExchangeDataContent_DEPOSITED
68+
destinationAccountInfoRecord, err := data.GetAccountInfoByTokenAddress(ctx, intentRecord.SendPublicPaymentMetadata.DestinationTokenAccount)
69+
if err != nil {
70+
return err
71+
} else if destinationAccountInfoRecord.AccountType != commonpb.AccountType_RELATIONSHIP {
72+
// Relationship accounts payments will show up in the verified
73+
// merchant chat
74+
verbByMessageReceiver[intentRecord.SendPublicPaymentMetadata.DestinationOwnerAccount] = chatpb.ExchangeDataContent_DEPOSITED
75+
}
5876
}
5977
}
6078

pkg/code/chat/message_merchant.go

Lines changed: 50 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"github.com/pkg/errors"
77

88
chatpb "github.com/code-payments/code-protobuf-api/generated/go/chat/v1"
9+
commonpb "github.com/code-payments/code-protobuf-api/generated/go/common/v1"
910

1011
"github.com/code-payments/code-server/pkg/code/common"
1112
code_data "github.com/code-payments/code-server/pkg/code/data"
@@ -18,19 +19,7 @@ import (
1819
//
1920
// Note: Tests covered in SubmitIntent history tests
2021
func SendMerchantExchangeMessage(ctx context.Context, data code_data.Provider, intentRecord *intent.Record) error {
21-
switch intentRecord.IntentType {
22-
case intent.SendPrivatePayment:
23-
if !intentRecord.SendPrivatePaymentMetadata.IsMicroPayment {
24-
return nil
25-
}
26-
default:
27-
return nil
28-
}
29-
30-
paymentRequestRecord, err := data.GetPaymentRequest(ctx, intentRecord.IntentId)
31-
if err != nil {
32-
return errors.Wrap(err, "error getting payment request record")
33-
}
22+
messageId := intentRecord.IntentId
3423

3524
// There are three possible chats for a merchant:
3625
// 1. Verified chat with a verified identifier that server has validated
@@ -44,13 +33,6 @@ func SendMerchantExchangeMessage(ctx context.Context, data code_data.Provider, i
4433
chatTitle := PaymentsName
4534
chatType := chat.ChatTypeInternal
4635
isVerified := false
47-
if paymentRequestRecord.Domain != nil {
48-
chatTitle = *paymentRequestRecord.Domain
49-
chatType = chat.ChatTypeExternalApp
50-
isVerified = paymentRequestRecord.IsVerified
51-
}
52-
53-
messageId := intentRecord.IntentId
5436

5537
exchangeData, ok := getExchangeDataFromIntent(intentRecord)
5638
if !ok {
@@ -60,10 +42,55 @@ func SendMerchantExchangeMessage(ctx context.Context, data code_data.Provider, i
6042
verbByMessageReceiver := make(map[string]chatpb.ExchangeDataContent_Verb)
6143
switch intentRecord.IntentType {
6244
case intent.SendPrivatePayment:
63-
verbByMessageReceiver[intentRecord.InitiatorOwnerAccount] = chatpb.ExchangeDataContent_SPENT
64-
if len(intentRecord.SendPrivatePaymentMetadata.DestinationOwnerAccount) > 0 {
65-
verbByMessageReceiver[intentRecord.SendPrivatePaymentMetadata.DestinationOwnerAccount] = chatpb.ExchangeDataContent_PAID
45+
if intentRecord.SendPrivatePaymentMetadata.IsMicroPayment {
46+
paymentRequestRecord, err := data.GetPaymentRequest(ctx, intentRecord.IntentId)
47+
if err != nil {
48+
return errors.Wrap(err, "error getting payment request record")
49+
}
50+
51+
if paymentRequestRecord.Domain != nil {
52+
chatTitle = *paymentRequestRecord.Domain
53+
chatType = chat.ChatTypeExternalApp
54+
isVerified = paymentRequestRecord.IsVerified
55+
}
56+
57+
verbByMessageReceiver[intentRecord.InitiatorOwnerAccount] = chatpb.ExchangeDataContent_SPENT
58+
if len(intentRecord.SendPrivatePaymentMetadata.DestinationOwnerAccount) > 0 {
59+
verbByMessageReceiver[intentRecord.SendPrivatePaymentMetadata.DestinationOwnerAccount] = chatpb.ExchangeDataContent_PAID
60+
}
61+
} else if intentRecord.SendPrivatePaymentMetadata.IsWithdrawal {
62+
if len(intentRecord.SendPrivatePaymentMetadata.DestinationOwnerAccount) > 0 {
63+
destinationAccountInfoRecord, err := data.GetAccountInfoByTokenAddress(ctx, intentRecord.SendPrivatePaymentMetadata.DestinationTokenAccount)
64+
if err != nil {
65+
return err
66+
} else if destinationAccountInfoRecord.AccountType == commonpb.AccountType_RELATIONSHIP {
67+
// Relationship accounts only exist against verified merchants,
68+
// and will have merchant payments appear in the verified merchant
69+
// chat.
70+
chatTitle = *destinationAccountInfoRecord.RelationshipTo
71+
isVerified = true
72+
verbByMessageReceiver[intentRecord.SendPrivatePaymentMetadata.DestinationOwnerAccount] = chatpb.ExchangeDataContent_DEPOSITED
73+
}
74+
}
75+
}
76+
case intent.SendPublicPayment:
77+
if intentRecord.SendPublicPaymentMetadata.IsWithdrawal {
78+
if len(intentRecord.SendPublicPaymentMetadata.DestinationOwnerAccount) > 0 {
79+
destinationAccountInfoRecord, err := data.GetAccountInfoByTokenAddress(ctx, intentRecord.SendPublicPaymentMetadata.DestinationTokenAccount)
80+
if err != nil {
81+
return err
82+
} else if destinationAccountInfoRecord.AccountType == commonpb.AccountType_RELATIONSHIP {
83+
// Relationship accounts only exist against verified merchants,
84+
// and will have merchant payments appear in the verified merchant
85+
// chat.
86+
chatTitle = *destinationAccountInfoRecord.RelationshipTo
87+
isVerified = true
88+
verbByMessageReceiver[intentRecord.SendPublicPaymentMetadata.DestinationOwnerAccount] = chatpb.ExchangeDataContent_DEPOSITED
89+
}
90+
}
6691
}
92+
default:
93+
return nil
6794
}
6895

6996
for account, verb := range verbByMessageReceiver {

0 commit comments

Comments
 (0)