Files
sendico/api/pkg/model/rba.go
Stephan D 5e1da9617f
Some checks failed
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/chain_gateway Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful
ci/woodpecker/push/bump_version Pipeline failed
+address book service
2025-12-01 21:20:10 +01:00

32 lines
986 B
Go

package model
import (
"fmt"
"github.com/tech/sendico/pkg/merrors"
"go.mongodb.org/mongo-driver/bson"
)
type RussianBankAccountPaymentData struct {
RecipientName string `bson:"recipientName" json:"recipientName"`
Inn string `bson:"inn" json:"inn"`
Kpp string `bson:"kpp" json:"kpp"`
BankName string `bson:"bankName" json:"bankName"`
Bik string `bson:"bik" json:"bik"`
AccountNumber string `bson:"accountNumber" json:"accountNumber"`
CorrespondentAccount string `bson:"correspondentAccount" json:"correspondentAccount"`
}
func (m *PaymentMethod) AsRussianBankAccount() (*RussianBankAccountPaymentData, error) {
if m.Type != PaymentTypeBankAccount {
return nil, merrors.InvalidArgument(fmt.Sprintf("payment method type is %s, not bankAccount", m.Type), "type")
}
var d RussianBankAccountPaymentData
if err := bson.Unmarshal(m.Data, &d); err != nil {
return nil, err
}
return &d, nil
}