-
Notifications
You must be signed in to change notification settings - Fork 5
/
model_cardless_emi.go
62 lines (49 loc) · 1.84 KB
/
model_cardless_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
/*
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 CardlessEMI type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CardlessEMI{}
// CardlessEMI Request body for cardless emi payment method
type CardlessEMI struct {
// The channel for cardless EMI is always `link`
Channel *string `json:"channel,omitempty"`
// One of [`flexmoney`, `zestmoney`, `hdfc`, `icici`, `cashe`, `idfc`, `kotak`, `snapmint`, `bharatx`]
Provider *string `json:"provider,omitempty"`
// Customers phone number for this payment instrument. If the customer is not eligible you will receive a 400 error with type as 'invalid_request_error' and code as 'invalid_request_error'
Phone *string `json:"phone,omitempty"`
// EMI tenure for the selected provider. This is mandatory when provider is one of [`hdfc`, `icici`, `cashe`, `idfc`, `kotak`]
EmiTenure *int32 `json:"emi_tenure,omitempty"`
}
func (o CardlessEMI) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CardlessEMI) ToMap() (map[string]interface{}, error) {
strings.HasPrefix("cf", "cf")
toSerialize := map[string]interface{}{}
if !IsNil(o.Channel) {
toSerialize["channel"] = o.Channel
}
if !IsNil(o.Provider) {
toSerialize["provider"] = o.Provider
}
if !IsNil(o.Phone) {
toSerialize["phone"] = o.Phone
}
if !IsNil(o.EmiTenure) {
toSerialize["emi_tenure"] = o.EmiTenure
}
return toSerialize, nil
}