# Packages
# README
Quick start
-
Go into
sanity_test.go
and replaceTODO_ADD_BEARER_KEY
with your secret token
go build
go test -v
Go API client for getopenpay
super charge your subscription management.
Overview
This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.
- API version: 1.0.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen
Installation
Install the following dependencies:
go get github.com/stretchr/testify/assert
go get golang.org/x/net/context
Put the package under your project folder and add the following in import:
import getopenpay "github.com/getopenpay/getopenpay-go"
To use a proxy, set the environment variable HTTP_PROXY
:
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
Configuration of Server URL
Default configuration comes with Servers
field that contains server objects as defined in the OpenAPI specification.
Select Server Configuration
For using other server than the one defined on index 0 set context value getopenpay.ContextServerIndex
of type int
.
ctx := context.WithValue(context.Background(), getopenpay.ContextServerIndex, 1)
Templated Server URL
Templated server URL is formatted using default variables from configuration or from context value getopenpay.ContextServerVariables
of type map[string]string
.
ctx := context.WithValue(context.Background(), getopenpay.ContextServerVariables, map[string]string{
"basePath": "v2",
})
Note, enum values are always validated and all unused variables are silently ignored.
URLs Configuration per Operation
Each operation can use different server URL defined using OperationServers
map in the Configuration
.
An operation is uniquely identified by "{classname}Service.{nickname}"
string.
Similar rules for overriding default operation server index and variables applies by using getopenpay.ContextOperationServerIndices
and getopenpay.ContextOperationServerVariables
context maps.
ctx := context.WithValue(context.Background(), getopenpay.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), getopenpay.ContextOperationServerVariables, map[string]map[string]string{
"{classname}Service.{nickname}": {
"port": "8443",
},
})
Documentation for API Endpoints
All URIs are relative to https://connto.getopenpay.com
Class | Method | HTTP request | Description |
---|---|---|---|
BillingPortalAPI | CreatePortalSession | Post /billing_portal/sessions | Create Portal Session |
ChargesAPI | GetCharge | Get /charges/{charge_id} | Get Charge |
ChargesAPI | ListCharges | Post /charges/list | List Charges |
ChargesAPI | SearchCharges | Post /charges/search | Search Charges |
ChargesAPI | UpdateCharge | Put /charges/{charge_id} | Update Charge |
CheckoutAPI | CreateCheckoutSession | Post /checkout/sessions | Create Checkout Session |
CheckoutAPI | GetCheckoutSession | Get /checkout/sessions/{session_id} | Get Checkout Session |
CheckoutAPI | ListCheckoutSessions | Post /checkout/list | List Checkout Sessions |
CouponsAPI | CreateCoupon | Post /coupons/ | Create Coupon |
CouponsAPI | DeleteCoupon | Delete /coupons/{coupon_id} | Delete Coupon |
CouponsAPI | GetCoupon | Get /coupons/{coupon_id} | Get Coupon |
CouponsAPI | ListCoupons | Post /coupons/list | List Coupons |
CouponsAPI | UpdateCoupon | Put /coupons/{coupon_id} | Update Coupon |
CreditNotesAPI | CreateCreditNote | Post /credit-notes/ | Create Credit Note |
CreditNotesAPI | GetCreditNote | Get /credit-notes/{credit_note_id} | Get Credit Note |
CreditNotesAPI | ListCreditNotes | Post /credit-notes/list | List Credit Notes |
CustomersAPI | CreateCustomer | Post /customers/ | Create Customer |
CustomersAPI | CreateCustomerBalanceTransaction | Post /customers/{customer_id}/balance-transactions | Create Customer Balance Transaction |
CustomersAPI | DeleteCustomerDiscount | Delete /customers/{customer_id}/discount | Delete Customer Discount |
CustomersAPI | GetCustomer | Get /customers/{customer_id} | Get Customer |
CustomersAPI | GetCustomerBalanceTransaction | Get /customers/{customer_id}/balance-transactions/{transaction_id} | Get Customer Balance Transaction |
CustomersAPI | GetCustomerBalanceTransactions | Get /customers/{customer_id}/balance-transactions | Get Customer Balance Transactions |
CustomersAPI | ListCustomerPaymentMethods | Post /customers/{customer_id}/payment-methods | List Customer Payment Methods |
CustomersAPI | ListCustomers | Post /customers/list | List Customers |
CustomersAPI | ListValidSubscriptions | Post /customers/{customer_id}/list_valid_subscriptions | List Valid Subscriptions |
CustomersAPI | SearchCustomers | Post /customers/search | Search Customers |
CustomersAPI | UpdateCustomer | Put /customers/{customer_external_id} | Update Customer |
DisputesAPI | CreateDispute | Post /dispute/ | Create Dispute |
DisputesAPI | GetDispute | Get /dispute/{dispute_id} | Get Dispute |
EventsAPI | GetEvent | Get /events/{event_id} | Get Event |
EventsAPI | ListEvents | Post /events/list | List Events |
EventsAPI | SearchEvents | Post /events/search | Search Events |
InvoiceItemsAPI | DeleteInvoiceItemById | Delete /invoice-items/{invoice_item_id} | Delete Invoice Item By Id |
InvoiceItemsAPI | GetInvoiceItem | Get /invoice-items/{invoice_item_id} | Get Invoice Item |
InvoiceItemsAPI | ListInvoiceItems | Post /invoice-items/list | List Invoice Items |
InvoicesAPI | AddComment | Post /invoices/{invoice_external_id}/comment | Add Comment |
InvoicesAPI | CreateInvoice | Post /invoices/ | Create Invoice |
InvoicesAPI | FinalizeInvoice | Post /invoices/{invoice_external_id}/finalize | Finalize Invoice |
InvoicesAPI | GetInvoice | Get /invoices/{invoice_external_id} | Get Invoice |
InvoicesAPI | GetInvoicePublic | Get /invoices/public/{public_permanent_token} | Get Invoice Public |
InvoicesAPI | ListInvoices | Post /invoices/list | List Invoices |
InvoicesAPI | MarkInvoiceAsUncollectible | Post /invoices/{invoice_external_id}/mark_uncollectible | Mark Invoice As Uncollectible |
InvoicesAPI | MarkInvoiceAsVoid | Post /invoices/{invoice_external_id}/void | Mark Invoice As Void |
InvoicesAPI | PayInvoice | Post /invoices/{invoice_external_id}/pay | Pay Invoice |
InvoicesAPI | PreviewNextInvoice | Get /invoices/preview_next_invoice/{subscription_id} | Preview Next Invoice |
InvoicesAPI | SearchInvoices | Post /invoices/search | Search Invoices |
InvoicesAPI | UpdateInvoice | Put /invoices/{invoice_id} | Update Invoice |
PaymentIntentsAPI | GetPaymentIntent | Get /payment-intents/{payment_intent_id} | Get Payment Intent |
PaymentIntentsAPI | ListPaymentIntents | Post /payment-intents/list | List Payment Intents |
PaymentIntentsAPI | SearchPaymentIntents | Post /payment-intents/search | Search Payment Intents |
PaymentIntentsAPI | UpdatePaymentIntent | Put /payment-intents/{payment_intent_id} | Update Payment Intent |
PaymentLinksAPI | CreatePaymentLink | Post /payment-link/ | Create Payment Link |
PaymentLinksAPI | GetPaymentLink | Get /payment-link/{plink_id} | Get Payment Link |
PaymentLinksAPI | ListPaymentLinks | Post /payment-link/list | List Payment Links |
PaymentLinksAPI | OpenPaymentLinkPagePublic | Get /payment-link/public/{secure_token} | Open Payment Link Page Public |
PaymentMethodsAPI | AttachPaymentMethod | Post /payment-methods/{payment_method_id}/attach | Attach Payment Method |
PaymentMethodsAPI | AuthorizePaymentMethod | Post /payment-methods/authorize | Authorize Payment Method |
PaymentMethodsAPI | DetachPaymentMethod | Post /payment-methods/{payment_method_id}/detach | Detach Payment Method |
PaymentMethodsAPI | GetPaymentMethod | Get /payment-methods/{payment_method_id} | Get Payment Method |
PricesAPI | CreatePriceForProduct | Post /prices/ | Create Price For Product |
PricesAPI | DeletePriceForProduct | Delete /prices/{price_id} | Delete Price For Product |
PricesAPI | GetPriceAddOns | Get /prices/{price_id}/add-ons | Get Price Add Ons |
PricesAPI | GetPriceForProduct | Get /prices/{price_id} | Get Price For Product |
PricesAPI | ListPrices | Post /prices/list | List Prices |
PricesAPI | SearchPrices | Post /prices/search | Search Prices |
PricesAPI | UpdatePriceForProduct | Put /prices/{price_id} | Update Price For Product |
ProductFamilyAPI | CreateProductFamily | Post /product-family/ | Create Product Family |
ProductFamilyAPI | DeleteProductFamily | Delete /product-family/{id} | Delete Product Family |
ProductFamilyAPI | GetProductFamily | Get /product-family/{id} | Get Product Family |
ProductFamilyAPI | ListProductFamilies | Post /product-family/list | List Product Families |
ProductFamilyAPI | UpdateProductFamily | Put /product-family/{id} | Update Product Family |
ProductsAPI | CreateProduct | Post /products/ | Create Product |
ProductsAPI | DeleteProduct | Delete /products/{product_id} | Delete Product |
ProductsAPI | GetProduct | Get /products/{product_id} | Get Product |
ProductsAPI | ListProducts | Post /products/list | List Products |
ProductsAPI | SearchProducts | Post /products/search | Search Products |
ProductsAPI | UpdateProduct | Put /products/{product_id} | Update Product |
PromotionCodesAPI | CreatePromoCode | Post /promotion-codes/ | Create Promo Code |
PromotionCodesAPI | GetPromoCode | Get /promotion-codes/{promo_code_id} | Get Promo Code |
PromotionCodesAPI | GetPromoCodeByCode | Get /promotion-codes/code/{promo_code} | Get Promo Code By Code |
PromotionCodesAPI | ListPromoCodes | Post /promotion-codes/list | List Promo Codes |
PromotionCodesAPI | UpdatePromoCode | Put /promotion-codes/{promo_code_id} | Update Promo Code |
RefundsAPI | CreateRefund | Post /refunds/ | Create Refund |
RefundsAPI | ListRefunds | Post /refunds/list | List Refunds |
SubscriptionItemsAPI | CreateSubscriptionItem | Post /subscription-items/ | Create Subscription Item |
SubscriptionItemsAPI | DeleteSubscriptionItem | Delete /subscription-items/{subscription_item_id} | Delete Subscription Item |
SubscriptionItemsAPI | GetSubscriptionItem | Get /subscription-items/{subscription_item_id} | Get Subscription Item |
SubscriptionItemsAPI | ListSubscriptionItems | Post /subscription-items/list | List Subscription Items |
SubscriptionItemsAPI | UpdateSubscriptionItem | Put /subscription-items/{subscription_item_id} | Update Subscription Item |
SubscriptionsAPI | CancelSubscriptionTrial | Post /subscriptions/{subscription_id}/cancel-subscription-trial | Cancel Subscription Trial |
SubscriptionsAPI | CreateSubscriptions | Post /subscriptions/ | Create Subscriptions |
SubscriptionsAPI | DeleteSubscription | Delete /subscriptions/{subscription_id} | Delete Subscription |
SubscriptionsAPI | DeleteSubscriptionDiscount | Delete /subscriptions/{subscription_id}/discount | Delete Subscription Discount |
SubscriptionsAPI | GetSubscription | Get /subscriptions/{subscription_id} | Get Subscription |
SubscriptionsAPI | ListSubscriptions | Post /subscriptions/list | List Subscriptions |
SubscriptionsAPI | PauseSubscription | Put /subscriptions/{subscription_id}/pause | Pause Subscription |
SubscriptionsAPI | RefreshSubscriptionStatus | Post /subscriptions/{subscription_id}/refresh-status | Refresh Subscription Status |
SubscriptionsAPI | ResumeSubscription | Put /subscriptions/{subscription_id}/resume | Resume Subscription |
SubscriptionsAPI | SearchSubscriptions | Post /subscriptions/search | Search Subscriptions |
SubscriptionsAPI | UpdateSubscription | Put /subscriptions/{subscription_id} | Update Subscription |
TaxIntegrationsAPI | CreateTaxIntegration | Post /integrations/tax/ | Create Tax Integration |
Documentation For Models
- ActiveSubResponse
- AddCommentRequest
- AttachPaymentMethodRequest
- AuthorizePaymentMethodRequest
- BillingReasonEnum
- BillingSchemeEnum
- BooleanConfigField
- CalendarIntervalEnum
- ChargeExternal
- ChargeQueryParams
- ChargeStatusEnum
- CheckoutMode
- CheckoutSessionExternal
- CheckoutSessionLineItemExternal
- CheckoutSessionQueryParams
- CheckoutSessionStatus
- CollectionMethodEnum
- CompleteAddress
- CouponDuration
- CouponExternal
- CouponQueryParams
- CreateCheckoutLineItem
- CreateCheckoutSessionRequest
- CreateCouponRequest
- CreateCreditNoteLine
- CreateCreditNoteRequest
- CreateCustomerBalanceTransactionRequest
- CreateCustomerRequest
- CreateDisputeRequest
- CreateInvoiceRequest
- CreatePaymentLinkRequest
- CreatePortalSessionRequest
- CreatePriceRequest
- CreateProductFamilyRequest
- CreateProductRequest
- CreatePromoCodeRequest
- CreateRefundRequest
- CreateSubscriptionItemRequest
- CreateSubscriptionRequest
- CreateSubscriptionResponse
- CreateTaxIntegrationRequest
- CreditNoteExternal
- CreditNoteItemExternal
- CreditNoteLineType
- CreditNoteQueryParams
- CreditNoteReason
- CurrencyEnum
- CustomerBalanceExternal
- CustomerBalanceTransactionExternal
- CustomerBalanceTransactionType
- CustomerExternal
- CustomerInvoiceSettings
- CustomerLanguage
- CustomerPaymentMethodQueryParams
- CustomerQueryParams
- CustomerStatus
- CustomerTotalAmount
- DateTimeFilter
- DeleteInvoiceItemResponse
- DeletePriceResponse
- DeleteProductResponse
- DeleteSubscriptionItemRequest
- DeleteSubscriptionItemResponse
- DeleteSubscriptionRequest
- DeleteSubscriptionResponse
- DiscountExternal
- DisputeExternal
- EnumConfigField
- EventExternal
- EventSearchParams
- EventType
- EventsQueryParams
- HTTPValidationError
- InlineSubscriptionItemUpdate
- IntRangeFilter
- InvoiceComment
- InvoiceDiscountAmountsExternal
- InvoiceExternal
- InvoiceItemDiscountAmountsExternal
- InvoiceItemDiscountAmountsPublic
- InvoiceItemExternal
- InvoiceItemPublic
- InvoiceItemsQueryParams
- InvoicePublic
- InvoiceQueryParams
- InvoiceSettings
- InvoiceStatusEnum
- InvoiceType
- ListActiveSubParams
- ListResponseChargeExternal
- ListResponseCheckoutSessionExternal
- ListResponseCouponExternal
- ListResponseCreditNoteExternal
- ListResponseCustomerExternal
- ListResponseEventExternal
- ListResponseInvoiceExternal
- ListResponseInvoiceItemExternal
- ListResponsePaymentIntentExternal
- ListResponsePaymentLinkExternal
- ListResponsePriceExternal
- ListResponseProductExternal
- ListResponseProductFamilyExternal
- ListResponsePromotionCodeExternal
- ListResponseRefundExternal
- ListResponseSubscriptionExternal
- ListResponseSubscriptionItemExternal
- ListResponseUnionTokenizedCreditCardExternalPaymentMethodExternal
- ListResponseUnionTokenizedCreditCardExternalPaymentMethodExternalDataInner
- MarkUncollectibleRequest
- MarkVoidRequest
- NonPciIntegration
- NonPciIntegrationConfigurationInner
- NonPciIntegrationEnum
- NumberConfigField
- ObjectName
- PayInvoiceRequest
- PaymentIntentExternal
- PaymentIntentQueryParams
- PaymentIntentStatus
- PaymentLinkExternal
- PaymentLinkLineItemExternal
- PaymentLinkQueryParams
- PaymentMethodExternal
- PaymentProcessorName
- PaymentProviderType
- PortalSessionExternal
- PriceExternal
- PriceQueryParams
- PriceTierExternal
- PriceTierParams
- PriceTierPublic
- PriceTypeEnum
- PricingModel
- PricingTiersEnum
- ProductExternal
- ProductFamilyExternal
- ProductFamilyQueryParams
- ProductQueryParams
- PromoCodeQueryParams
- PromoRestrictions
- PromotionCodeExternal
- ProrationEnum
- RecurringDetails
- RefundExternal
- RefundQueryParams
- RefundReasonEnum
- RefundStatusEnum
- ResponseGetPaymentMethodPaymentMethodsPaymentMethodIdGet
- SearchChargeRequest
- SearchCustomerRequest
- SearchFilter
- SearchInvoiceRequest
- SearchPaymentIntentRequest
- SearchPriceRequest
- SearchProductRequest
- SearchSubscriptionRequest
- SelectedPriceQuantity
- SetupIntentExternal
- StringConfigField
- SubscriptionCancelFeedbackEnum
- SubscriptionCancellationDetails
- SubscriptionExternal
- SubscriptionItemExternal
- SubscriptionItemQueryParams
- SubscriptionPauseRequest
- SubscriptionQueryParams
- SubscriptionResumeRequest
- SubscriptionStatusEnum
- TaxIntegrationApiName
- TaxIntegrationExternal
- TokenizedCreditCardExternal
- UpdateChargeRequest
- UpdateCouponRequest
- UpdateCustomerRequest
- UpdateInvoiceRequest
- UpdatePaymentIntent
- UpdatePriceRequest
- UpdateProductFamilyRequest
- UpdateProductRequest
- UpdatePromoCodeRequest
- UpdateSubscriptionItemRequest
- UpdateSubscriptionRequest
- UpdateSubscriptionResponse
- UsageAggMethodEnum
- UsageTypeEnum
- ValidationError
- ValidationErrorLocInner
Documentation For Authorization
Authentication schemes defined for the API:
HTTPBearer
- Type: HTTP Bearer token authentication
Example
auth := context.WithValue(context.Background(), getopenpay.ContextAccessToken, "BEARER_TOKEN_STRING")
r, err := client.Service.Operation(auth, args)
Documentation for Utility Methods
Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:
PtrBool
PtrInt
PtrInt32
PtrInt64
PtrFloat
PtrFloat32
PtrFloat64
PtrString
PtrTime