all the refactor
This commit is contained in:
@@ -85,7 +85,7 @@ func RegisterFlowActions(reg *flow.Registry, app Applier, provider PaymentProvid
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
auth, err := provider.Authorize(ctx, o.OrderReference, o.TotalAmount, o.Currency)
|
||||
auth, err := provider.Authorize(ctx, o.OrderReference, o.TotalAmount.Int64(), o.Currency)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -108,7 +108,7 @@ func RegisterFlowActions(reg *flow.Registry, app Applier, provider PaymentProvid
|
||||
amount, _ := st.Vars["authAmount"].(int64)
|
||||
if amount == 0 {
|
||||
if o, err := app.Get(ctx, st.ID); err == nil {
|
||||
amount = o.TotalAmount
|
||||
amount = o.TotalAmount.Int64()
|
||||
}
|
||||
}
|
||||
capture, err := provider.Capture(ctx, authRef, amount)
|
||||
@@ -154,7 +154,7 @@ func RegisterFlowActions(reg *flow.Registry, app Applier, provider PaymentProvid
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
amount := o.CapturedAmount - o.RefundedAmount // default: full remaining
|
||||
amount := (o.CapturedAmount - o.RefundedAmount).Int64() // default: full remaining
|
||||
if len(params) > 0 {
|
||||
var p struct {
|
||||
Amount int64 `json:"amount"`
|
||||
|
||||
Reference in New Issue
Block a user