23 lines
832 B
Go
23 lines
832 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) error { //nolint:gocritic // what we want
|
||
|
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
|
||
|
}
|