Skip to content

Commit

Permalink
Generated Xendit go SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
xendit-devx-bot committed Feb 13, 2024
1 parent 10680ec commit 651a9f1
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 44 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
{
Expand Down
7 changes: 3 additions & 4 deletions docs/InvoiceApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
Expand All @@ -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
Expand Down
7 changes: 3 additions & 4 deletions docs/PaymentMethodApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down
7 changes: 3 additions & 4 deletions docs/PaymentRequestApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down
7 changes: 3 additions & 4 deletions docs/RefundApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
Expand All @@ -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
Expand Down
22 changes: 11 additions & 11 deletions docs/refund/RefundCallbackData.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| Name | Type | Required | Description | Examples |
|------------|:-------------:|:-------------:|-------------|:-------------:|
| **Id** | **string** | ☑️ | | |
| **PaymentRequestId** | **string** | ☑️ | | |
| **PaymentId** | **string** | ☑️ | | |
| **InvoiceId** | Pointer to **NullableString** | | | |
| **PaymentMethodType** | **string** | ☑️ | | |
| **Amount** | **float64** | ☑️ | | |
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand Down
26 changes: 13 additions & 13 deletions refund/model_refund_callback_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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
Expand Down Expand Up @@ -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).
Expand Down Expand Up @@ -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()
}
Expand Down

0 comments on commit 651a9f1

Please sign in to comment.