Skip to content

Latest commit

 

History

History
426 lines (295 loc) · 13.8 KB

CheckoutApi.md

File metadata and controls

426 lines (295 loc) · 13.8 KB

forestvpn_api.api.CheckoutApi

Load the API package

import 'package:forestvpn_api/api.dart';

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(sessionID, createCouponCheckoutSession)

Apply coupon to session

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getCheckoutApi();
final String sessionID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final CreateCouponCheckoutSession createCouponCheckoutSession = ; // CreateCouponCheckoutSession | 

try {
    final response = api.applyCouponCheckoutSession(sessionID, createCouponCheckoutSession);
    print(response);
} catch on DioError (e) {
    print('Exception when calling CheckoutApi->applyCouponCheckoutSession: $e\n');
}

Parameters

Name Type Description Notes
sessionID String
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(createCheckoutSessionRequest)

Create checkout session

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getCheckoutApi();
final CreateCheckoutSessionRequest createCheckoutSessionRequest = ; // CreateCheckoutSessionRequest | 

try {
    final response = api.createCheckoutSession(createCheckoutSessionRequest);
    print(response);
} catch on DioError (e) {
    print('Exception when calling CheckoutApi->createCheckoutSession: $e\n');
}

Parameters

Name Type Description Notes
createCheckoutSessionRequest CreateCheckoutSessionRequest [optional]

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(xCountry)

Create request to add country in wait list

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getCheckoutApi();
final String xCountry = xCountry_example; // String | 

try {
    api.createWaitListRequest(xCountry);
} catch on DioError (e) {
    print('Exception when calling CheckoutApi->createWaitListRequest: $e\n');
}

Parameters

Name Type Description Notes
xCountry String [optional]

Return type

void (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(sessionID)

Expire checkout session

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getCheckoutApi();
final String sessionID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 

try {
    api.expireCheckoutSession(sessionID);
} catch on DioError (e) {
    print('Exception when calling CheckoutApi->expireCheckoutSession: $e\n');
}

Parameters

Name Type Description Notes
sessionID String

Return type

void (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(sessionID)

Checkout session details

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getCheckoutApi();
final String sessionID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 

try {
    final response = api.getCheckoutSession(sessionID);
    print(response);
} catch on DioError (e) {
    print('Exception when calling CheckoutApi->getCheckoutSession: $e\n');
}

Parameters

Name Type Description Notes
sessionID String

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(sessionID)

Stripe checkout session details

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getCheckoutApi();
final String sessionID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 

try {
    final response = api.getStripeCheckoutSession(sessionID);
    print(response);
} catch on DioError (e) {
    print('Exception when calling CheckoutApi->getStripeCheckoutSession: $e\n');
}

Parameters

Name Type Description Notes
sessionID String

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(sessionID, useStripeSdk, returnUrl)

Stripe payment intent details

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getCheckoutApi();
final String sessionID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final bool useStripeSdk = true; // bool | 
final String returnUrl = returnUrl_example; // String | 

try {
    final response = api.getStripePaymentIntent(sessionID, useStripeSdk, returnUrl);
    print(response);
} catch on DioError (e) {
    print('Exception when calling CheckoutApi->getStripePaymentIntent: $e\n');
}

Parameters

Name Type Description Notes
sessionID String
useStripeSdk bool [optional]
returnUrl String [optional]

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(sessionID, createCloudPaymentsAuth)

Cloud payments auth

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getCheckoutApi();
final String sessionID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final CreateCloudPaymentsAuth createCloudPaymentsAuth = ; // CreateCloudPaymentsAuth | 

try {
    final response = api.processCloudPaymentsAuth(sessionID, createCloudPaymentsAuth);
    print(response);
} catch on DioError (e) {
    print('Exception when calling CheckoutApi->processCloudPaymentsAuth: $e\n');
}

Parameters

Name Type Description Notes
sessionID String
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(sessionID, createCloudPaymentsPost3ds)

Cloud payments post3ds

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getCheckoutApi();
final String sessionID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final CreateCloudPaymentsPost3ds createCloudPaymentsPost3ds = ; // CreateCloudPaymentsPost3ds | 

try {
    final response = api.processCloudPaymentsPost3ds(sessionID, createCloudPaymentsPost3ds);
    print(response);
} catch on DioError (e) {
    print('Exception when calling CheckoutApi->processCloudPaymentsPost3ds: $e\n');
}

Parameters

Name Type Description Notes
sessionID String
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]