Skip to content

Latest commit

 

History

History
627 lines (409 loc) · 18.2 KB

CheckoutApi.md

File metadata and controls

627 lines (409 loc) · 18.2 KB

\CheckoutApi

All URIs are relative to https://api.forestvpn.com/v2

Method HTTP request Description
ApplyCouponCheckoutSession Post /checkout/sessions/{sessionID}/apply_coupon/ Apply coupon to session
CreateCheckoutSession Post /checkout/sessions/ Create checkout session
CreateWaitListRequest Post /checkout/wait-list/ Create request to add country in wait list
ExpireCheckoutSession Post /checkout/sessions/{sessionID}/expire/ Expire checkout session
GetCheckoutSession Get /checkout/sessions/{sessionID}/ Checkout session details
GetStripeCheckoutSession Get /checkout/sessions/{sessionID}/stripe/checkout/session/ Stripe checkout session details
GetStripePaymentIntent Get /checkout/sessions/{sessionID}/stripe/payment/intent/ Stripe payment intent details
ProcessCloudPaymentsAuth Post /checkout/sessions/{sessionID}/cloud-payments/auth/ Cloud payments auth
ProcessCloudPaymentsPost3ds Post /checkout/sessions/{sessionID}/cloud-payments/post3ds/ Cloud payments post3ds

ApplyCouponCheckoutSession

CouponCheckoutSession ApplyCouponCheckoutSession(ctx, sessionID).CreateCouponCheckoutSession(createCouponCheckoutSession).Execute()

Apply coupon to session

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    sessionID := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 
    createCouponCheckoutSession := *openapiclient.NewCreateCouponCheckoutSession("Key_example") // CreateCouponCheckoutSession | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.CheckoutApi.ApplyCouponCheckoutSession(context.Background(), sessionID).CreateCouponCheckoutSession(createCouponCheckoutSession).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `CheckoutApi.ApplyCouponCheckoutSession``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ApplyCouponCheckoutSession`: CouponCheckoutSession
    fmt.Fprintf(os.Stdout, "Response from `CheckoutApi.ApplyCouponCheckoutSession`: %v\n", resp)
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

createCouponCheckoutSession | CreateCouponCheckoutSession | |

Return type

CouponCheckoutSession

Authorization

bearerAuth

HTTP request headers

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

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

CreateCheckoutSession

CheckoutSession CreateCheckoutSession(ctx).CreateCheckoutSessionRequest(createCheckoutSessionRequest).Execute()

Create checkout session

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    createCheckoutSessionRequest := *openapiclient.NewCreateCheckoutSessionRequest("CancelUrl_example", "SuccessUrl_example", []openapiclient.CreateCheckoutSessionProduct{*openapiclient.NewCreateCheckoutSessionProduct("Product_example", int32(123))}) // CreateCheckoutSessionRequest |  (optional)

    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`: CheckoutSession
    fmt.Fprintf(os.Stdout, "Response from `CheckoutApi.CreateCheckoutSession`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
createCheckoutSessionRequest CreateCheckoutSessionRequest

Return type

CheckoutSession

Authorization

bearerAuth

HTTP request headers

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

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

CreateWaitListRequest

CreateWaitListRequest(ctx).XCountry(xCountry).Execute()

Create request to add country in wait list

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    xCountry := "xCountry_example" // string |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.CheckoutApi.CreateWaitListRequest(context.Background()).XCountry(xCountry).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `CheckoutApi.CreateWaitListRequest``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Other Parameters

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

Name Type Description Notes
xCountry string

Return type

(empty response body)

Authorization

bearerAuth

HTTP request headers

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

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

ExpireCheckoutSession

ExpireCheckoutSession(ctx, sessionID).Execute()

Expire checkout session

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    sessionID := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.CheckoutApi.ExpireCheckoutSession(context.Background(), sessionID).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `CheckoutApi.ExpireCheckoutSession``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

bearerAuth

HTTP request headers

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

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

GetCheckoutSession

CheckoutSession GetCheckoutSession(ctx, sessionID).Execute()

Checkout session details

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    sessionID := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 

    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`: CheckoutSession
    fmt.Fprintf(os.Stdout, "Response from `CheckoutApi.GetCheckoutSession`: %v\n", resp)
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

CheckoutSession

Authorization

bearerAuth

HTTP request headers

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

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

GetStripeCheckoutSession

StripeCheckoutSession GetStripeCheckoutSession(ctx, sessionID).Execute()

Stripe checkout session details

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    sessionID := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

StripeCheckoutSession

Authorization

bearerAuth

HTTP request headers

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

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

GetStripePaymentIntent

StripePaymentIntent GetStripePaymentIntent(ctx, sessionID).UseStripeSdk(useStripeSdk).ReturnUrl(returnUrl).Execute()

Stripe payment intent details

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    sessionID := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 
    useStripeSdk := true // bool |  (optional)
    returnUrl := "returnUrl_example" // string |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.CheckoutApi.GetStripePaymentIntent(context.Background(), sessionID).UseStripeSdk(useStripeSdk).ReturnUrl(returnUrl).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `CheckoutApi.GetStripePaymentIntent``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetStripePaymentIntent`: StripePaymentIntent
    fmt.Fprintf(os.Stdout, "Response from `CheckoutApi.GetStripePaymentIntent`: %v\n", resp)
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

useStripeSdk | bool | | returnUrl | string | |

Return type

StripePaymentIntent

Authorization

bearerAuth

HTTP request headers

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

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

ProcessCloudPaymentsAuth

CloudPaymentsAuth ProcessCloudPaymentsAuth(ctx, sessionID).CreateCloudPaymentsAuth(createCloudPaymentsAuth).Execute()

Cloud payments auth

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    sessionID := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 
    createCloudPaymentsAuth := *openapiclient.NewCreateCloudPaymentsAuth("Cryptogram_example", "Name_example") // CreateCloudPaymentsAuth | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.CheckoutApi.ProcessCloudPaymentsAuth(context.Background(), sessionID).CreateCloudPaymentsAuth(createCloudPaymentsAuth).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `CheckoutApi.ProcessCloudPaymentsAuth``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ProcessCloudPaymentsAuth`: CloudPaymentsAuth
    fmt.Fprintf(os.Stdout, "Response from `CheckoutApi.ProcessCloudPaymentsAuth`: %v\n", resp)
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

createCloudPaymentsAuth | CreateCloudPaymentsAuth | |

Return type

CloudPaymentsAuth

Authorization

bearerAuth

HTTP request headers

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

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

ProcessCloudPaymentsPost3ds

CloudPaymentsPost3ds ProcessCloudPaymentsPost3ds(ctx, sessionID).CreateCloudPaymentsPost3ds(createCloudPaymentsPost3ds).Execute()

Cloud payments post3ds

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    sessionID := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 
    createCloudPaymentsPost3ds := *openapiclient.NewCreateCloudPaymentsPost3ds("PaRes_example") // CreateCloudPaymentsPost3ds | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.CheckoutApi.ProcessCloudPaymentsPost3ds(context.Background(), sessionID).CreateCloudPaymentsPost3ds(createCloudPaymentsPost3ds).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `CheckoutApi.ProcessCloudPaymentsPost3ds``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ProcessCloudPaymentsPost3ds`: CloudPaymentsPost3ds
    fmt.Fprintf(os.Stdout, "Response from `CheckoutApi.ProcessCloudPaymentsPost3ds`: %v\n", resp)
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

createCloudPaymentsPost3ds | CreateCloudPaymentsPost3ds | |

Return type

CloudPaymentsPost3ds

Authorization

bearerAuth

HTTP request headers

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

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