-
Notifications
You must be signed in to change notification settings - Fork 5
/
model_create_link_request.go
94 lines (81 loc) · 3.72 KB
/
model_create_link_request.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
85
86
87
88
89
90
91
/*
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 CreateLinkRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CreateLinkRequest{}
// CreateLinkRequest Request paramenters for link creation
type CreateLinkRequest struct {
// Unique Identifier (provided by merchant) for the Link. Alphanumeric and only - and _ allowed (50 character limit). Use this for other link-related APIs.
LinkId string `json:"link_id"`
// Amount to be collected using this link. Provide upto two decimals for paise.
LinkAmount float64 `json:"link_amount"`
// Currency for the payment link. Default is INR. Contact [email protected] to enable new currencies.
LinkCurrency string `json:"link_currency"`
// A brief description for which payment must be collected. This is shown to the customer.
LinkPurpose string `json:"link_purpose"`
CustomerDetails LinkCustomerDetailsEntity `json:"customer_details"`
// If \"true\", customer can make partial payments for the link.
LinkPartialPayments *bool `json:"link_partial_payments,omitempty"`
// Minimum amount in first installment that needs to be paid by the customer if partial payments are enabled. This should be less than the link_amount.
LinkMinimumPartialAmount *float64 `json:"link_minimum_partial_amount,omitempty"`
// Time after which the link expires. Customers will not be able to make the payment beyond the time specified here. You can provide them in a valid ISO 8601 time format. Default is 30 days.
LinkExpiryTime *string `json:"link_expiry_time,omitempty"`
LinkNotify *LinkNotifyEntity `json:"link_notify,omitempty"`
// If \"true\", reminders will be sent to customers for collecting payments.
LinkAutoReminders *bool `json:"link_auto_reminders,omitempty"`
// Key-value pair that can be used to store additional information about the entity. Maximum 5 key-value pairs
LinkNotes *map[string]string `json:"link_notes,omitempty"`
LinkMeta *LinkMetaResponseEntity `json:"link_meta,omitempty"`
// If you have Easy split enabled in your Cashfree account then you can use this option to split the order amount.
OrderSplits []VendorSplit `json:"order_splits,omitempty"`
}
func (o CreateLinkRequest) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CreateLinkRequest) ToMap() (map[string]interface{}, error) {
strings.HasPrefix("cf", "cf")
toSerialize := map[string]interface{}{}
toSerialize["link_id"] = o.LinkId
toSerialize["link_amount"] = o.LinkAmount
toSerialize["link_currency"] = o.LinkCurrency
toSerialize["link_purpose"] = o.LinkPurpose
toSerialize["customer_details"] = o.CustomerDetails
if !IsNil(o.LinkPartialPayments) {
toSerialize["link_partial_payments"] = o.LinkPartialPayments
}
if !IsNil(o.LinkMinimumPartialAmount) {
toSerialize["link_minimum_partial_amount"] = o.LinkMinimumPartialAmount
}
if !IsNil(o.LinkExpiryTime) {
toSerialize["link_expiry_time"] = o.LinkExpiryTime
}
if !IsNil(o.LinkNotify) {
toSerialize["link_notify"] = o.LinkNotify
}
if !IsNil(o.LinkAutoReminders) {
toSerialize["link_auto_reminders"] = o.LinkAutoReminders
}
if !IsNil(o.LinkNotes) {
toSerialize["link_notes"] = o.LinkNotes
}
if !IsNil(o.LinkMeta) {
toSerialize["link_meta"] = o.LinkMeta
}
if !IsNil(o.OrderSplits) {
toSerialize["order_splits"] = o.OrderSplits
}
return toSerialize, nil
}