/
pay.go
60 lines (50 loc) · 1.92 KB
/
pay.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
package verbs
import (
"encoding/xml"
"github.com/RJPearson94/twilio-sdk-go/twiml/voice/verbs/nouns"
)
type PayAttributes struct {
Action *string `xml:"action,attr,omitempty"`
BankAccountType *string `xml:"bankAccountType,attr,omitempty"`
ChargeAmount *string `xml:"chargeAmount,attr,omitempty"`
Currency *string `xml:"currency,attr,omitempty"`
Description *string `xml:"description,attr,omitempty"`
Input *string `xml:"input,attr,omitempty"`
Language *string `xml:"language,attr,omitempty"`
MaxAttempts *int `xml:"maxAttempts,attr,omitempty"`
MinPostalCodeLength *int `xml:"minPostalCodeLength,attr,omitempty"`
PaymentConnector *string `xml:"paymentConnector,attr,omitempty"`
PaymentMethod *string `xml:"paymentMethod,attr,omitempty"`
PostalCode *string `xml:"postalCode,attr,omitempty"`
SecurityCode *bool `xml:"securityCode,attr,omitempty"`
StatusCallback *string `xml:"statusCallback,attr,omitempty"`
StatusCallbackMethod *string `xml:"statusCallbackMethod,attr,omitempty"`
Timeout *int `xml:"timeout,attr,omitempty"`
TokenType *string `xml:"tokenType,attr,omitempty"`
ValidCardTypes *string `xml:"validCardTypes,attr,omitempty"`
}
type Pay struct {
XMLName xml.Name `xml:"Pay"`
*PayAttributes
Children []interface{}
}
func (p *Pay) Parameter() {
p.Children = append(p.Children, &nouns.Parameter{})
}
func (p *Pay) ParameterWithAttributes(attributes nouns.ParameterAttributes) {
p.Children = append(p.Children, &nouns.Parameter{
ParameterAttributes: &attributes,
})
}
func (p *Pay) Prompt() *Prompt {
prompt := &Prompt{}
p.Children = append(p.Children, prompt)
return prompt
}
func (p *Pay) PromptWithAttributes(attributes PromptAttributes) *Prompt {
prompt := &Prompt{
PromptAttributes: &attributes,
}
p.Children = append(p.Children, prompt)
return prompt
}