Skip to content

Paystack client in Go, Code generated by OpenAPI Generator (https://openapi-generator.tech)

Notifications You must be signed in to change notification settings

bluelabs-eu/paystack-client-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for openapi

The OpenAPI specification of the Paystack API that merchants and developers can harness to build financial solutions in Africa.

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
  • Generator version: 7.13.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://paystack.com/docs

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 openapi "github.com/GIT_USER_ID/GIT_REPO_ID"

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 openapi.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), openapi.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value openapi.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), openapi.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 openapi.ContextOperationServerIndices and openapi.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), openapi.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), openapi.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://api.paystack.co

Class Method HTTP request Description
BalanceAPI BalanceFetch Get /balance Fetch Balance
BalanceAPI BalanceLedger Get /balance/ledger Balance Ledger
BulkChargeAPI BulkChargeCharges Get /bulkcharge/{code}/charges Fetch Charges in a Batch
BulkChargeAPI BulkChargeFetch Get /bulkcharge/{code} Fetch Bulk Charge Batch
BulkChargeAPI BulkChargeInitiate Post /bulkcharge Initiate Bulk Charge
BulkChargeAPI BulkChargeList Get /bulkcharge List Bulk Charge Batches
BulkChargeAPI BulkChargePause Get /bulkcharge/pause/{code} Pause Bulk Charge Batch
BulkChargeAPI BulkChargeResume Get /bulkcharge/resume/{code} Resume Bulk Charge Batch
ChargeAPI ChargeCheck Get /charge/{reference} Check pending charge
ChargeAPI ChargeCreate Post /charge Create Charge
ChargeAPI ChargeSubmitAddress Post /charge/submit_address Submit Address
ChargeAPI ChargeSubmitBirthday Post /charge/submit_birthday Submit Birthday
ChargeAPI ChargeSubmitOtp Post /charge/submit_otp Submit OTP
ChargeAPI ChargeSubmitPhone Post /charge/submit_phone Submit Phone
ChargeAPI ChargeSubmitPin Post /charge/submit_pin Submit PIN
CustomerAPI CustomerCreate Post /customer Create Customer
CustomerAPI CustomerDeactivateAuthorization Post /customer/deactivate_authorization Deactivate Authorization
CustomerAPI CustomerFetch Get /customer/{code} Fetch Customer
CustomerAPI CustomerList Get /customer List Customers
CustomerAPI CustomerRiskAction Post /customer/set_risk_action White/blacklist Customer
CustomerAPI CustomerUpdate Put /customer/{code} Update Customer
CustomerAPI CustomerValidate Post /customer/{code}/identification Validate Customer
DedicatedVirtualAccountAPI DedicatedAccountAddSplit Post /dedicated_account/split Split Dedicated Account Transaction
DedicatedVirtualAccountAPI DedicatedAccountAvailableProviders Get /dedicated_account/available_providers Fetch Bank Providers
DedicatedVirtualAccountAPI DedicatedAccountCreate Post /dedicated_account Create Dedicated Account
DedicatedVirtualAccountAPI DedicatedAccountDeactivate Delete /dedicated_account/{account_id} Deactivate Dedicated Account
DedicatedVirtualAccountAPI DedicatedAccountFetch Get /dedicated_account/{account_id} Fetch Dedicated Account
DedicatedVirtualAccountAPI DedicatedAccountList Get /dedicated_account List Dedicated Accounts
DedicatedVirtualAccountAPI DedicatedAccountRemoveSplit Delete /dedicated_account/split Remove Split from Dedicated Account
DisputeAPI DisputeDownload Get /dispute/export Export Disputes
DisputeAPI DisputeEvidence Post /dispute/{id}/evidence Add Evidence
DisputeAPI DisputeFetch Get /dispute/{id} Fetch Dispute
DisputeAPI DisputeList Get /dispute List Disputes
DisputeAPI DisputeResolve Put /dispute/{id}/resolve Resolve a Dispute
DisputeAPI DisputeTransaction Get /dispute/transaction/{id} List Transaction Disputes
DisputeAPI DisputeUpdate Put /dispute/{id} Update Dispute
DisputeAPI DisputeUploadUrl Get /dispute/{id}/upload_url Get Upload URL
IntegrationAPI IntegrationFetchPaymentSessionTimeout Get /integration/payment_session_timeout Fetch Payment Session Timeout
IntegrationAPI IntegrationUpdatePaymentSessionTimeout Put /integration/payment_session_timeout Update Payment Session Timeout
PageAPI PageAddProducts Post /page/{id}/product Add Products
PageAPI PageCheckSlugAvailability Get /page/check_slug_availability/{slug} Check Slug Availability
PageAPI PageCreate Post /page Create Page
PageAPI PageFetch Get /page/{id} Fetch Page
PageAPI PageList Get /page List Pages
PageAPI PageUpdate Put /page/{id} Update Page
PaymentRequestAPI PaymentRequestArchive Post /paymentrequest/archive/{id} Archive Payment Request
PaymentRequestAPI PaymentRequestCreate Post /paymentrequest Create Payment Request
PaymentRequestAPI PaymentRequestFetch Get /paymentrequest/{id} Fetch Payment Request
PaymentRequestAPI PaymentRequestFinalize Post /paymentrequest/finalize/{id} Finalize Payment Request
PaymentRequestAPI PaymentRequestList Get /paymentrequest List Payment Request
PaymentRequestAPI PaymentRequestNotify Post /paymentrequest/notify/{id} Send Notification
PaymentRequestAPI PaymentRequestTotals Get /paymentrequest/totals Payment Request Total
PaymentRequestAPI PaymentRequestUpdate Put /paymentrequest/{id} Update Payment Request
PaymentRequestAPI PaymentRequestVerify Get /paymentrequest/verify/{id} Verify Payment Request
PlanAPI PlanCreate Post /plan Create Plan
PlanAPI PlanFetch Get /plan/{code} Fetch Plan
PlanAPI PlanList Get /plan List Plans
PlanAPI PlanUpdate Put /plan/{code} Update Plan
ProductAPI ProductCreate Post /product Create Product
ProductAPI ProductDelete Delete /product/{id} Delete Product
ProductAPI ProductFetch Get /product/{id} Fetch Product
ProductAPI ProductList Get /product List Products
ProductAPI ProductUpdate Put /product/{id} Update product
RefundAPI RefundCreate Post /refund Create Refund
RefundAPI RefundFetch Get /refund/{id} Fetch Refund
RefundAPI RefundList Get /refund List Refunds
SettlementAPI SettlementsFetch Get /settlement Fetch Settlements
SettlementAPI SettlementsTransaction Get /settlement/{id}/transaction Settlement Transactions
SplitAPI SplitAddSubaccount Post /split/{id}/subaccount/add Add Subaccount to Split
SplitAPI SplitCreate Post /split Create Split
SplitAPI SplitFetch Get /split/{id} Fetch Split
SplitAPI SplitList Get /split List/Search Splits
SplitAPI SplitRemoveSubaccount Post /split/{id}/subaccount/remove Remove Subaccount from split
SplitAPI SplitUpdate Put /split/{id} Update Split
SubaccountAPI SubaccountCreate Post /subaccount Create Subaccount
SubaccountAPI SubaccountFetch Get /subaccount/{code} Fetch Subaccount
SubaccountAPI SubaccountList Get /subaccount List Subaccounts
SubaccountAPI SubaccountUpdate Put /subaccount/{code} Update Subaccount
SubscriptionAPI SubscriptionCreate Post /subscription Create Subscription
SubscriptionAPI SubscriptionDisable Post /subscription/disable Disable Subscription
SubscriptionAPI SubscriptionEnable Post /subscription/enable Enable Subscription
SubscriptionAPI SubscriptionFetch Get /subscription/{code} Fetch Subscription
SubscriptionAPI SubscriptionList Get /subscription List Subscriptions
SubscriptionAPI SubscriptionManageEmail Post /subscription/{code}/manage/email Send Update Subscription Link
SubscriptionAPI SubscriptionManageLink Get /subscription/{code}/manage/link Generate Update Subscription Link
TransactionAPI TransactionChargeAuthorization Post /transaction/charge_authorization Charge Authorization
TransactionAPI TransactionCheckAuthorization Post /transaction/check_authorization Check Authorization
TransactionAPI TransactionDownload Get /transaction/export Export Transactions
TransactionAPI TransactionEvent Get /transaction/{id}/event Get Transaction Event
TransactionAPI TransactionFetch Get /transaction/{id} Fetch Transaction
TransactionAPI TransactionInitialize Post /transaction/initialize Initialize Transaction
TransactionAPI TransactionList Get /transaction List Transactions
TransactionAPI TransactionPartialDebit Post /transaction/partial_debit Partial Debit
TransactionAPI TransactionSession Get /transaction/{id}/session Get Transaction Session
TransactionAPI TransactionTimeline Get /transaction/timeline/{id_or_reference} Fetch Transaction Timeline
TransactionAPI TransactionTotals Get /transaction/totals Transaction Totals
TransactionAPI TransactionVerify Get /transaction/verify/{reference} Verify Transaction
TransferAPI TransferBulk Post /transfer/bulk Initiate Bulk Transfer
TransferAPI TransferDisableOtp Post /transfer/disable_otp Disable OTP requirement for Transfers
TransferAPI TransferDisableOtpFinalize Post /transfer/disable_otp_finalize Finalize Disabling of OTP requirement for Transfers
TransferAPI TransferDownload Get /transfer/export Export Transfers
TransferAPI TransferEnableOtp Post /transfer/enable_otp Enable OTP requirement for Transfers
TransferAPI TransferFetch Get /transfer/{code} Fetch Transfer
TransferAPI TransferFinalize Post /transfer/finalize_transfer Finalize Transfer
TransferAPI TransferInitiate Post /transfer Initiate Transfer
TransferAPI TransferList Get /transfer List Transfers
TransferAPI TransferResendOtp Post /transfer/resend_otp Resend OTP for Transfer
TransferAPI TransferVerify Get /transfer/verify/{reference} Verify Transfer
TransferRecipientAPI TransferrecipientBulk Post /transferrecipient/bulk Bulk Create Transfer Recipient
TransferRecipientAPI TransferrecipientCodeDelete Delete /transferrecipient/{code} Delete Transfer Recipient
TransferRecipientAPI TransferrecipientCodePut Put /transferrecipient/{code} Update Transfer recipient
TransferRecipientAPI TransferrecipientCreate Post /transferrecipient Create Transfer Recipient
TransferRecipientAPI TransferrecipientFetch Get /transferrecipient/{code} Fetch Transfer recipient
TransferRecipientAPI TransferrecipientList Get /transferrecipient List Transfer Recipients
VerificationAPI VerificationAvs Get /address_verification/states List States (AVS)
VerificationAPI VerificationFetchBanks Get /bank Fetch Banks
VerificationAPI VerificationListCountries Get /country List Countries
VerificationAPI VerificationResolveAccountNumber Get /bank/resolve Resolve Account Number
VerificationAPI VerificationResolveCardBin Get /decision/bin/{bin} Resolve Card BIN

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

bearerAuth

  • Type: HTTP Bearer token authentication

Example

auth := context.WithValue(context.Background(), openapi.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

Author

techsupport@paystack.com

About

Paystack client in Go, Code generated by OpenAPI Generator (https://openapi-generator.tech)

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors