/
model_link_meta_response_entity.go
62 lines (49 loc) · 1.99 KB
/
model_link_meta_response_entity.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: developers@cashfree.com
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package cashfree_pg
import (
"encoding/json"
"strings"
)
// checks if the LinkMetaResponseEntity type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &LinkMetaResponseEntity{}
// LinkMetaResponseEntity Payment link meta information object
type LinkMetaResponseEntity struct {
// Notification URL for server-server communication. It should be an https URL.
NotifyUrl *string `json:"notify_url,omitempty"`
// If \"true\", link will directly open UPI Intent flow on mobile, and normal link flow elsewhere
UpiIntent *bool `json:"upi_intent,omitempty"`
// The URL to which user will be redirected to after the payment is done on the link. Maximum length: 250.
ReturnUrl *string `json:"return_url,omitempty"`
// Allowed payment modes for this link. Pass comma-separated values among following options - \"cc\", \"dc\", \"ccc\", \"ppc\", \"nb\", \"upi\", \"paypal\", \"app\". Leave it blank to show all available payment methods
PaymentMethods *string `json:"payment_methods,omitempty"`
}
func (o LinkMetaResponseEntity) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LinkMetaResponseEntity) ToMap() (map[string]interface{}, error) {
strings.HasPrefix("cf", "cf")
toSerialize := map[string]interface{}{}
if !IsNil(o.NotifyUrl) {
toSerialize["notify_url"] = o.NotifyUrl
}
if !IsNil(o.UpiIntent) {
toSerialize["upi_intent"] = o.UpiIntent
}
if !IsNil(o.ReturnUrl) {
toSerialize["return_url"] = o.ReturnUrl
}
if !IsNil(o.PaymentMethods) {
toSerialize["payment_methods"] = o.PaymentMethods
}
return toSerialize, nil
}