Skip to content

Latest commit

 

History

History
208 lines (130 loc) · 5.17 KB

PaymentAPI.md

File metadata and controls

208 lines (130 loc) · 5.17 KB

\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

PaymentReceiptResponse GetPaymentReceipt(ctx, paymentId).Execute()

Retrieve Payment Receipt

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)

func main() {
	paymentId := "paymentId_example" // string | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

PaymentReceiptResponse

Authorization

apiKey

HTTP request headers

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

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

InitiatePayment

PaymentInitiateResponse InitiatePayment(ctx).Payload(payload).Execute()

POST: Initiate payment

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)

func main() {
	payload := *openapiclient.NewPaymentInitiatePayload(float32(123)) // PaymentInitiatePayload | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
payload PaymentInitiatePayload

Return type

PaymentInitiateResponse

Authorization

apiKey

HTTP request headers

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

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

ListPaymentDetails

PaymentDetailsResponse ListPaymentDetails(ctx).Execute()

GET: View payment details

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

PaymentDetailsResponse

Authorization

apiKey

HTTP request headers

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

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