Skip to content

Latest commit

 

History

History
215 lines (140 loc) · 5.74 KB

File metadata and controls

215 lines (140 loc) · 5.74 KB

\ChargesAPI

All URIs are relative to https://connto.getopenpay.com

Method HTTP request Description
GetCharge Get /charges/{charge_id} Get Charge
ListCharges Post /charges/list List Charges
UpdateCharge Put /charges/{charge_id} Update Charge

GetCharge

ChargeExternal GetCharge(ctx, chargeId).Expand(expand).Execute()

Get Charge

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/getopenpay/getopenpay-go"
)

func main() {
	chargeId := "chargeId_example" // string | 
	expand := []*string{"Inner_example"} // []*string | Fields to expand in the response. Supported values: 'payment_method', 'subscriptions' (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ChargesAPI.GetCharge(context.Background(), chargeId).Expand(expand).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ChargesAPI.GetCharge``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetCharge`: ChargeExternal
	fmt.Fprintf(os.Stdout, "Response from `ChargesAPI.GetCharge`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chargeId string

Other Parameters

Other parameters are passed through a pointer to a apiGetChargeRequest struct via the builder pattern

Name Type Description Notes

expand | []string | Fields to expand in the response. Supported values: 'payment_method', 'subscriptions' |

Return type

ChargeExternal

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListCharges

ListResponseChargeExternal ListCharges(ctx).ChargeQueryParams(chargeQueryParams).Execute()

List Charges

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/getopenpay/getopenpay-go"
)

func main() {
	chargeQueryParams := *openapiclient.NewChargeQueryParams() // ChargeQueryParams | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ChargesAPI.ListCharges(context.Background()).ChargeQueryParams(chargeQueryParams).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ChargesAPI.ListCharges``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListCharges`: ListResponseChargeExternal
	fmt.Fprintf(os.Stdout, "Response from `ChargesAPI.ListCharges`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiListChargesRequest struct via the builder pattern

Name Type Description Notes
chargeQueryParams ChargeQueryParams

Return type

ListResponseChargeExternal

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateCharge

ChargeExternal UpdateCharge(ctx, chargeId).UpdateChargeRequest(updateChargeRequest).Execute()

Update Charge

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/getopenpay/getopenpay-go"
)

func main() {
	chargeId := "chargeId_example" // string | 
	updateChargeRequest := *openapiclient.NewUpdateChargeRequest() // UpdateChargeRequest | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ChargesAPI.UpdateCharge(context.Background(), chargeId).UpdateChargeRequest(updateChargeRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ChargesAPI.UpdateCharge``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `UpdateCharge`: ChargeExternal
	fmt.Fprintf(os.Stdout, "Response from `ChargesAPI.UpdateCharge`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chargeId string

Other Parameters

Other parameters are passed through a pointer to a apiUpdateChargeRequest struct via the builder pattern

Name Type Description Notes

updateChargeRequest | UpdateChargeRequest | |

Return type

ChargeExternal

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]