Skip to content

Commit 651a9f1

Browse files
author
xendit-devx-bot
committed
Generated Xendit go SDK
1 parent 10680ec commit 651a9f1

10 files changed

+40
-44
lines changed

Diff for: LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017-2023 Xendit
3+
Copyright (c) 2017-2024 Xendit
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
The official Xendit Go SDK provides a simple and convenient way to call Xendit's REST API
66
in applications written in Go.
77

8-
* Package version: 4.1.0
8+
* Package version: 4.2.0
99

1010
# Getting Started
1111

Diff for: client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func (c *APIClient) PrepareRequest(
154154
headerParams["xendit-lib"] = "go"
155155

156156
// TODO: overwrite this line from buddy pipeline
157-
headerParams["xendit-lib-ver"] = "4.1.0"
157+
headerParams["xendit-lib-ver"] = "4.2.0"
158158

159159
var body *bytes.Buffer
160160

Diff for: configuration.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ var Default Configuration = *NewConfiguration()
7878
func NewConfiguration() *Configuration {
7979
cfg := &Configuration{
8080
DefaultHeader: make(map[string]string),
81-
UserAgent: "OpenAPI-Generator/4.1.0/go",
81+
UserAgent: "OpenAPI-Generator/4.2.0/go",
8282
Debug: false,
8383
Servers: ServerConfigurations{
8484
{

Diff for: docs/InvoiceApi.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ Model Documentation: [InvoiceCallback](invoice/InvoiceCallback.md)
356356
#### Usage Example
357357
Note that the example is meant to illustrate the contents of the callback object -- you will not need to instantiate these objects in practice
358358
```go
359-
InvoiceCallbackJson := map[string]interface{}{
359+
InvoiceCallbackJson := `{
360360
"id" : "593f4ed1c3d3bb7f39733d83",
361361
"external_id" : "testing-invoice",
362362
"user_id" : "5848fdf860053555135587e7",
@@ -373,8 +373,7 @@ InvoiceCallbackJson := map[string]interface{}{
373373
"currency" : "IDR",
374374
"payment_channel" : "ALFAMART",
375375
"payment_destination" : "TEST815"
376-
}
377-
jsonData, _ := json.Marshal(InvoiceCallbackJson)
376+
}`
378377
```
379378

380379
You may then use the callback object in your webhook or callback handler like so,
@@ -395,7 +394,7 @@ func main() {
395394

396395
// unmarshal callback object jsonData
397396
var InvoiceCallback invoice.InvoiceCallback
398-
err := json.Unmarshal(jsonData, &InvoiceCallback)
397+
err := json.Unmarshal([]byte(InvoiceCallbackJson), &InvoiceCallback)
399398
if err == nil {
400399
fmt.Fprintf(os.Stdout, "Callback Object ID: %v\n", InvoiceCallback.GetId())
401400
// do things here with the callback

Diff for: docs/PaymentMethodApi.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ Model Documentation: [PaymentMethodCallback](payment_method/PaymentMethodCallbac
672672
#### Usage Example
673673
Note that the example is meant to illustrate the contents of the callback object -- you will not need to instantiate these objects in practice
674674
```go
675-
PaymentMethodCallbackJson := map[string]interface{}{
675+
PaymentMethodCallbackJson := `{
676676
"event" : "payment_method.activated",
677677
"data" : {
678678
"id" : "pm-6ff0b6f2-f5de-457f-b08f-bc98fbae485a",
@@ -710,8 +710,7 @@ PaymentMethodCallbackJson := map[string]interface{}{
710710
},
711711
"created" : "2022-08-12T13:30:59.074277334Z",
712712
"business_id" : "5f27a14a9bf05c73dd040bc8"
713-
}
714-
jsonData, _ := json.Marshal(PaymentMethodCallbackJson)
713+
}`
715714
```
716715

717716
You may then use the callback object in your webhook or callback handler like so,
@@ -732,7 +731,7 @@ func main() {
732731

733732
// unmarshal callback object jsonData
734733
var PaymentMethodCallback payment_method.PaymentMethodCallback
735-
err := json.Unmarshal(jsonData, &PaymentMethodCallback)
734+
err := json.Unmarshal([]byte(PaymentMethodCallbackJson), &PaymentMethodCallback)
736735
if err == nil {
737736
fmt.Fprintf(os.Stdout, "Callback Object ID: %v\n", PaymentMethodCallback.GetId())
738737
// do things here with the callback

Diff for: docs/PaymentRequestApi.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ Model Documentation: [PaymentCallback](payment_request/PaymentCallback.md)
548548
#### Usage Example
549549
Note that the example is meant to illustrate the contents of the callback object -- you will not need to instantiate these objects in practice
550550
```go
551-
PaymentCallbackJson := map[string]interface{}{
551+
PaymentCallbackJson := `{
552552
"event" : "payment.succeeded",
553553
"data" : {
554554
"id" : "ddpy-3cd658ae-25b9-4659-aa36-596ae41a809f",
@@ -604,8 +604,7 @@ PaymentCallbackJson := map[string]interface{}{
604604
"created" : "2022-08-12T13:30:58.986Z",
605605
"business_id" : "5f27a14a9bf05c73dd040bc8",
606606
"api_version" : null
607-
}
608-
jsonData, _ := json.Marshal(PaymentCallbackJson)
607+
}`
609608
```
610609

611610
You may then use the callback object in your webhook or callback handler like so,
@@ -626,7 +625,7 @@ func main() {
626625

627626
// unmarshal callback object jsonData
628627
var PaymentCallback payment_request.PaymentCallback
629-
err := json.Unmarshal(jsonData, &PaymentCallback)
628+
err := json.Unmarshal([]byte(PaymentCallbackJson), &PaymentCallback)
630629
if err == nil {
631630
fmt.Fprintf(os.Stdout, "Callback Object ID: %v\n", PaymentCallback.GetId())
632631
// do things here with the callback

Diff for: docs/RefundApi.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ Model Documentation: [RefundCallback](refund/RefundCallback.md)
333333
#### Usage Example
334334
Note that the example is meant to illustrate the contents of the callback object -- you will not need to instantiate these objects in practice
335335
```go
336-
RefundCallbackJson := map[string]interface{}{
336+
RefundCallbackJson := `{
337337
"event" : "refund.succeeded",
338338
"business_id" : "5f27a14a9bf05c73dd040bc8",
339339
"created" : "2020-08-29T09:12:33.001Z",
@@ -354,8 +354,7 @@ RefundCallbackJson := map[string]interface{}{
354354
"updated" : "2020-08-30T09:12:33.001Z",
355355
"metadata" : null
356356
}
357-
}
358-
jsonData, _ := json.Marshal(RefundCallbackJson)
357+
}`
359358
```
360359

361360
You may then use the callback object in your webhook or callback handler like so,
@@ -376,7 +375,7 @@ func main() {
376375

377376
// unmarshal callback object jsonData
378377
var RefundCallback refund.RefundCallback
379-
err := json.Unmarshal(jsonData, &RefundCallback)
378+
err := json.Unmarshal([]byte(RefundCallbackJson), &RefundCallback)
380379
if err == nil {
381380
fmt.Fprintf(os.Stdout, "Callback Object ID: %v\n", RefundCallback.GetId())
382381
// do things here with the callback

Diff for: docs/refund/RefundCallbackData.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
| Name | Type | Required | Description | Examples |
66
|------------|:-------------:|:-------------:|-------------|:-------------:|
77
| **Id** | **string** | ☑️ | | |
8-
| **PaymentRequestId** | **string** | ☑️ | | |
8+
| **PaymentId** | **string** | ☑️ | | |
99
| **InvoiceId** | Pointer to **NullableString** | | | |
1010
| **PaymentMethodType** | **string** | ☑️ | | |
1111
| **Amount** | **float64** | ☑️ | | |
@@ -25,7 +25,7 @@
2525

2626
### NewRefundCallbackData
2727

28-
`func NewRefundCallbackData(id string, paymentRequestId string, paymentMethodType string, amount float64, channelCode string, status string, reason string, country string, currency string, created string, updated string, ) *RefundCallbackData`
28+
`func NewRefundCallbackData(id string, paymentId string, paymentMethodType string, amount float64, channelCode string, status string, reason string, country string, currency string, created string, updated string, ) *RefundCallbackData`
2929

3030
NewRefundCallbackData instantiates a new RefundCallbackData object
3131
This constructor will assign default values to properties that have it defined,
@@ -60,24 +60,24 @@ and a boolean to check if the value has been set.
6060
SetId sets Id field to given value.
6161

6262

63-
### GetPaymentRequestId
63+
### GetPaymentId
6464

65-
`func (o *RefundCallbackData) GetPaymentRequestId() string`
65+
`func (o *RefundCallbackData) GetPaymentId() string`
6666

67-
GetPaymentRequestId returns the PaymentRequestId field if non-nil, zero value otherwise.
67+
GetPaymentId returns the PaymentId field if non-nil, zero value otherwise.
6868

69-
### GetPaymentRequestIdOk
69+
### GetPaymentIdOk
7070

71-
`func (o *RefundCallbackData) GetPaymentRequestIdOk() (*string, bool)`
71+
`func (o *RefundCallbackData) GetPaymentIdOk() (*string, bool)`
7272

73-
GetPaymentRequestIdOk returns a tuple with the PaymentRequestId field if it's non-nil, zero value otherwise
73+
GetPaymentIdOk returns a tuple with the PaymentId field if it's non-nil, zero value otherwise
7474
and a boolean to check if the value has been set.
7575

76-
### SetPaymentRequestId
76+
### SetPaymentId
7777

78-
`func (o *RefundCallbackData) SetPaymentRequestId(v string)`
78+
`func (o *RefundCallbackData) SetPaymentId(v string)`
7979

80-
SetPaymentRequestId sets PaymentRequestId field to given value.
80+
SetPaymentId sets PaymentId field to given value.
8181

8282

8383
### GetInvoiceId

Diff for: refund/model_refund_callback_data.go

+13-13
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var _ utils.MappedNullable = &RefundCallbackData{}
2121
// RefundCallbackData struct for RefundCallbackData
2222
type RefundCallbackData struct {
2323
Id string `json:"id"`
24-
PaymentRequestId string `json:"payment_request_id"`
24+
PaymentId string `json:"payment_id"`
2525
InvoiceId NullableString `json:"invoice_id,omitempty"`
2626
PaymentMethodType string `json:"payment_method_type"`
2727
Amount float64 `json:"amount"`
@@ -42,10 +42,10 @@ type RefundCallbackData struct {
4242
// This constructor will assign default values to properties that have it defined,
4343
// and makes sure properties required by API are set, but the set of arguments
4444
// will change when the set of required properties is changed
45-
func NewRefundCallbackData(id string, paymentRequestId string, paymentMethodType string, amount float64, channelCode string, status string, reason string, country string, currency string, created string, updated string) *RefundCallbackData {
45+
func NewRefundCallbackData(id string, paymentId string, paymentMethodType string, amount float64, channelCode string, status string, reason string, country string, currency string, created string, updated string) *RefundCallbackData {
4646
this := RefundCallbackData{}
4747
this.Id = id
48-
this.PaymentRequestId = paymentRequestId
48+
this.PaymentId = paymentId
4949
this.PaymentMethodType = paymentMethodType
5050
this.Amount = amount
5151
this.ChannelCode = channelCode
@@ -90,28 +90,28 @@ func (o *RefundCallbackData) SetId(v string) {
9090
o.Id = v
9191
}
9292

93-
// GetPaymentRequestId returns the PaymentRequestId field value
94-
func (o *RefundCallbackData) GetPaymentRequestId() string {
93+
// GetPaymentId returns the PaymentId field value
94+
func (o *RefundCallbackData) GetPaymentId() string {
9595
if o == nil {
9696
var ret string
9797
return ret
9898
}
9999

100-
return o.PaymentRequestId
100+
return o.PaymentId
101101
}
102102

103-
// GetPaymentRequestIdOk returns a tuple with the PaymentRequestId field value
103+
// GetPaymentIdOk returns a tuple with the PaymentId field value
104104
// and a boolean to check if the value has been set.
105-
func (o *RefundCallbackData) GetPaymentRequestIdOk() (*string, bool) {
105+
func (o *RefundCallbackData) GetPaymentIdOk() (*string, bool) {
106106
if o == nil {
107107
return nil, false
108108
}
109-
return &o.PaymentRequestId, true
109+
return &o.PaymentId, true
110110
}
111111

112-
// SetPaymentRequestId sets field value
113-
func (o *RefundCallbackData) SetPaymentRequestId(v string) {
114-
o.PaymentRequestId = v
112+
// SetPaymentId sets field value
113+
func (o *RefundCallbackData) SetPaymentId(v string) {
114+
o.PaymentId = v
115115
}
116116

117117
// GetInvoiceId returns the InvoiceId field value if set, zero value otherwise (both if not set or set to explicit null).
@@ -542,7 +542,7 @@ func (o RefundCallbackData) MarshalJSON() ([]byte, error) {
542542
func (o RefundCallbackData) ToMap() (map[string]interface{}, error) {
543543
toSerialize := map[string]interface{}{}
544544
toSerialize["id"] = o.Id
545-
toSerialize["payment_request_id"] = o.PaymentRequestId
545+
toSerialize["payment_id"] = o.PaymentId
546546
if o.InvoiceId.IsSet() {
547547
toSerialize["invoice_id"] = o.InvoiceId.Get()
548548
}

0 commit comments

Comments
 (0)