-
Notifications
You must be signed in to change notification settings - Fork 4
/
model_create_subscription_refund_request.go
71 lines (58 loc) · 2.29 KB
/
model_create_subscription_refund_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
/*
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 CreateSubscriptionRefundRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CreateSubscriptionRefundRequest{}
// CreateSubscriptionRefundRequest Request body to create a subscription refund.
type CreateSubscriptionRefundRequest struct {
// A unique ID passed by merchant for identifying the subscription.
SubscriptionId string `json:"subscription_id"`
// A unique ID passed by merchant for identifying the transaction.
PaymentId *string `json:"payment_id,omitempty"`
// Cashfree subscription payment reference number.
CfPaymentId *string `json:"cf_payment_id,omitempty"`
// A unique ID passed by merchant for identifying the refund.
RefundId string `json:"refund_id"`
// The amount to be refunded. Can be partial or full amount of the payment.
RefundAmount float32 `json:"refund_amount"`
// Refund note.
RefundNote *string `json:"refund_note,omitempty"`
// Refund speed. Can be INSTANT or STANDARD. UPI supports only STANDARD refunds, Enach and Pnach supports only INSTANT refunds.
RefundSpeed *string `json:"refund_speed,omitempty"`
}
func (o CreateSubscriptionRefundRequest) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CreateSubscriptionRefundRequest) ToMap() (map[string]interface{}, error) {
strings.HasPrefix("cf", "cf")
toSerialize := map[string]interface{}{}
toSerialize["subscription_id"] = o.SubscriptionId
if !IsNil(o.PaymentId) {
toSerialize["payment_id"] = o.PaymentId
}
if !IsNil(o.CfPaymentId) {
toSerialize["cf_payment_id"] = o.CfPaymentId
}
toSerialize["refund_id"] = o.RefundId
toSerialize["refund_amount"] = o.RefundAmount
if !IsNil(o.RefundNote) {
toSerialize["refund_note"] = o.RefundNote
}
if !IsNil(o.RefundSpeed) {
toSerialize["refund_speed"] = o.RefundSpeed
}
return toSerialize, nil
}