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 |
ChargeExternal GetCharge(ctx, chargeId).Expand(expand).Execute()
Get Charge
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)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| chargeId | string |
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' |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListResponseChargeExternal ListCharges(ctx).ChargeQueryParams(chargeQueryParams).Execute()
List Charges
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)
}Other parameters are passed through a pointer to a apiListChargesRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| chargeQueryParams | ChargeQueryParams |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ChargeExternal UpdateCharge(ctx, chargeId).UpdateChargeRequest(updateChargeRequest).Execute()
Update Charge
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)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| chargeId | string |
Other parameters are passed through a pointer to a apiUpdateChargeRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
updateChargeRequest | UpdateChargeRequest | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]