-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmodel_card_emi.go
73 lines (60 loc) · 2.25 KB
/
model_card_emi.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
/*
Cashfree Payment Gateway APIs
Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites.
API version: 2023-08-01
Contact: [email protected]
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package cashfree_pg
import (
"encoding/json"
"strings"
)
// checks if the CardEMI type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CardEMI{}
// CardEMI Payment method for card emi
type CardEMI struct {
// The channel for card payments will always be \"link\"
Channel string `json:"channel"`
// Customer card number.
CardNumber string `json:"card_number"`
// Customer name mentioned on the card.
CardHolderName *string `json:"card_holder_name,omitempty"`
// Card expiry month.
CardExpiryMm string `json:"card_expiry_mm"`
// Card expiry year.
CardExpiryYy string `json:"card_expiry_yy"`
// CVV mentioned on the card.
CardCvv string `json:"card_cvv"`
// Card alias as returned by Cashfree Vault API
CardAlias *string `json:"card_alias,omitempty"`
// Card bank name, required for EMI payments. This is the bank user has selected for EMI. One of [\"hdfc, \"kotak\", \"icici\", \"rbl\", \"bob\", \"standard chartered\", \"axis\", \"au\", \"yes\", \"sbi\", \"fed\", \"hsbc\", \"citi\", \"amex\"]
CardBankName string `json:"card_bank_name"`
// EMI tenure selected by the user
EmiTenure int32 `json:"emi_tenure"`
}
func (o CardEMI) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CardEMI) ToMap() (map[string]interface{}, error) {
strings.HasPrefix("cf", "cf")
toSerialize := map[string]interface{}{}
toSerialize["channel"] = o.Channel
toSerialize["card_number"] = o.CardNumber
if !IsNil(o.CardHolderName) {
toSerialize["card_holder_name"] = o.CardHolderName
}
toSerialize["card_expiry_mm"] = o.CardExpiryMm
toSerialize["card_expiry_yy"] = o.CardExpiryYy
toSerialize["card_cvv"] = o.CardCvv
if !IsNil(o.CardAlias) {
toSerialize["card_alias"] = o.CardAlias
}
toSerialize["card_bank_name"] = o.CardBankName
toSerialize["emi_tenure"] = o.EmiTenure
return toSerialize, nil
}