All URIs are relative to https://connto.getopenpay.com
| Method | HTTP request | Description |
|---|---|---|
| CreateCheckoutSession | Post /checkout/sessions | Create Checkout Session |
| GetCheckoutSession | Get /checkout/sessions/{session_id} | Get Checkout Session |
| ListCheckoutSessions | Post /checkout/list | List Checkout Sessions |
| ValidateCheckoutAttempt | Get /checkout/checkout_attempts/validate/{checkout_attempt_id} | Validate Checkout Attempt |
| VerifyCheckoutSessionPaymentMethod | Get /checkout/sessions/{checkout_secure_token}/verify_payment_method/{payment_method_id} | Verify Checkout Session Payment Method |
CheckoutSessionExternal CreateCheckoutSession(ctx).CreateCheckoutSessionRequest(createCheckoutSessionRequest).Execute()
Create Checkout Session
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/getopenpay/getopenpay-go"
)
func main() {
createCheckoutSessionRequest := *openapiclient.NewCreateCheckoutSessionRequest(openapiclient.CheckoutMode("payment")) // CreateCheckoutSessionRequest |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CheckoutAPI.CreateCheckoutSession(context.Background()).CreateCheckoutSessionRequest(createCheckoutSessionRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CheckoutAPI.CreateCheckoutSession``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateCheckoutSession`: CheckoutSessionExternal
fmt.Fprintf(os.Stdout, "Response from `CheckoutAPI.CreateCheckoutSession`: %v\n", resp)
}Other parameters are passed through a pointer to a apiCreateCheckoutSessionRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| createCheckoutSessionRequest | CreateCheckoutSessionRequest |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CheckoutSessionExternal GetCheckoutSession(ctx, sessionId).Execute()
Get Checkout Session
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/getopenpay/getopenpay-go"
)
func main() {
sessionId := "cs_dev_abc123" // string | Unique identifier of the checkout session.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CheckoutAPI.GetCheckoutSession(context.Background(), sessionId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CheckoutAPI.GetCheckoutSession``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetCheckoutSession`: CheckoutSessionExternal
fmt.Fprintf(os.Stdout, "Response from `CheckoutAPI.GetCheckoutSession`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| sessionId | string | Unique identifier of the checkout session. |
Other parameters are passed through a pointer to a apiGetCheckoutSessionRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListResponseCheckoutSessionExternal ListCheckoutSessions(ctx).CheckoutSessionQueryParams(checkoutSessionQueryParams).Execute()
List Checkout Sessions
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/getopenpay/getopenpay-go"
)
func main() {
checkoutSessionQueryParams := *openapiclient.NewCheckoutSessionQueryParams() // CheckoutSessionQueryParams |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CheckoutAPI.ListCheckoutSessions(context.Background()).CheckoutSessionQueryParams(checkoutSessionQueryParams).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CheckoutAPI.ListCheckoutSessions``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListCheckoutSessions`: ListResponseCheckoutSessionExternal
fmt.Fprintf(os.Stdout, "Response from `CheckoutAPI.ListCheckoutSessions`: %v\n", resp)
}Other parameters are passed through a pointer to a apiListCheckoutSessionsRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| checkoutSessionQueryParams | CheckoutSessionQueryParams |
ListResponseCheckoutSessionExternal
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CheckoutSuccessResponse ValidateCheckoutAttempt(ctx, checkoutAttemptId).Execute()
Validate Checkout Attempt
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/getopenpay/getopenpay-go"
)
func main() {
checkoutAttemptId := "catt_dev_abc123" // string | The checkout attempt ID
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CheckoutAPI.ValidateCheckoutAttempt(context.Background(), checkoutAttemptId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CheckoutAPI.ValidateCheckoutAttempt``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ValidateCheckoutAttempt`: CheckoutSuccessResponse
fmt.Fprintf(os.Stdout, "Response from `CheckoutAPI.ValidateCheckoutAttempt`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| checkoutAttemptId | string | The checkout attempt ID |
Other parameters are passed through a pointer to a apiValidateCheckoutAttemptRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CheckoutSessionExternal VerifyCheckoutSessionPaymentMethod(ctx, checkoutSecureToken, paymentMethodId).Execute()
Verify Checkout Session Payment Method
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/getopenpay/getopenpay-go"
)
func main() {
checkoutSecureToken := "00000000-aaaa-bbbb-cccc-dddddddddddd" // string | The checkout session's secure token
paymentMethodId := "cc_dev_abc123" // string | The payment method ID to verify
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CheckoutAPI.VerifyCheckoutSessionPaymentMethod(context.Background(), checkoutSecureToken, paymentMethodId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CheckoutAPI.VerifyCheckoutSessionPaymentMethod``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `VerifyCheckoutSessionPaymentMethod`: CheckoutSessionExternal
fmt.Fprintf(os.Stdout, "Response from `CheckoutAPI.VerifyCheckoutSessionPaymentMethod`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| checkoutSecureToken | string | The checkout session's secure token | |
| paymentMethodId | string | The payment method ID to verify |
Other parameters are passed through a pointer to a apiVerifyCheckoutSessionPaymentMethodRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]