feat: Added AuthCode and RRN support to card payment system
This commit is contained in:
25
vchasno.go
25
vchasno.go
@@ -17,16 +17,23 @@ const (
|
||||
)
|
||||
|
||||
type SellParams struct {
|
||||
PayType int
|
||||
Sum float64
|
||||
Comment string
|
||||
PayType int
|
||||
Sum float64
|
||||
Comment string
|
||||
Name string
|
||||
Cnt int
|
||||
Price float64
|
||||
Disc float64
|
||||
Taxgrp string
|
||||
CardParams CardParams
|
||||
}
|
||||
|
||||
type CardParams struct {
|
||||
Cardmask string
|
||||
BankID string
|
||||
Name string
|
||||
Cnt int
|
||||
Price float64
|
||||
Disc float64
|
||||
Taxgrp string
|
||||
|
||||
RrnCode string
|
||||
AuthCode string
|
||||
}
|
||||
|
||||
func NewVchasno(token string) *Vchasno {
|
||||
@@ -38,7 +45,7 @@ func NewVchasno(token string) *Vchasno {
|
||||
func (v *Vchasno) NewSell(params SellParams) (*api.KasaResponse, error) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
|
||||
defer cancel()
|
||||
return v.api.NewSell(ctx, params.PayType, params.Sum, params.Comment, params.Cardmask, params.BankID, params.Name, params.Cnt, params.Price, params.Disc, params.Taxgrp)
|
||||
return v.api.NewSell(ctx, params.PayType, params.Sum, params.Comment, params.CardParams.Cardmask, params.CardParams.BankID, params.Name, params.Cnt, params.Price, params.Disc, params.Taxgrp, params.CardParams.RrnCode, params.CardParams.AuthCode)
|
||||
}
|
||||
|
||||
func SetDefaultParams() SellParams {
|
||||
|
||||
Reference in New Issue
Block a user