-
Notifications
You must be signed in to change notification settings - Fork 4
/
model_customer_details.go
78 lines (65 loc) · 2.62 KB
/
model_customer_details.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
/*
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 CustomerDetails type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CustomerDetails{}
// CustomerDetails The customer details that are necessary. Note that you can pass dummy details if your use case does not require the customer details.
type CustomerDetails struct {
// A unique identifier for the customer. Use alphanumeric values only.
CustomerId string `json:"customer_id"`
// Customer email address.
CustomerEmail *string `json:"customer_email,omitempty"`
// Customer phone number.
CustomerPhone string `json:"customer_phone"`
// Name of the customer.
CustomerName *string `json:"customer_name,omitempty"`
// Customer bank account. Required if you want to do a bank account check (TPV)
CustomerBankAccountNumber *string `json:"customer_bank_account_number,omitempty"`
// Customer bank IFSC. Required if you want to do a bank account check (TPV)
CustomerBankIfsc *string `json:"customer_bank_ifsc,omitempty"`
// Customer bank code. Required for net banking payments, if you want to do a bank account check (TPV)
CustomerBankCode *float32 `json:"customer_bank_code,omitempty"`
// Customer identifier at Cashfree. You will get this when you create/get customer
CustomerUid *string `json:"customer_uid,omitempty"`
}
func (o CustomerDetails) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CustomerDetails) ToMap() (map[string]interface{}, error) {
strings.HasPrefix("cf", "cf")
toSerialize := map[string]interface{}{}
toSerialize["customer_id"] = o.CustomerId
if !IsNil(o.CustomerEmail) {
toSerialize["customer_email"] = o.CustomerEmail
}
toSerialize["customer_phone"] = o.CustomerPhone
if !IsNil(o.CustomerName) {
toSerialize["customer_name"] = o.CustomerName
}
if !IsNil(o.CustomerBankAccountNumber) {
toSerialize["customer_bank_account_number"] = o.CustomerBankAccountNumber
}
if !IsNil(o.CustomerBankIfsc) {
toSerialize["customer_bank_ifsc"] = o.CustomerBankIfsc
}
if !IsNil(o.CustomerBankCode) {
toSerialize["customer_bank_code"] = o.CustomerBankCode
}
if !IsNil(o.CustomerUid) {
toSerialize["customer_uid"] = o.CustomerUid
}
return toSerialize, nil
}