Skip to content

Latest commit

 

History

History
157 lines (100 loc) · 4.58 KB

File metadata and controls

157 lines (100 loc) · 4.58 KB

HyperstackApi.PaymentApi

All URIs are relative to https://infrahub-api.nexgencloud.com/v1

Method HTTP request Description
getPaymentReceipt GET /billing/payment/receipt/{payment_id} Retrieve Payment Receipt
initiatePayment POST /billing/payment/payment-initiate POST: Initiate payment
listPaymentDetails GET /billing/payment/payment-details GET: View payment details

getPaymentReceipt

getPaymentReceipt(paymentId)

Retrieve Payment Receipt

Retrieve the payment receipt from Stripe for a specific payment

Example

import HyperstackApi from '@nexgencloud/hyperstack-sdk-javascript';
let defaultClient = HyperstackApi.ApiClient.instance;
// Configure API key authorization: apiKey
let apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

let apiInstance = new HyperstackApi.PaymentApi();
let paymentId = "paymentId_example"; // String | 
apiInstance.getPaymentReceipt(paymentId).then(() => {
  console.log('API called successfully.');
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
paymentId String

Return type

null (empty response body)

Authorization

apiKey

HTTP request headers

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

initiatePayment

PaymentInitiateResponse initiatePayment(payload)

POST: Initiate payment

Creates a payment for a specified amount, adding credit to the balance of your organization. Include the `amount` in the body of the request to make a payment for the specified value in dollars. View a history of past payments by calling the Retrieve Payment History API. For additional information click here.

Example

import HyperstackApi from '@nexgencloud/hyperstack-sdk-javascript';
let defaultClient = HyperstackApi.ApiClient.instance;
// Configure API key authorization: apiKey
let apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

let apiInstance = new HyperstackApi.PaymentApi();
let payload = new HyperstackApi.PaymentInitiatePayload(); // PaymentInitiatePayload | 
apiInstance.initiatePayment(payload).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
payload PaymentInitiatePayload

Return type

PaymentInitiateResponse

Authorization

apiKey

HTTP request headers

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

listPaymentDetails

PaymentDetailsResponse listPaymentDetails()

GET: View payment details

Retrieves a list of all payments made within your organization and their details, including the amount, payment status, and more. For additional information click here.

Example

import HyperstackApi from '@nexgencloud/hyperstack-sdk-javascript';
let defaultClient = HyperstackApi.ApiClient.instance;
// Configure API key authorization: apiKey
let apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

let apiInstance = new HyperstackApi.PaymentApi();
apiInstance.listPaymentDetails().then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

PaymentDetailsResponse

Authorization

apiKey

HTTP request headers

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