diff --git a/LICENSE b/LICENSE index 0d37b6c5..74911bc5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017-2023 Xendit +Copyright (c) 2017-2024 Xendit Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index c719f128..6ef9f670 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ The official Xendit Go SDK provides a simple and convenient way to call Xendit's REST API in applications written in Go. -* Package version: 4.1.0 +* Package version: 4.2.0 # Getting Started diff --git a/client.go b/client.go index f8044064..eb6fb22f 100644 --- a/client.go +++ b/client.go @@ -154,7 +154,7 @@ func (c *APIClient) PrepareRequest( headerParams["xendit-lib"] = "go" // TODO: overwrite this line from buddy pipeline - headerParams["xendit-lib-ver"] = "4.1.0" + headerParams["xendit-lib-ver"] = "4.2.0" var body *bytes.Buffer diff --git a/configuration.go b/configuration.go index d0238dc8..7a59e50e 100644 --- a/configuration.go +++ b/configuration.go @@ -78,7 +78,7 @@ var Default Configuration = *NewConfiguration() func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/4.1.0/go", + UserAgent: "OpenAPI-Generator/4.2.0/go", Debug: false, Servers: ServerConfigurations{ { diff --git a/docs/InvoiceApi.md b/docs/InvoiceApi.md index 4982bf6e..30d26ee2 100644 --- a/docs/InvoiceApi.md +++ b/docs/InvoiceApi.md @@ -356,7 +356,7 @@ Model Documentation: [InvoiceCallback](invoice/InvoiceCallback.md) #### Usage Example Note that the example is meant to illustrate the contents of the callback object -- you will not need to instantiate these objects in practice ```go -InvoiceCallbackJson := map[string]interface{}{ +InvoiceCallbackJson := `{ "id" : "593f4ed1c3d3bb7f39733d83", "external_id" : "testing-invoice", "user_id" : "5848fdf860053555135587e7", @@ -373,8 +373,7 @@ InvoiceCallbackJson := map[string]interface{}{ "currency" : "IDR", "payment_channel" : "ALFAMART", "payment_destination" : "TEST815" -} -jsonData, _ := json.Marshal(InvoiceCallbackJson) +}` ``` You may then use the callback object in your webhook or callback handler like so, @@ -395,7 +394,7 @@ func main() { // unmarshal callback object jsonData var InvoiceCallback invoice.InvoiceCallback - err := json.Unmarshal(jsonData, &InvoiceCallback) + err := json.Unmarshal([]byte(InvoiceCallbackJson), &InvoiceCallback) if err == nil { fmt.Fprintf(os.Stdout, "Callback Object ID: %v\n", InvoiceCallback.GetId()) // do things here with the callback diff --git a/docs/PaymentMethodApi.md b/docs/PaymentMethodApi.md index 74391400..3f0b320b 100644 --- a/docs/PaymentMethodApi.md +++ b/docs/PaymentMethodApi.md @@ -672,7 +672,7 @@ Model Documentation: [PaymentMethodCallback](payment_method/PaymentMethodCallbac #### Usage Example Note that the example is meant to illustrate the contents of the callback object -- you will not need to instantiate these objects in practice ```go -PaymentMethodCallbackJson := map[string]interface{}{ +PaymentMethodCallbackJson := `{ "event" : "payment_method.activated", "data" : { "id" : "pm-6ff0b6f2-f5de-457f-b08f-bc98fbae485a", @@ -710,8 +710,7 @@ PaymentMethodCallbackJson := map[string]interface{}{ }, "created" : "2022-08-12T13:30:59.074277334Z", "business_id" : "5f27a14a9bf05c73dd040bc8" -} -jsonData, _ := json.Marshal(PaymentMethodCallbackJson) +}` ``` You may then use the callback object in your webhook or callback handler like so, @@ -732,7 +731,7 @@ func main() { // unmarshal callback object jsonData var PaymentMethodCallback payment_method.PaymentMethodCallback - err := json.Unmarshal(jsonData, &PaymentMethodCallback) + err := json.Unmarshal([]byte(PaymentMethodCallbackJson), &PaymentMethodCallback) if err == nil { fmt.Fprintf(os.Stdout, "Callback Object ID: %v\n", PaymentMethodCallback.GetId()) // do things here with the callback diff --git a/docs/PaymentRequestApi.md b/docs/PaymentRequestApi.md index 2b92fa38..81b83203 100644 --- a/docs/PaymentRequestApi.md +++ b/docs/PaymentRequestApi.md @@ -548,7 +548,7 @@ Model Documentation: [PaymentCallback](payment_request/PaymentCallback.md) #### Usage Example Note that the example is meant to illustrate the contents of the callback object -- you will not need to instantiate these objects in practice ```go -PaymentCallbackJson := map[string]interface{}{ +PaymentCallbackJson := `{ "event" : "payment.succeeded", "data" : { "id" : "ddpy-3cd658ae-25b9-4659-aa36-596ae41a809f", @@ -604,8 +604,7 @@ PaymentCallbackJson := map[string]interface{}{ "created" : "2022-08-12T13:30:58.986Z", "business_id" : "5f27a14a9bf05c73dd040bc8", "api_version" : null -} -jsonData, _ := json.Marshal(PaymentCallbackJson) +}` ``` You may then use the callback object in your webhook or callback handler like so, @@ -626,7 +625,7 @@ func main() { // unmarshal callback object jsonData var PaymentCallback payment_request.PaymentCallback - err := json.Unmarshal(jsonData, &PaymentCallback) + err := json.Unmarshal([]byte(PaymentCallbackJson), &PaymentCallback) if err == nil { fmt.Fprintf(os.Stdout, "Callback Object ID: %v\n", PaymentCallback.GetId()) // do things here with the callback diff --git a/docs/RefundApi.md b/docs/RefundApi.md index d73a26f3..6e65d214 100644 --- a/docs/RefundApi.md +++ b/docs/RefundApi.md @@ -333,7 +333,7 @@ Model Documentation: [RefundCallback](refund/RefundCallback.md) #### Usage Example Note that the example is meant to illustrate the contents of the callback object -- you will not need to instantiate these objects in practice ```go -RefundCallbackJson := map[string]interface{}{ +RefundCallbackJson := `{ "event" : "refund.succeeded", "business_id" : "5f27a14a9bf05c73dd040bc8", "created" : "2020-08-29T09:12:33.001Z", @@ -354,8 +354,7 @@ RefundCallbackJson := map[string]interface{}{ "updated" : "2020-08-30T09:12:33.001Z", "metadata" : null } -} -jsonData, _ := json.Marshal(RefundCallbackJson) +}` ``` You may then use the callback object in your webhook or callback handler like so, @@ -376,7 +375,7 @@ func main() { // unmarshal callback object jsonData var RefundCallback refund.RefundCallback - err := json.Unmarshal(jsonData, &RefundCallback) + err := json.Unmarshal([]byte(RefundCallbackJson), &RefundCallback) if err == nil { fmt.Fprintf(os.Stdout, "Callback Object ID: %v\n", RefundCallback.GetId()) // do things here with the callback diff --git a/docs/refund/RefundCallbackData.md b/docs/refund/RefundCallbackData.md index 63a805f4..8fedafb4 100644 --- a/docs/refund/RefundCallbackData.md +++ b/docs/refund/RefundCallbackData.md @@ -5,7 +5,7 @@ | Name | Type | Required | Description | Examples | |------------|:-------------:|:-------------:|-------------|:-------------:| | **Id** | **string** | ☑️ | | | -| **PaymentRequestId** | **string** | ☑️ | | | +| **PaymentId** | **string** | ☑️ | | | | **InvoiceId** | Pointer to **NullableString** | | | | | **PaymentMethodType** | **string** | ☑️ | | | | **Amount** | **float64** | ☑️ | | | @@ -25,7 +25,7 @@ ### NewRefundCallbackData -`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` +`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` NewRefundCallbackData instantiates a new RefundCallbackData object 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. SetId sets Id field to given value. -### GetPaymentRequestId +### GetPaymentId -`func (o *RefundCallbackData) GetPaymentRequestId() string` +`func (o *RefundCallbackData) GetPaymentId() string` -GetPaymentRequestId returns the PaymentRequestId field if non-nil, zero value otherwise. +GetPaymentId returns the PaymentId field if non-nil, zero value otherwise. -### GetPaymentRequestIdOk +### GetPaymentIdOk -`func (o *RefundCallbackData) GetPaymentRequestIdOk() (*string, bool)` +`func (o *RefundCallbackData) GetPaymentIdOk() (*string, bool)` -GetPaymentRequestIdOk returns a tuple with the PaymentRequestId field if it's non-nil, zero value otherwise +GetPaymentIdOk returns a tuple with the PaymentId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetPaymentRequestId +### SetPaymentId -`func (o *RefundCallbackData) SetPaymentRequestId(v string)` +`func (o *RefundCallbackData) SetPaymentId(v string)` -SetPaymentRequestId sets PaymentRequestId field to given value. +SetPaymentId sets PaymentId field to given value. ### GetInvoiceId diff --git a/refund/model_refund_callback_data.go b/refund/model_refund_callback_data.go index fd2b6bb7..2efe2853 100644 --- a/refund/model_refund_callback_data.go +++ b/refund/model_refund_callback_data.go @@ -21,7 +21,7 @@ var _ utils.MappedNullable = &RefundCallbackData{} // RefundCallbackData struct for RefundCallbackData type RefundCallbackData struct { Id string `json:"id"` - PaymentRequestId string `json:"payment_request_id"` + PaymentId string `json:"payment_id"` InvoiceId NullableString `json:"invoice_id,omitempty"` PaymentMethodType string `json:"payment_method_type"` Amount float64 `json:"amount"` @@ -42,10 +42,10 @@ type RefundCallbackData struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -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 { +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 { this := RefundCallbackData{} this.Id = id - this.PaymentRequestId = paymentRequestId + this.PaymentId = paymentId this.PaymentMethodType = paymentMethodType this.Amount = amount this.ChannelCode = channelCode @@ -90,28 +90,28 @@ func (o *RefundCallbackData) SetId(v string) { o.Id = v } -// GetPaymentRequestId returns the PaymentRequestId field value -func (o *RefundCallbackData) GetPaymentRequestId() string { +// GetPaymentId returns the PaymentId field value +func (o *RefundCallbackData) GetPaymentId() string { if o == nil { var ret string return ret } - return o.PaymentRequestId + return o.PaymentId } -// GetPaymentRequestIdOk returns a tuple with the PaymentRequestId field value +// GetPaymentIdOk returns a tuple with the PaymentId field value // and a boolean to check if the value has been set. -func (o *RefundCallbackData) GetPaymentRequestIdOk() (*string, bool) { +func (o *RefundCallbackData) GetPaymentIdOk() (*string, bool) { if o == nil { return nil, false } - return &o.PaymentRequestId, true + return &o.PaymentId, true } -// SetPaymentRequestId sets field value -func (o *RefundCallbackData) SetPaymentRequestId(v string) { - o.PaymentRequestId = v +// SetPaymentId sets field value +func (o *RefundCallbackData) SetPaymentId(v string) { + o.PaymentId = v } // 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) { func (o RefundCallbackData) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["id"] = o.Id - toSerialize["payment_request_id"] = o.PaymentRequestId + toSerialize["payment_id"] = o.PaymentId if o.InvoiceId.IsSet() { toSerialize["invoice_id"] = o.InvoiceId.Get() }