Skip to content

Latest commit

 

History

History
110 lines (86 loc) · 5.89 KB

README.md

File metadata and controls

110 lines (86 loc) · 5.89 KB

Refund

(Refund)

Available Operations

GetPaymentRefund

Retrieve a refund

Example Usage

package main

import(
	"os"
	unifiedgosdk "github.com/unified-to/unified-go-sdk"
	"github.com/unified-to/unified-go-sdk/pkg/models/operations"
	"context"
	"log"
)

func main() {
    s := unifiedgosdk.New(
        unifiedgosdk.WithSecurity(os.Getenv("JWT")),
    )
    request := operations.GetPaymentRefundRequest{
        ConnectionID: "<value>",
        ID: "<id>",
    }
    ctx := context.Background()
    res, err := s.Refund.GetPaymentRefund(ctx, request)
    if err != nil {
        log.Fatal(err)
    }
    if res.PaymentRefund != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.GetPaymentRefundRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.GetPaymentRefundResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

ListPaymentRefunds

List all refunds

Example Usage

package main

import(
	"os"
	unifiedgosdk "github.com/unified-to/unified-go-sdk"
	"github.com/unified-to/unified-go-sdk/pkg/models/operations"
	"context"
	"log"
)

func main() {
    s := unifiedgosdk.New(
        unifiedgosdk.WithSecurity(os.Getenv("JWT")),
    )
    request := operations.ListPaymentRefundsRequest{
        ConnectionID: "<value>",
    }
    ctx := context.Background()
    res, err := s.Refund.ListPaymentRefunds(ctx, request)
    if err != nil {
        log.Fatal(err)
    }
    if res.PaymentRefunds != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.ListPaymentRefundsRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.ListPaymentRefundsResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /