-
Notifications
You must be signed in to change notification settings - Fork 1
/
three_ds.go
executable file
·84 lines (74 loc) · 2.39 KB
/
three_ds.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package processout
import (
"bytes"
"encoding/json"
"io"
"net/http"
"net/url"
"strings"
"time"
"gopkg.in/processout.v4/errors"
)
// ThreeDS represents the ThreeDS API object
type ThreeDS struct {
// Version is the version of the 3DS
Version *string `json:"version,omitempty"`
// Status is the current status of the authentication
Status *string `json:"status,omitempty"`
// Fingerprinted is the true if a fingerprint has occured
Fingerprinted *bool `json:"fingerprinted,omitempty"`
// Challenged is the true if a challenge has occured
Challenged *bool `json:"challenged,omitempty"`
// AresTransStatus is the ares transaction status
AresTransStatus *string `json:"ares_trans_status,omitempty"`
// CresTransStatus is the cres transaction status
CresTransStatus *string `json:"cres_trans_status,omitempty"`
// DsTransID is the universally unique transaction identifier assigned by the DS to identify a single transaction
DsTransID *string `json:"ds_trans_id,omitempty"`
// FingerprintCompletionIndicator is the indicates whether the 3DS fingerprint successfully completed
FingerprintCompletionIndicator *string `json:"fingerprint_completion_indicator,omitempty"`
// ServerTransID is the universally unique transaction identifier assigned by the 3DS Server to identify a single transaction
ServerTransID *string `json:"server_trans_id,omitempty"`
client *ProcessOut
}
// SetClient sets the client for the ThreeDS object and its
// children
func (s *ThreeDS) SetClient(c *ProcessOut) *ThreeDS {
if s == nil {
return s
}
s.client = c
return s
}
// Prefil prefills the object with data provided in the parameter
func (s *ThreeDS) Prefill(c *ThreeDS) *ThreeDS {
if c == nil {
return s
}
s.Version = c.Version
s.Status = c.Status
s.Fingerprinted = c.Fingerprinted
s.Challenged = c.Challenged
s.AresTransStatus = c.AresTransStatus
s.CresTransStatus = c.CresTransStatus
s.DsTransID = c.DsTransID
s.FingerprintCompletionIndicator = c.FingerprintCompletionIndicator
s.ServerTransID = c.ServerTransID
return s
}
// dummyThreeDS is a dummy function that's only
// here because some files need specific packages and some don't.
// It's easier to include it for every file. In case you couldn't
// tell, everything is generated.
func dummyThreeDS() {
type dummy struct {
a bytes.Buffer
b json.RawMessage
c http.File
d strings.Reader
e time.Time
f url.URL
g io.Reader
}
errors.New(nil, "", "")
}