Skip to content

Latest commit

 

History

History
79 lines (62 loc) · 4.77 KB

File metadata and controls

79 lines (62 loc) · 4.77 KB

Buyers.PaymentMethods

Overview

Available Operations

  • List - List payment methods for a buyer

List

List all the stored payment methods for a specific buyer.

Example Usage

package main

import(
	"context"
	"os"
	gr4vygo "github.com/gr4vy/gr4vy-go"
	"github.com/gr4vy/gr4vy-go/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := gr4vygo.New(
        gr4vygo.WithMerchantAccountID("default"),
        gr4vygo.WithSecurity(os.Getenv("GR4VY_BEARER_AUTH")),
    )

    res, err := s.Buyers.PaymentMethods.List(ctx, operations.ListBuyerPaymentMethodsRequest{
        BuyerID: gr4vygo.Pointer("fe26475d-ec3e-4884-9553-f7356683f7f9"),
        BuyerExternalIdentifier: gr4vygo.Pointer("buyer-12345"),
        SortBy: operations.ListBuyerPaymentMethodsSortByLastUsedAt.ToPointer(),
        Country: gr4vygo.Pointer("US"),
        Currency: gr4vygo.Pointer("USD"),
    })
    if err != nil {
        log.Fatal(err)
    }
    if res != nil {
        // handle response
    }
}

Parameters

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

Response

*components.PaymentMethodSummaries, error

Errors

Error Type Status Code Content Type
apierrors.Error400 400 application/json
apierrors.Error401 401 application/json
apierrors.Error403 403 application/json
apierrors.Error404 404 application/json
apierrors.Error405 405 application/json
apierrors.Error409 409 application/json
apierrors.HTTPValidationError 422 application/json
apierrors.Error425 425 application/json
apierrors.Error429 429 application/json
apierrors.Error500 500 application/json
apierrors.Error502 502 application/json
apierrors.Error504 504 application/json
apierrors.APIError 4XX, 5XX */*