github.com/Ingenico-ePayments/connect-sdk-go@v0.0.0-20240318153750-1f8cd329b9c9/examples/merchant/files/GetFileExample.go (about)

     1  // This file was auto-generated from the API references found at
     2  // https://epayments-api.developer-ingenico.com/
     3  
     4  package examples
     5  
     6  import (
     7  	"fmt"
     8  	"io"
     9  
    10  	"github.com/Ingenico-ePayments/connect-sdk-go/communicator"
    11  	"github.com/Ingenico-ePayments/connect-sdk-go/communicator/communication"
    12  )
    13  
    14  func getFileExample() {
    15  	client, clientErr := getClient()
    16  	if clientErr != nil {
    17  		panic(clientErr)
    18  	}
    19  	defer client.Close()
    20  
    21  	err := client.Merchant("merchantId").Files().GetFile("fileId", nil, communicator.BodyHandlerFunc(func(headers []communication.Header, bodyReader io.Reader) error {
    22  		// use the headers and body reader, and return any error that occurred
    23  		return nil
    24  	}))
    25  
    26  	fmt.Println(err)
    27  }