lib/rules/paymentmethod.go

26 lines
837 B
Go

package rules
import (
"code.tnxs.net/taxnexus/lib/api/ops/ops_client/payment_method"
"code.tnxs.net/taxnexus/lib/api/ops/ops_models"
"code.tnxs.net/taxnexus/lib/app"
"go.temporal.io/sdk/workflow"
)
// StorePaymentMethodActivity posts a new paymentmethod object to datastore
func StorePaymentMethodActivity(
ctx workflow.Context,
w app.PaymentMethodChannelWrapper, //nolint:gocritic // what we want
) error {
postPaymentMethodParams := payment_method.NewPostPaymentMethodsParamsWithTimeout(postTimeout)
postPaymentMethodParams.PaymentMethodRequest = &ops_models.PaymentMethodRequest{
Data: []*ops_models.PaymentMethod{&w.Obj},
}
_, err := opsClient.PaymentMethod.PostPaymentMethods(postPaymentMethodParams, w.Principal.Auth)
if err != nil {
return err
}
sugar.Info("rules.storePaymentMethod: 👍 📤")
return nil
}