-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmodel_authorization_details.go
More file actions
83 lines (70 loc) · 3 KB
/
Copy pathmodel_authorization_details.go
File metadata and controls
83 lines (70 loc) · 3 KB
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
/*
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: 2026-01-01
Contact: developers@cashfree.com
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package cashfree_pg
import (
"encoding/json"
"fmt"
"strings"
)
var _ = fmt.Errorf
// checks if the AuthorizationDetails type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AuthorizationDetails{}
// AuthorizationDetails Details of the authorization done for the subscription. Returned in Get subscription and payments.
type AuthorizationDetails struct {
// Authorization amount for the auth payment. Please note that authorization_amount will always be 0 for ENACH.
AuthorizationAmount *float32 `json:"authorization_amount,omitempty"`
// Indicates whether the authorization amount should be refunded to the customer automatically. Merchants can use this field to specify if the authorized funds should be returned to the customer after authorization of the subscription.
AuthorizationAmountRefund *bool `json:"authorization_amount_refund,omitempty"`
// Authorization reference. UMN for UPI, UMRN for EMandate/Physical Mandate and Enrollment ID for cards.
AuthorizationReference *string `json:"authorization_reference,omitempty"`
// Authorization time. Cashfree stores timestamps in IST.
AuthorizationTime *string `json:"authorization_time,omitempty"`
// Status of the authorization.
AuthorizationStatus *string `json:"authorization_status,omitempty"`
// A unique ID passed by merchant for identifying the transaction.
PaymentId *string `json:"payment_id,omitempty"`
// Payment group used for the authorization.
PaymentGroup *string `json:"payment_group,omitempty"`
PaymentMethod *AuthorizationDetailsPaymentMethod `json:"payment_method,omitempty"`
}
func (o AuthorizationDetails) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AuthorizationDetails) ToMap() (map[string]interface{}, error) {
strings.HasPrefix("cf", "cf")
toSerialize := map[string]interface{}{}
if !IsNil(o.AuthorizationAmount) {
toSerialize["authorization_amount"] = o.AuthorizationAmount
}
if !IsNil(o.AuthorizationAmountRefund) {
toSerialize["authorization_amount_refund"] = o.AuthorizationAmountRefund
}
if !IsNil(o.AuthorizationReference) {
toSerialize["authorization_reference"] = o.AuthorizationReference
}
if !IsNil(o.AuthorizationTime) {
toSerialize["authorization_time"] = o.AuthorizationTime
}
if !IsNil(o.AuthorizationStatus) {
toSerialize["authorization_status"] = o.AuthorizationStatus
}
if !IsNil(o.PaymentId) {
toSerialize["payment_id"] = o.PaymentId
}
if !IsNil(o.PaymentGroup) {
toSerialize["payment_group"] = o.PaymentGroup
}
if !IsNil(o.PaymentMethod) {
toSerialize["payment_method"] = o.PaymentMethod
}
return toSerialize, nil
}