diff --git a/README.md b/README.md index 9c9853c..78e62b1 100644 --- a/README.md +++ b/README.md @@ -1,436 +1,47 @@ -# Go API client for doitpay +# Doitpay Go SDK -This is the payment gateway API server for Doitpay. +The official Doitpay Go SDK offers an easy and user-friendly method to access Doitpay's REST API in applications coded in Go. -## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. +* Package version: 1.0.0 -- API version: 1.0 -- Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.GoClientCodegen -For more information, please visit [http://doitpay.co.id/support](http://doitpay.co.id/support) +# Getting Started ## Installation -Install the following dependencies: +Install doitpay-go in your Go application: ```shell -go get github.com/stretchr/testify/assert -go get golang.org/x/oauth2 -go get golang.org/x/net/context +go get github.com/automotechnologies/doitpay-go ``` -Put the package under your project folder and add the following in import: +Place the package in your project directory and include the following in the import: ```golang -import doitpay "github.com/automotechnologies/doitpay" +import doitpay "github.com/automotechnologies/doitpay-go" ``` -To use a proxy, set the environment variable `HTTP_PROXY`: +## Authorization -```golang -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 `sw.ContextServerIndex` of type `int`. - -```golang -ctx := context.WithValue(context.Background(), doitpay.ContextServerIndex, 1) -``` - -### Templated Server URL - -Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. - -```golang -ctx := context.WithValue(context.Background(), doitpay.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 `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. - -```golang -ctx := context.WithValue(context.Background(), doitpay.ContextOperationServerIndices, map[string]int{ - "{classname}Service.{nickname}": 2, -}) -ctx = context.WithValue(context.Background(), doitpay.ContextOperationServerVariables, map[string]map[string]string{ - "{classname}Service.{nickname}": { - "port": "8443", - }, -}) -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AdminAPI* | [**AdminBusinessInvoiceBusinessIdGet**](docs/AdminAPI.md#adminbusinessinvoicebusinessidget) | **Get** /admin/business/invoice/:business_id | get business detail with teams and users -*AdminAPI* | [**AdminListTransaction**](docs/AdminAPI.md#adminlisttransaction) | **Get** /dashboard/v1/admin/transaction/:businessId | List all created Transaction data by business id -*AdminAPI* | [**AdminUserUserIdDetailGet**](docs/AdminAPI.md#adminuseruseriddetailget) | **Get** /admin/user/{userId}/detail | get user detail by id -*AdminAPI* | [**ApiV1AdminBusinessApprovePost**](docs/AdminAPI.md#apiv1adminbusinessapprovepost) | **Post** /api/v1/admin/business/approve | Approve business document and send approval email to owner -*AdminAPI* | [**ApiV1AdminBusinessBusinessIdGet**](docs/AdminAPI.md#apiv1adminbusinessbusinessidget) | **Get** /api/v1/admin/business/{businessId} | get business detail by id -*AdminAPI* | [**ApiV1AdminBusinessGet**](docs/AdminAPI.md#apiv1adminbusinessget) | **Get** /api/v1/admin/business | fetch list of registration users -*AdminAPI* | [**ApiV1AdminBusinessRejectPost**](docs/AdminAPI.md#apiv1adminbusinessrejectpost) | **Post** /api/v1/admin/business/reject | Reject business document and send rejected email to owner -*AdminAPI* | [**ApiV1AdminBusinessUsersGet**](docs/AdminAPI.md#apiv1adminbusinessusersget) | **Get** /api/v1/admin/business/users | get business detail with teams and users -*AdminAPI* | [**ApiV1AdminBusinessVirtualAccountBusinessIdGet**](docs/AdminAPI.md#apiv1adminbusinessvirtualaccountbusinessidget) | **Get** /api/v1/admin/business/virtual-account/{businessId} | Get Virtual Account Business config for create Virtual Account -*AdminAPI* | [**ApiV1AdminBusinessVirtualAccountBusinessIdPost**](docs/AdminAPI.md#apiv1adminbusinessvirtualaccountbusinessidpost) | **Post** /api/v1/admin/business/virtual-account/{businessId} | Create Virtual Account Business config for create Virtual Account -*AdminSettlementAPI* | [**ApiV1AdminSettlementApprovePost**](docs/AdminSettlementAPI.md#apiv1adminsettlementapprovepost) | **Post** /api/v1/admin/settlement/approve | Approve settlement for transaction -*AdminSettlementAPI* | [**ApiV1AdminSettlementRejectPost**](docs/AdminSettlementAPI.md#apiv1adminsettlementrejectpost) | **Post** /api/v1/admin/settlement/reject | Reject settlement for transaction -*ApiKeyAPI* | [**CreateSecretApiKey**](docs/ApiKeyAPI.md#createsecretapikey) | **Post** /dashboard/v1/secret-api-key | Create secret api key for a business -*ApiKeyAPI* | [**DeleteSecretApiKey**](docs/ApiKeyAPI.md#deletesecretapikey) | **Delete** /dashboard/v1/secret-api-key/{api_key_id} | Delete an API key -*ApiKeyAPI* | [**ListSecretApiKey**](docs/ApiKeyAPI.md#listsecretapikey) | **Get** /dashboard/v1/secret-api-key | Generate secret api key for a business -*AuthenticateAPI* | [**CheckForgotPasswordToken**](docs/AuthenticateAPI.md#checkforgotpasswordtoken) | **Get** /dashboard/v1/authenticate/forgot-password/{token} | Check forgot password token status -*AuthenticateAPI* | [**ForgotPassword**](docs/AuthenticateAPI.md#forgotpassword) | **Post** /dashboard/v1/authenticate/forgot-password | ForgotPassword user -*AuthenticateAPI* | [**RegisterMember**](docs/AuthenticateAPI.md#registermember) | **Post** /dashboard/v1/authenticate/register/member/:token | Register member -*AuthenticateAPI* | [**ResendVerifyEmail**](docs/AuthenticateAPI.md#resendverifyemail) | **Post** /dashboard/v1/authenticate/verify-email/resend | Resend Verification Email for un-verify email -*AuthenticateAPI* | [**ResetPassword**](docs/AuthenticateAPI.md#resetpassword) | **Put** /dashboard/v1/authenticate/reset-password | Reset Password user -*AuthenticateAPI* | [**VerifyEmailOwner**](docs/AuthenticateAPI.md#verifyemailowner) | **Put** /dashboard/v1/authenticate/verify-email/:token | Verify email owner -*BalanceAPI* | [**FetchOneTransactionBalanceHistory**](docs/BalanceAPI.md#fetchonetransactionbalancehistory) | **Get** /api/v1/balance/history/{balance_id} | Fetch One balance history detail -*BalanceAPI* | [**GetBalanceDashboard**](docs/BalanceAPI.md#getbalancedashboard) | **Get** /api/v1/balance | Get Balance by business -*BalanceAPI* | [**ListOfTransactionBalanceHistory**](docs/BalanceAPI.md#listoftransactionbalancehistory) | **Get** /api/v1/balance/history | List all created Transaction Balance History data -*BankAPI* | [**DashboardV1BankGet**](docs/BankAPI.md#dashboardv1bankget) | **Get** /dashboard/v1/bank | get bank list -*BusinessAPI* | [**ApiV1BusinessPost**](docs/BusinessAPI.md#apiv1businesspost) | **Post** /api/v1/business | Register business -*BusinessAPI* | [**ApiV1BusinessUsersGet**](docs/BusinessAPI.md#apiv1businessusersget) | **Get** /api/v1/business/users | Get users under business -*BusinessAPI* | [**DashboardV1AdminBusinessUserPost**](docs/BusinessAPI.md#dashboardv1adminbusinessuserpost) | **Post** /dashboard/v1/admin/business/user | Register new user to business team -*BusinessAPI* | [**DashboardV1BusinessCommissionPost**](docs/BusinessAPI.md#dashboardv1businesscommissionpost) | **Post** /dashboard/v1/business/commission | Assign Commission for business -*BusinessAPI* | [**DashboardV1BusinessDetailGet**](docs/BusinessAPI.md#dashboardv1businessdetailget) | **Get** /dashboard/v1/business/detail | get business detail -*BusinessAPI* | [**DashboardV1BusinessInviteUserPost**](docs/BusinessAPI.md#dashboardv1businessinviteuserpost) | **Post** /dashboard/v1/business/invite/user | Invite email newuser to business team -*BusinessAPI* | [**DashboardV1BusinessUpdatePut**](docs/BusinessAPI.md#dashboardv1businessupdateput) | **Put** /dashboard/v1/business/update | Register business -*BusinessAPI* | [**DashboardV1BusinessUserDeleteUserIdDelete**](docs/BusinessAPI.md#dashboardv1businessuserdeleteuseriddelete) | **Delete** /dashboard/v1/business/user/delete/{userId} | Delete user from team business -*CheckoutAPI* | [**CheckoutV1InvoiceNumberCustomerPut**](docs/CheckoutAPI.md#checkoutv1invoicenumbercustomerput) | **Put** /checkout/v1/{invoice_number}/customer | Update invoice customer on checkout -*CheckoutAPI* | [**CheckoutV1InvoiceNumberDetailGet**](docs/CheckoutAPI.md#checkoutv1invoicenumberdetailget) | **Get** /checkout/v1/{invoice_number}/detail | Get Invoice Detail for checkout -*CheckoutAPI* | [**CheckoutV1InvoiceNumberPaymentPost**](docs/CheckoutAPI.md#checkoutv1invoicenumberpaymentpost) | **Post** /checkout/v1/{invoice_number}/payment | Create transaction on checkout -*DefaultAPI* | [**AccessToken**](docs/DefaultAPI.md#accesstoken) | **Post** /api/v1/authenticate/access-token | Generate new access token from refresh token -*DefaultAPI* | [**CheckHealthz**](docs/DefaultAPI.md#checkhealthz) | **Get** /internal/healthz | Get Application Healthz -*DefaultAPI* | [**ExecuteCallbackScheduler**](docs/DefaultAPI.md#executecallbackscheduler) | **Post** /subscriber/v1/execute_callback_scheduler | Consume message and proceed callback scheduelr -*DefaultAPI* | [**FetchAllInvoiceDataByBusinessId**](docs/DefaultAPI.md#fetchallinvoicedatabybusinessid) | **Get** /api/v1/invoice | List all created Invoice data -*DefaultAPI* | [**FetchOneInvoiceDataByInvoiceId**](docs/DefaultAPI.md#fetchoneinvoicedatabyinvoiceid) | **Get** /api/v1/invoice/{invoice_id} | Fetch One Invoice -*DefaultAPI* | [**FetchPaymentMethodForOneInvoice**](docs/DefaultAPI.md#fetchpaymentmethodforoneinvoice) | **Get** /api/v1/invoice/{invoice_id}/payment-method | Fetch PaymentMethod Only For 1 Invoice -*DefaultAPI* | [**GenerateInvoiceData**](docs/DefaultAPI.md#generateinvoicedata) | **Post** /api/v1/invoice | Create invoice for a payment -*DefaultAPI* | [**GenerateVirtualAccountData**](docs/DefaultAPI.md#generatevirtualaccountdata) | **Post** /dashboard/v1/payment/virtual-account | Create Virtual Account for a payment -*DefaultAPI* | [**GetAllVirtualAccountDataByBusiness**](docs/DefaultAPI.md#getallvirtualaccountdatabybusiness) | **Get** /dashboard/v1/payment/virtual-account | Get All Virtual Account for a payment -*DefaultAPI* | [**GetStatus**](docs/DefaultAPI.md#getstatus) | **Get** /api/v1/status | Get Application Status -*DefaultAPI* | [**GetVirtualAccountData**](docs/DefaultAPI.md#getvirtualaccountdata) | **Get** /dashboard/v1/payment/virtual-account/:va_id | Get Virtual Account for a payment -*DefaultAPI* | [**IntrospectToken**](docs/DefaultAPI.md#introspecttoken) | **Post** /api/v1/authenticate/introspect | Introspect bearer token for access or refresh token -*DefaultAPI* | [**Login**](docs/DefaultAPI.md#login) | **Post** /api/v1/authenticate/login | User Login to service -*DefaultAPI* | [**ProceedCallbackRetry**](docs/DefaultAPI.md#proceedcallbackretry) | **Post** /subscriber/v1/proceed_callback_retry_event | Consume message and proceed retry callback to merchant -*DefaultAPI* | [**Register**](docs/DefaultAPI.md#register) | **Post** /api/v1/authenticate/register | Register new user -*DefaultAPI* | [**SendCallbackEvent**](docs/DefaultAPI.md#sendcallbackevent) | **Post** /subscriber/v1/send_callback_event | Consume message and proceed sending callback to merchant -*DefaultAPI* | [**SimulatePayment**](docs/DefaultAPI.md#simulatepayment) | **Post** /api/v1/simulate_payment | SimulatePayment is handler for simulate payment system -*DefaultAPI* | [**VerifyCallbackDummy**](docs/DefaultAPI.md#verifycallbackdummy) | **Post** /api/v1/dummy_callback | VerifyCallback is handler for mock callback -*FileAPI* | [**DashboardV1PrivateFilePost**](docs/FileAPI.md#dashboardv1privatefilepost) | **Post** /dashboard/v1/private/file | Upload Private File Image/Document -*FileAPI* | [**DashboardV1PrivateFileReadGet**](docs/FileAPI.md#dashboardv1privatefilereadget) | **Get** /dashboard/v1/private/file/read | Read Private File Image/Document -*FileAPI* | [**DashboardV1PublicFilePost**](docs/FileAPI.md#dashboardv1publicfilepost) | **Post** /dashboard/v1/public/file | Upload Public File Image/Document -*FileAPI* | [**DashboardV1PublicFileReadGet**](docs/FileAPI.md#dashboardv1publicfilereadget) | **Get** /dashboard/v1/public/file/read | Read Public File Image/Document -*NotificationAPI* | [**CreateOfNotification**](docs/NotificationAPI.md#createofnotification) | **Post** /api/v1/notification | Create created Notification data data -*NotificationAPI* | [**ListOfNotification**](docs/NotificationAPI.md#listofnotification) | **Get** /api/v1/notification | List all created Notification data data -*NotificationAPI* | [**RemoveOfNotification**](docs/NotificationAPI.md#removeofnotification) | **Delete** /api/v1/notification | Remove created Notification data data -*OTPAPI* | [**DashboardV1OtpSendTypePost**](docs/OTPAPI.md#dashboardv1otpsendtypepost) | **Post** /dashboard/v1/otp/send/{type} | Send OTP to user -*OTPAPI* | [**DashboardV1OtpVerifyPost**](docs/OTPAPI.md#dashboardv1otpverifypost) | **Post** /dashboard/v1/otp/verify | Verify OTP code from user -*ProfileAPI* | [**ApiV1ProfileGet**](docs/ProfileAPI.md#apiv1profileget) | **Get** /api/v1/profile | Get user profile by token -*ProfileAPI* | [**ChangePassword**](docs/ProfileAPI.md#changepassword) | **Post** /api/v1/profile/change-password | Use this endpoint to change user password -*PublicBalanceAPI* | [**GetBalance**](docs/PublicBalanceAPI.md#getbalance) | **Get** /merchant/v1/balance | Get Balance. -*PublicInvoiceAPI* | [**CreateInvoice**](docs/PublicInvoiceAPI.md#createinvoice) | **Post** /merchant/v1/invoice | Create invoice for a payment. -*PublicInvoiceAPI* | [**DownloadInvoice**](docs/PublicInvoiceAPI.md#downloadinvoice) | **Get** /merchant/v1/invoice/download/csv | Download CSV file. -*PublicInvoiceAPI* | [**ExpireInvoice**](docs/PublicInvoiceAPI.md#expireinvoice) | **Post** /merchant/v1/invoice/{invoice_id}/expire | Expire invoice by invoice ID. -*PublicInvoiceAPI* | [**GetInvoiceById**](docs/PublicInvoiceAPI.md#getinvoicebyid) | **Get** /merchant/v1/invoice/{invoice_id} | Fetch invoice data by ID. -*PublicInvoiceAPI* | [**GetInvoices**](docs/PublicInvoiceAPI.md#getinvoices) | **Get** /merchant/v1/invoice | List all created invoice data -*PublicInvoiceAPI* | [**GetPaymentMethodById**](docs/PublicInvoiceAPI.md#getpaymentmethodbyid) | **Get** /merchant/v1/invoice/{invoice_id}/payment-method | Fetch payment method by invoice ID. -*PublicInvoiceAPI* | [**UpdateInvoiceById**](docs/PublicInvoiceAPI.md#updateinvoicebyid) | **Put** /merchant/v1/invoice/{invoice_id}/update | Update pending invoice -*PublicSimulateAPI* | [**SimulatePayment**](docs/PublicSimulateAPI.md#simulatepayment) | **Post** /merchant/v1/simulate-payment | SimulatePayment is handler for simulate payment system. -*PublicVirtualAccountAPI* | [**CreateVirtualAccount**](docs/PublicVirtualAccountAPI.md#createvirtualaccount) | **Post** /merchant/v1/virtual-account | Create virtual account data. -*PublicVirtualAccountAPI* | [**GetVirtualAccountById**](docs/PublicVirtualAccountAPI.md#getvirtualaccountbyid) | **Get** /merchant/v1/virtual-account/{virtualAccountId} | Fetch virtual account data by ID. -*PublicVirtualAccountAPI* | [**GetVirtualAccountByNumber**](docs/PublicVirtualAccountAPI.md#getvirtualaccountbynumber) | **Get** /merchant/v1/virtual-account/number/{virtualAccountNumber} | Fetch virtual account data by virtual account number. -*PublicVirtualAccountAPI* | [**GetVirtualAccounts**](docs/PublicVirtualAccountAPI.md#getvirtualaccounts) | **Get** /merchant/v1/virtual-account | List all created virtual account data. -*PubsubAPI* | [**SendOfNotificationEvent**](docs/PubsubAPI.md#sendofnotificationevent) | **Post** /internal/v1/send_notification_event | SendNotificationEvent send Notification data via pubsub -*StatisticsAPI* | [**GetOfStatisticsBusiness**](docs/StatisticsAPI.md#getofstatisticsbusiness) | **Get** /api/v1/statistics/dashboard | Get All Calculation Statistics of Dashboard Business -*TransactionAPI* | [**FetchOneTransaction**](docs/TransactionAPI.md#fetchonetransaction) | **Get** /transaction/{transaction_id} | Fetch One Invoice -*TransactionAPI* | [**ListOfTransaction**](docs/TransactionAPI.md#listoftransaction) | **Get** /api/v1/transaction | List all created Transaction data -*WebhookAPI* | [**DeleteCallbackData**](docs/WebhookAPI.md#deletecallbackdata) | **Delete** /dashboard/v1/callback | Delete callback for a merchant -*WebhookAPI* | [**GenerateCallbackData**](docs/WebhookAPI.md#generatecallbackdata) | **Post** /dashboard/v1/callback | Create callback for a merchant -*WebhookAPI* | [**GetCallbackDataMerchant**](docs/WebhookAPI.md#getcallbackdatamerchant) | **Get** /dashboard/v1/callback | Get callback from a merchant -*WebhookAPI* | [**GetCallbackWebhookDetail**](docs/WebhookAPI.md#getcallbackwebhookdetail) | **Get** /dashboard/v1/callback/webhook/detail/:id | Get detail of webhook by id -*WebhookAPI* | [**UpdateCallbackData**](docs/WebhookAPI.md#updatecallbackdata) | **Put** /dashboard/v1/callback | Update callback for a merchant -*WebhookAPI* | [**WebhooksGet**](docs/WebhookAPI.md#webhooksget) | **Get** /webhooks | Get webhooks - - -## Documentation For Models - - - [GithubComAutomotechnologiesDoitpayInternalAppBuildInfo](docs/GithubComAutomotechnologiesDoitpayInternalAppBuildInfo.md) - - [GithubComAutomotechnologiesDoitpayInternalModelsBusiness](docs/GithubComAutomotechnologiesDoitpayInternalModelsBusiness.md) - - [GithubComAutomotechnologiesDoitpayInternalModelsBusinessKycDocument](docs/GithubComAutomotechnologiesDoitpayInternalModelsBusinessKycDocument.md) - - [GithubComAutomotechnologiesDoitpayInternalModelsBusinessStatus](docs/GithubComAutomotechnologiesDoitpayInternalModelsBusinessStatus.md) - - [GithubComAutomotechnologiesDoitpayInternalModelsCommission](docs/GithubComAutomotechnologiesDoitpayInternalModelsCommission.md) - - [GithubComAutomotechnologiesDoitpayInternalModelsCommissionType](docs/GithubComAutomotechnologiesDoitpayInternalModelsCommissionType.md) - - [GithubComAutomotechnologiesDoitpayInternalModelsDocType](docs/GithubComAutomotechnologiesDoitpayInternalModelsDocType.md) - - [GithubComAutomotechnologiesDoitpayInternalModelsInvoiceCustomer](docs/GithubComAutomotechnologiesDoitpayInternalModelsInvoiceCustomer.md) - - [GithubComAutomotechnologiesDoitpayInternalModelsMasterBankAccount](docs/GithubComAutomotechnologiesDoitpayInternalModelsMasterBankAccount.md) - - [GithubComAutomotechnologiesDoitpayInternalModelsMerchantType](docs/GithubComAutomotechnologiesDoitpayInternalModelsMerchantType.md) - - [GithubComAutomotechnologiesDoitpayInternalModelsPartnerType](docs/GithubComAutomotechnologiesDoitpayInternalModelsPartnerType.md) - - [GithubComAutomotechnologiesDoitpayInternalModelsPaymentMethod](docs/GithubComAutomotechnologiesDoitpayInternalModelsPaymentMethod.md) - - [GithubComAutomotechnologiesDoitpayInternalModelsPaymentMethodStatus](docs/GithubComAutomotechnologiesDoitpayInternalModelsPaymentMethodStatus.md) - - [GithubComAutomotechnologiesDoitpayInternalModelsPaymentMethodType](docs/GithubComAutomotechnologiesDoitpayInternalModelsPaymentMethodType.md) - - [GithubComAutomotechnologiesDoitpayInternalModelsTeam](docs/GithubComAutomotechnologiesDoitpayInternalModelsTeam.md) - - [GithubComAutomotechnologiesDoitpayInternalModelsTeamRole](docs/GithubComAutomotechnologiesDoitpayInternalModelsTeamRole.md) - - [GithubComAutomotechnologiesDoitpayInternalModelsTransaction](docs/GithubComAutomotechnologiesDoitpayInternalModelsTransaction.md) - - [GithubComAutomotechnologiesDoitpayInternalModelsTransactionPaymentChannel](docs/GithubComAutomotechnologiesDoitpayInternalModelsTransactionPaymentChannel.md) - - [GithubComAutomotechnologiesDoitpayInternalModelsTransactionStatus](docs/GithubComAutomotechnologiesDoitpayInternalModelsTransactionStatus.md) - - [GithubComAutomotechnologiesDoitpayInternalModelsTransactionType](docs/GithubComAutomotechnologiesDoitpayInternalModelsTransactionType.md) - - [GithubComAutomotechnologiesDoitpayInternalModelsUser](docs/GithubComAutomotechnologiesDoitpayInternalModelsUser.md) - - [GithubComAutomotechnologiesDoitpayInternalUsecaseBusinessDetail](docs/GithubComAutomotechnologiesDoitpayInternalUsecaseBusinessDetail.md) - - [GithubComAutomotechnologiesDoitpayInternalUsecaseBusinessInfo](docs/GithubComAutomotechnologiesDoitpayInternalUsecaseBusinessInfo.md) - - [GithubComAutomotechnologiesDoitpayInternalUsecaseTeamDetail](docs/GithubComAutomotechnologiesDoitpayInternalUsecaseTeamDetail.md) - - [GithubComAutomotechnologiesDoitpayInternalUsecaseUserProfile](docs/GithubComAutomotechnologiesDoitpayInternalUsecaseUserProfile.md) - - [GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader](docs/GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader.md) - - [InternalWebControllersCheckoutApiv1InvoiceBankDetail](docs/InternalWebControllersCheckoutApiv1InvoiceBankDetail.md) - - [InternalWebControllersCheckoutApiv1InvoiceCustomer](docs/InternalWebControllersCheckoutApiv1InvoiceCustomer.md) - - [InternalWebControllersCheckoutApiv1InvoiceInvoiceDetailResponse](docs/InternalWebControllersCheckoutApiv1InvoiceInvoiceDetailResponse.md) - - [InternalWebControllersCheckoutApiv1InvoiceItem](docs/InternalWebControllersCheckoutApiv1InvoiceItem.md) - - [InternalWebControllersCheckoutApiv1InvoicePaymentDetail](docs/InternalWebControllersCheckoutApiv1InvoicePaymentDetail.md) - - [InternalWebControllersCheckoutApiv1InvoicePaymentMethod](docs/InternalWebControllersCheckoutApiv1InvoicePaymentMethod.md) - - [InternalWebControllersCheckoutApiv1InvoiceRedirectURL](docs/InternalWebControllersCheckoutApiv1InvoiceRedirectURL.md) - - [InternalWebControllersCheckoutApiv1InvoiceRequestCreateTransaction](docs/InternalWebControllersCheckoutApiv1InvoiceRequestCreateTransaction.md) - - [InternalWebControllersCheckoutApiv1InvoiceRequestInvoiceCustomer](docs/InternalWebControllersCheckoutApiv1InvoiceRequestInvoiceCustomer.md) - - [InternalWebControllersCheckoutApiv1InvoiceTemplates](docs/InternalWebControllersCheckoutApiv1InvoiceTemplates.md) - - [InternalWebControllersDashboardApiv1AdminAddUserRequest](docs/InternalWebControllersDashboardApiv1AdminAddUserRequest.md) - - [InternalWebControllersDashboardApiv1AdminApprovalRequest](docs/InternalWebControllersDashboardApiv1AdminApprovalRequest.md) - - [InternalWebControllersDashboardApiv1AdminBusinessDetailResponse](docs/InternalWebControllersDashboardApiv1AdminBusinessDetailResponse.md) - - [InternalWebControllersDashboardApiv1AdminSettlementSettlementApprovalRequest](docs/InternalWebControllersDashboardApiv1AdminSettlementSettlementApprovalRequest.md) - - [InternalWebControllersDashboardApiv1ApikeyCreateRequest](docs/InternalWebControllersDashboardApiv1ApikeyCreateRequest.md) - - [InternalWebControllersDashboardApiv1AuthenticateAccessToken](docs/InternalWebControllersDashboardApiv1AuthenticateAccessToken.md) - - [InternalWebControllersDashboardApiv1AuthenticateResetPasswordRequest](docs/InternalWebControllersDashboardApiv1AuthenticateResetPasswordRequest.md) - - [InternalWebControllersDashboardApiv1AuthenticateVerificationRequest](docs/InternalWebControllersDashboardApiv1AuthenticateVerificationRequest.md) - - [InternalWebControllersDashboardApiv1BalanceBalanceDetail](docs/InternalWebControllersDashboardApiv1BalanceBalanceDetail.md) - - [InternalWebControllersDashboardApiv1BalanceTransactionBalanceDetail](docs/InternalWebControllersDashboardApiv1BalanceTransactionBalanceDetail.md) - - [InternalWebControllersDashboardApiv1BusinessAssignCommissionRequest](docs/InternalWebControllersDashboardApiv1BusinessAssignCommissionRequest.md) - - [InternalWebControllersDashboardApiv1BusinessBusinessUpdate](docs/InternalWebControllersDashboardApiv1BusinessBusinessUpdate.md) - - [InternalWebControllersDashboardApiv1BusinessRegisterToTeam](docs/InternalWebControllersDashboardApiv1BusinessRegisterToTeam.md) - - [InternalWebControllersDashboardApiv1CallbackWebhookLogs](docs/InternalWebControllersDashboardApiv1CallbackWebhookLogs.md) - - [InternalWebControllersDashboardApiv1NotificationNotificationDetail](docs/InternalWebControllersDashboardApiv1NotificationNotificationDetail.md) - - [InternalWebControllersDashboardApiv1NotificationNotificationRequest](docs/InternalWebControllersDashboardApiv1NotificationNotificationRequest.md) - - [InternalWebControllersDashboardApiv1OtpVerifyOtpRequest](docs/InternalWebControllersDashboardApiv1OtpVerifyOtpRequest.md) - - [InternalWebControllersDashboardApiv1ProfileBusinessInfo](docs/InternalWebControllersDashboardApiv1ProfileBusinessInfo.md) - - [InternalWebControllersDashboardApiv1ProfileRequestChangePasswordRequest](docs/InternalWebControllersDashboardApiv1ProfileRequestChangePasswordRequest.md) - - [InternalWebControllersDashboardApiv1ProfileUserProfileResponse](docs/InternalWebControllersDashboardApiv1ProfileUserProfileResponse.md) - - [InternalWebControllersDashboardApiv1StatusResponse](docs/InternalWebControllersDashboardApiv1StatusResponse.md) - - [InternalWebControllersDashboardApiv1StatusResponseDoc](docs/InternalWebControllersDashboardApiv1StatusResponseDoc.md) - - [InternalWebControllersDashboardApiv1StatusResponseDocData](docs/InternalWebControllersDashboardApiv1StatusResponseDocData.md) - - [InternalWebControllersDashboardApiv1TransactionTransactionBalance](docs/InternalWebControllersDashboardApiv1TransactionTransactionBalance.md) - - [InternalWebControllersDashboardApiv1TransactionTransactionDetail](docs/InternalWebControllersDashboardApiv1TransactionTransactionDetail.md) - - [InternalWebControllersDashboardApiv1TransactionTransactionHistory](docs/InternalWebControllersDashboardApiv1TransactionTransactionHistory.md) - - [InternalWebControllersMerchantApiv1BalanceBalance](docs/InternalWebControllersMerchantApiv1BalanceBalance.md) - - [InternalWebControllersMerchantApiv1BalanceStandardMeta](docs/InternalWebControllersMerchantApiv1BalanceStandardMeta.md) - - [InternalWebControllersMerchantApiv1BalanceStandardResponse](docs/InternalWebControllersMerchantApiv1BalanceStandardResponse.md) - - [InternalWebControllersMerchantApiv1InvoiceCustomer](docs/InternalWebControllersMerchantApiv1InvoiceCustomer.md) - - [InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse](docs/InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse.md) - - [InternalWebControllersMerchantApiv1InvoiceInvoiceRequest](docs/InternalWebControllersMerchantApiv1InvoiceInvoiceRequest.md) - - [InternalWebControllersMerchantApiv1InvoiceItem](docs/InternalWebControllersMerchantApiv1InvoiceItem.md) - - [InternalWebControllersMerchantApiv1InvoicePaymentMethod](docs/InternalWebControllersMerchantApiv1InvoicePaymentMethod.md) - - [InternalWebControllersMerchantApiv1InvoiceRedirectURL](docs/InternalWebControllersMerchantApiv1InvoiceRedirectURL.md) - - [InternalWebControllersMerchantApiv1InvoiceStandardMeta](docs/InternalWebControllersMerchantApiv1InvoiceStandardMeta.md) - - [InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination](docs/InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination.md) - - [InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse](docs/InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse.md) - - [InternalWebControllersMerchantApiv1InvoiceStandardResponse](docs/InternalWebControllersMerchantApiv1InvoiceStandardResponse.md) - - [InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination](docs/InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination.md) - - [InternalWebControllersMerchantApiv1SimulateSimulateRequest](docs/InternalWebControllersMerchantApiv1SimulateSimulateRequest.md) - - [InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest](docs/InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest.md) - - [InternalWebControllersMerchantApiv1VirtualaccountStandardMeta](docs/InternalWebControllersMerchantApiv1VirtualaccountStandardMeta.md) - - [InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination](docs/InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination.md) - - [InternalWebControllersMerchantApiv1VirtualaccountStandardResponse](docs/InternalWebControllersMerchantApiv1VirtualaccountStandardResponse.md) - - [InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination](docs/InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination.md) - - [InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer](docs/InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer.md) - - [InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse](docs/InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse.md) - - [InternalWebControllersPrivateAsynchandlerApiv1SendnotificationSendNotificationRequest](docs/InternalWebControllersPrivateAsynchandlerApiv1SendnotificationSendNotificationRequest.md) - - -## Documentation For Authorization - - -Authentication schemes defined for the API: -### ApiKeyAuth - -- **Type**: API key -- **API key parameter name**: Authorization -- **Location**: HTTP header - -Note, each API key must be added to a map of `map[string]APIKey` where the key is: Authorization and passed in as the auth context for each request. - -Example - -```golang -auth := context.WithValue( - context.Background(), - sw.ContextAPIKeys, - map[string]sw.APIKey{ - "Authorization": {Key: "API_KEY_STRING"}, - }, - ) -r, err := client.Service.Operation(auth, args) -``` - -### BasicAuth - -- **Type**: HTTP basic authentication - -Example - -```golang -auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ - UserName: "username", - Password: "password", -}) -r, err := client.Service.Operation(auth, args) -``` - -### OAuth2AccessCode - - -- **Type**: OAuth -- **Flow**: accessCode -- **Authorization URL**: https://example.com/oauth/authorize -- **Scopes**: - - **admin**: Grants read and write access to administrative information - -Example +To utilize the SDK, initialize it with your confidential API key which you can get from the [Doitpay Dashboard](https://dashboard.doitpay.co). If you haven't, you can register for a free Dashboard account [here](https://dashboard.doitpay.co/register). ```golang -auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING") -r, err := client.Service.Operation(auth, args) -``` - -Or via OAuth2 module to automatically refresh tokens and perform user authentication. - -```golang -import "golang.org/x/oauth2" - -/* Perform OAuth2 round trip request and obtain a token */ - -tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) -auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource) -r, err := client.Service.Operation(auth, args) -``` - -### OAuth2Application - - -- **Type**: OAuth -- **Flow**: application -- **Authorization URL**: -- **Scopes**: - - **admin**: Grants read and write access to administrative information - - **write**: Grants write access - -Example - -```golang -auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING") -r, err := client.Service.Operation(auth, args) -``` - -Or via OAuth2 module to automatically refresh tokens and perform user authentication. - -```golang -import "golang.org/x/oauth2" - -/* Perform OAuth2 round trip request and obtain a token */ - -tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) -auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource) -r, err := client.Service.Operation(auth, args) -``` - -### OAuth2Implicit - - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: https://example.com/oauth/authorize -- **Scopes**: - - **admin**: Grants read and write access to administrative information - - **write**: Grants write access - -Example - -```golang -auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING") -r, err := client.Service.Operation(auth, args) -``` - -Or via OAuth2 module to automatically refresh tokens and perform user authentication. - -```golang -import "golang.org/x/oauth2" - -/* Perform OAuth2 round trip request and obtain a token */ - -tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) -auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource) -r, err := client.Service.Operation(auth, args) -``` - -### OAuth2Password - - -- **Type**: OAuth -- **Flow**: password -- **Authorization URL**: -- **Scopes**: - - **admin**: Grants read and write access to administrative information - - **read**: Grants read access - - **write**: Grants write access - -Example - -```golang -auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING") -r, err := client.Service.Operation(auth, args) -``` - -Or via OAuth2 module to automatically refresh tokens and perform user authentication. - -```golang -import "golang.org/x/oauth2" - -/* Perform OAuth2 round trip request and obtain a token */ - -tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) -auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource) -r, err := client.Service.Operation(auth, args) +dtp := doitpay.NewClient("API-KEY") ``` +# Documentation -## Documentation for Utility Methods +Access comprehensive API details and sample usages for each of our products by following the links provided below. -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: +* [Balance](docs/balance/BalanceAPI.md) +* [Invoice](docs/invoice/InvoiceAPI.md) +* [Simulate](docs/simulate/SimulateAPI.md) +* [Virtual Account](docs/virtualaccount/VirtualAccountAPI.md) -* `PtrBool` -* `PtrInt` -* `PtrInt32` -* `PtrInt64` -* `PtrFloat` -* `PtrFloat32` -* `PtrFloat64` -* `PtrString` -* `PtrTime` +Read more at: -## Author +* [Doitpay Docs](https://docs.doitpay.co/) +* [Doitpay API Reference](https://developers.doitpay.co/) -support@doitpay.co.id +# Contact Us +support@doitpay.co \ No newline at end of file diff --git a/docs/balance/BalanceAPI.md b/docs/balance/BalanceAPI.md new file mode 100644 index 0000000..de013fb --- /dev/null +++ b/docs/balance/BalanceAPI.md @@ -0,0 +1,63 @@ +# doitpay\BalanceAPI + +All URIs are relative to *https://api.doitpay.co* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetBalance**](BalanceAPI.md#GetBalance) | **Get** /merchant/v1/balance | Obtains the balances for a business. + + + +## GetBalance + +Obtains the balances for a business. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + doitpay "github.com/automotechnologies/doitpay-go" +) + +func main() { + doitpayClient := doitpay.NewAPIClient("API-KEY") + + resp, r, err := doitpayClient.BalanceAPI.GetBalance(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BalanceAPI.GetBalance``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + // response from `GetBalance` + fmt.Fprintf(os.Stdout, "Response from `BalanceAPI.GetBalance`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any path parameters + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetBalanceRequest struct via the builder pattern + +### Return type + +[**Balance**](InternalWebControllersMerchantApiv1BalanceStandardResponse.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../../README.md) + diff --git a/docs/balance/PublicBalanceAPI.md b/docs/balance/PublicBalanceAPI.md deleted file mode 100644 index fef0a8c..0000000 --- a/docs/balance/PublicBalanceAPI.md +++ /dev/null @@ -1,70 +0,0 @@ -# \PublicBalanceAPI - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**GetBalance**](PublicBalanceAPI.md#GetBalance) | **Get** /merchant/v1/balance | Get Balance. - - - -## GetBalance - -> InternalWebControllersMerchantApiv1BalanceStandardResponse GetBalance(ctx).Execute() - -Get Balance. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/automotechnologies/doitpay" -) - -func main() { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PublicBalanceAPI.GetBalance(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PublicBalanceAPI.GetBalance``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetBalance`: InternalWebControllersMerchantApiv1BalanceStandardResponse - fmt.Fprintf(os.Stdout, "Response from `PublicBalanceAPI.GetBalance`: %v\n", resp) -} -``` - -### Path Parameters - -This endpoint does not need any parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a apiGetBalanceRequest struct via the builder pattern - - -### Return type - -[**InternalWebControllersMerchantApiv1BalanceStandardResponse**](InternalWebControllersMerchantApiv1BalanceStandardResponse.md) - -### Authorization - -[BasicAuth](../README.md#BasicAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/invoice/InvoiceAPI.md b/docs/invoice/InvoiceAPI.md new file mode 100644 index 0000000..9ca212f --- /dev/null +++ b/docs/invoice/InvoiceAPI.md @@ -0,0 +1,660 @@ +# doitpay\InvoiceAPI + +All URIs are relative to *https://api.doitpay.co* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateInvoice**](InvoiceAPI.md#CreateInvoice) | **Post** /merchant/v1/invoice | Create invoice for a payment +[**DownloadInvoice**](InvoiceAPI.md#DownloadInvoice) | **Get** /merchant/v1/invoice/download/csv | Download invoices as a CSV file +[**ExpireInvoice**](InvoiceAPI.md#ExpireInvoice) | **Post** /merchant/v1/invoice/{invoice_id}/expire | Expire an invoice by invoice ID +[**GetInvoiceById**](InvoiceAPI.md#GetInvoiceById) | **Get** /merchant/v1/invoice/{invoice_id} | Fetch invoice data by invoice ID +[**GetInvoices**](InvoiceAPI.md#GetInvoices) | **Get** /merchant/v1/invoice | List all created invoices data +[**GetPaymentMethodById**](InvoiceAPI.md#GetPaymentMethodById) | **Get** /merchant/v1/invoice/{invoice_id}/payment-method | Fetch payment method by invoice ID +[**UpdateInvoiceById**](InvoiceAPI.md#UpdateInvoiceById) | **Put** /merchant/v1/invoice/{invoice_id}/update | Update a pending invoice data + + + +## CreateInvoice + +Create invoice for a payment. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + doitpay "github.com/automotechnologies/doitpay-go" + invoice "github.com/automotechnologies/doitpay-go/invoice" +) + +func main() { + doitpayClient := doitpay.NewClient("API-KEY") + + amount := float32(100.50) + amountCurrency := "USD" + country := "US" + addresses := "123 Main St" + city := "Springfield" + customerCountry := "US" + customerRefId := "CUST12345" + email := "john.doe@example.com" + name := "John Doe" + customerNotes := "Preferred customer" + phone := "555-555-5555" + postalCode := int32(62704) + + customer := &invoice.InternalWebControllersMerchantApiv1InvoiceCustomer{ // [OPTIONAL] + Addresses: &addresses, + City: &city, + Country: &customerCountry, + CustomerRefId: &customerRefId, + Email: &email, + Name: &name, + Notes: &customerNotes, + Phone: &phone, + PostalCode: &postalCode, + } + + customerNotification := []string{"email", "sms"} + externalId := "EXT12345" + sku1 := "SKU123" + itemName1 := "Item1" + itemNotes1 := "This is a test item" + price1 := float32(20.00) + quantity1 := int32(2) + + item1 := invoice.InternalWebControllersMerchantApiv1InvoiceItem{ + SKU: &sku1, + Name: &itemName1, + Notes: &itemNotes1, + Price: &price1, + Quantity: &quantity1, + } + + sku2 := "SKU456" + itemName2 := "Item2" + itemNotes2 := "This is another test item" + price2 := float32(15.00) + quantity2 := int32(3) + + item2 := invoice.InternalWebControllersMerchantApiv1InvoiceItem{ + SKU: &sku2, + Name: &itemName2, + Notes: &itemNotes2, + Price: &price2, + Quantity: &quantity2, + } + + items := []invoice.InternalWebControllersMerchantApiv1InvoiceItem{item1, item2} + + notes := "Thank you for your business." + code := "PM123" + status := "active" + paymentType := "credit_card" + + paymentMethod := invoice.InternalWebControllersMerchantApiv1InvoicePaymentMethod{ + Code: &code, + Status: &status, + Type: &paymentType, + } + + paymentMethods := []invoice.InternalWebControllersMerchantApiv1InvoicePaymentMethod{paymentMethod} + + cancelUrl := "https://example.com/cancel" + successUrl := "https://example.com/success" + + redirectUrl := &invoice.InternalWebControllersMerchantApiv1InvoiceRedirectURL{ + Cancel: &cancelUrl, + Success: &successUrl, + } + + timeBegin := "2023-10-25T12:00:00Z" // [OPTIONAL] + timeEnd := "2023-10-25T18:00:00Z" // [OPTIONAL] + + request := invoice.InternalWebControllersMerchantApiv1InvoiceInvoiceRequest{ + Amount: &amount, + AmountCurrency: &amountCurrency, + Country: &country, + Customer: customer, + CustomerNotification: customerNotification, + ExternalId: &externalId, + Items: items, + Notes: ¬es, + PaymentMethods: paymentMethods, + RedirectUrl: redirectUrl, + TimeBegin: &timeBegin, + TimeEnd: &timeEnd, + } + + resp, r, err := doitpayClient.InvoiceAPI.CreateInvoice(context.Background()).Request(request).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InvoiceAPI.CreateInvoice``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + // response from `CreateInvoice` + fmt.Fprintf(os.Stdout, "Response from `InvoiceAPI.CreateInvoice`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateInvoiceRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request** | [**InternalWebControllersMerchantApiv1InvoiceInvoiceRequest**](InternalWebControllersMerchantApiv1InvoiceInvoiceRequest.md) | Request payload to create invoice | + +### Return type + +[**InternalWebControllersMerchantApiv1InvoiceStandardResponse**](InternalWebControllersMerchantApiv1InvoiceStandardResponse.md) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../../README.md) + + +## DownloadInvoice + +Download invoices as a CSV file + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + doitpay "github.com/automotechnologies/doitpay-go" + invoice "github.com/automotechnologies/doitpay-go/invoice" +) + +func main() { + doitpayClient := doitpay.NewAPIClient("API-KEY") + + page := int32(56) // int32 | Page number (optional) (default to 1) + limit := int32(56) // int32 | Page limit (optional) (default to 10) + statuses := "ACTIVE,PENDING" // string | Comma-separated list of statuses to filter by. Example: ?statuses=ACTIVE,PENDING (optional) + + resp, r, err := doitpayClient.InvoiceAPI.DownloadInvoice(context.Background()).Page(page).Limit(limit).Statuses(statuses).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InvoiceAPI.DownloadInvoice``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + // response from `DownloadInvoice` + fmt.Fprintf(os.Stdout, "Response from `InvoiceAPI.DownloadInvoice`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiDownloadInvoiceRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **int32** | Page number | [default to 1] + **limit** | **int32** | Page limit | [default to 10] + **statuses** | **string** | Comma-separated list of statuses to filter by. Example: ?statuses=ACTIVE,PENDING | + +### Return type + +**string** + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../../README.md) + + +## ExpireInvoice + +Expire an invoice by invoice ID + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + doitpay "github.com/automotechnologies/doitpay-go" +) + +func main() { + doitpayClient := doitpay.NewAPIClient("API-KEY") + + invoiceID := "123" // string | Invoice ID to fetch payment method + + resp, r, err := apiClient.InvoiceAPI.ExpireInvoice(context.Background(), invoiceID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InvoiceAPI.ExpireInvoice``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + // response from `ExpireInvoice` + fmt.Fprintf(os.Stdout, "Response from `InvoiceAPI.ExpireInvoice`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**invoiceId** | **string** | Invoice ID to fetch payment method | + +### Other Parameters + +Other parameters are passed through a pointer to a apiExpireInvoiceRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**InternalWebControllersMerchantApiv1InvoiceStandardResponse**](InternalWebControllersMerchantApiv1InvoiceStandardResponse.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../../README.md) + + +## GetInvoiceById + +Fetch invoice data by ID + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + doitpay "github.com/automotechnologies/doitpay-go" +) + +func main() { + doitpayClient := doitpay.NewAPIClient("API-KEY") + + invoiceID := "123" // string | Invoice ID to fetch data + + resp, r, err := doitpayClient.InvoiceAPI.GetInvoiceById(context.Background(), invoiceID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InvoiceAPI.GetInvoiceById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + // response from `GetInvoiceById` + fmt.Fprintf(os.Stdout, "Response from `InvoiceAPI.GetInvoiceById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**invoiceId** | **string** | Invoice ID to fetch data | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetInvoiceByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**InternalWebControllersMerchantApiv1InvoiceStandardResponse**](InternalWebControllersMerchantApiv1InvoiceStandardResponse.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../../README.md) + + +## GetInvoices + +List all created invoice data + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + doitpay "github.com/automotechnologies/doitpay-go" +) + +func main() { + doitpayClient := doitpay.NewAPIClient("API-KEY") + + page := int32(56) // int32 | Page number (optional) (default to 1) + limit := int32(56) // int32 | Page limit (optional) (default to 10) + statuses := "ACTIVE,PENDING" // string | Comma-separated list of statuses to filter by. Example: ?statuses=ACTIVE,PENDING (optional) + + resp, r, err := doitpayClient.InvoiceAPI.GetInvoices(context.Background()).Page(page).Limit(limit).Statuses(statuses).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InvoiceAPI.GetInvoices``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + // response from `GetInvoices` + fmt.Fprintf(os.Stdout, "Response from `InvoiceAPI.GetInvoices`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetInvoicesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **int32** | Page number | [default to 1] + **limit** | **int32** | Page limit | [default to 10] + **statuses** | **string** | Comma-separated list of statuses to filter by. Example: ?statuses=ACTIVE,PENDING | + +### Return type + +[**InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination**](InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../../README.md) + + +## GetPaymentMethodById + +Fetch payment method by invoice ID. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + doitpay "github.com/automotechnologies/doitpay-go" +) + +func main() { + doitpayClient := doitpay.NewAPIClient("API-KEY") + + invoiceID := "123" // string | Invoice ID to fetch payment method + + resp, r, err := doitpayClient.InvoiceAPI.GetPaymentMethodById(context.Background(), invoiceID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InvoiceAPI.GetPaymentMethodById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + // response from `GetPaymentMethodById` + fmt.Fprintf(os.Stdout, "Response from `InvoiceAPI.GetPaymentMethodById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**invoiceId** | **string** | Invoice ID to fetch payment method | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetPaymentMethodByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse**](InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../../README.md) + + +## UpdateInvoiceById + +Update pending invoice data + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + doitpay "github.com/automotechnologies/doitpay-go" + invoice "github.com/automotechnologies/doitpay-go/invoice" +) + +func main() { + invoiceID := "123" // string | invoice id to update + + amount := float32(100.50) + amountCurrency := "USD" + country := "US" + addresses := "123 Main St" + city := "Springfield" + customerCountry := "US" + customerRefId := "CUST12345" + email := "john.doe@example.com" + name := "John Doe" + customerNotes := "Preferred customer" + phone := "555-555-5555" + postalCode := int32(62704) + + customer := &invoice.InternalWebControllersMerchantApiv1InvoiceCustomer{ // [OPTIONAL] + Addresses: &addresses, + City: &city, + Country: &customerCountry, + CustomerRefId: &customerRefId, + Email: &email, + Name: &name, + Notes: &customerNotes, + Phone: &phone, + PostalCode: &postalCode, + } + + customerNotification := []string{"email", "sms"} + externalId := "EXT12345" + sku1 := "SKU123" + itemName1 := "Item1" + itemNotes1 := "This is a test item" + price1 := float32(20.00) + quantity1 := int32(2) + + item1 := invoice.InternalWebControllersMerchantApiv1InvoiceItem{ + SKU: &sku1, + Name: &itemName1, + Notes: &itemNotes1, + Price: &price1, + Quantity: &quantity1, + } + + sku2 := "SKU456" + itemName2 := "Item2" + itemNotes2 := "This is another test item" + price2 := float32(15.00) + quantity2 := int32(3) + + item2 := invoice.InternalWebControllersMerchantApiv1InvoiceItem{ + SKU: &sku2, + Name: &itemName2, + Notes: &itemNotes2, + Price: &price2, + Quantity: &quantity2, + } + + items := []invoice.InternalWebControllersMerchantApiv1InvoiceItem{item1, item2} + + notes := "Thank you for your business." + code := "PM123" + status := "active" + paymentType := "credit_card" + + paymentMethod := invoice.InternalWebControllersMerchantApiv1InvoicePaymentMethod{ + Code: &code, + Status: &status, + Type: &paymentType, + } + + paymentMethods := []invoice.InternalWebControllersMerchantApiv1InvoicePaymentMethod{paymentMethod} + + cancelUrl := "https://example.com/cancel" + successUrl := "https://example.com/success" + + redirectUrl := &invoice.InternalWebControllersMerchantApiv1InvoiceRedirectURL{ + Cancel: &cancelUrl, + Success: &successUrl, + } + + timeBegin := "2023-10-25T12:00:00Z" // [OPTIONAL] + timeEnd := "2023-10-25T18:00:00Z" // [OPTIONAL] + + request := invoice.InternalWebControllersMerchantApiv1InvoiceInvoiceRequest{ + Amount: &amount, + AmountCurrency: &amountCurrency, + Country: &country, + Customer: customer, + CustomerNotification: customerNotification, + ExternalId: &externalId, + Items: items, + Notes: ¬es, + PaymentMethods: paymentMethods, + RedirectUrl: redirectUrl, + TimeBegin: &timeBegin, + TimeEnd: &timeEnd, + } + + doitpayClient := doitpay.NewClient("API-KEY") + + resp, r, err := doitpayClient.InvoiceAPI.UpdateInvoiceById(context.Background(), invoiceID).Request(request).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InvoiceAPI.UpdateInvoiceById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + // response from `UpdateInvoiceById` + fmt.Fprintf(os.Stdout, "Response from `InvoiceAPI.UpdateInvoiceById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**invoiceId** | **string** | invoice id to update | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateInvoiceByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **request** | [**InternalWebControllersMerchantApiv1InvoiceInvoiceRequest**](InternalWebControllersMerchantApiv1InvoiceInvoiceRequest.md) | Invoice Request Body | + +### Return type + +[**InternalWebControllersMerchantApiv1InvoiceStandardResponse**](InternalWebControllersMerchantApiv1InvoiceStandardResponse.md) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../../README.md) + diff --git a/docs/invoice/PublicInvoiceAPI.md b/docs/invoice/PublicInvoiceAPI.md deleted file mode 100644 index 3376c80..0000000 --- a/docs/invoice/PublicInvoiceAPI.md +++ /dev/null @@ -1,503 +0,0 @@ -# \PublicInvoiceAPI - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**CreateInvoice**](PublicInvoiceAPI.md#CreateInvoice) | **Post** /merchant/v1/invoice | Create invoice for a payment. -[**DownloadInvoice**](PublicInvoiceAPI.md#DownloadInvoice) | **Get** /merchant/v1/invoice/download/csv | Download CSV file. -[**ExpireInvoice**](PublicInvoiceAPI.md#ExpireInvoice) | **Post** /merchant/v1/invoice/{invoice_id}/expire | Expire invoice by invoice ID. -[**GetInvoiceById**](PublicInvoiceAPI.md#GetInvoiceById) | **Get** /merchant/v1/invoice/{invoice_id} | Fetch invoice data by ID. -[**GetInvoices**](PublicInvoiceAPI.md#GetInvoices) | **Get** /merchant/v1/invoice | List all created invoice data -[**GetPaymentMethodById**](PublicInvoiceAPI.md#GetPaymentMethodById) | **Get** /merchant/v1/invoice/{invoice_id}/payment-method | Fetch payment method by invoice ID. -[**UpdateInvoiceById**](PublicInvoiceAPI.md#UpdateInvoiceById) | **Put** /merchant/v1/invoice/{invoice_id}/update | Update pending invoice - - - -## CreateInvoice - -> InternalWebControllersMerchantApiv1InvoiceStandardResponse CreateInvoice(ctx).Request(request).Execute() - -Create invoice for a payment. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/automotechnologies/doitpay" -) - -func main() { - request := *openapiclient.NewInternalWebControllersMerchantApiv1InvoiceInvoiceRequest() // InternalWebControllersMerchantApiv1InvoiceInvoiceRequest | Request payload to create invoice - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PublicInvoiceAPI.CreateInvoice(context.Background()).Request(request).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PublicInvoiceAPI.CreateInvoice``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `CreateInvoice`: InternalWebControllersMerchantApiv1InvoiceStandardResponse - fmt.Fprintf(os.Stdout, "Response from `PublicInvoiceAPI.CreateInvoice`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiCreateInvoiceRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **request** | [**InternalWebControllersMerchantApiv1InvoiceInvoiceRequest**](InternalWebControllersMerchantApiv1InvoiceInvoiceRequest.md) | Request payload to create invoice | - -### Return type - -[**InternalWebControllersMerchantApiv1InvoiceStandardResponse**](InternalWebControllersMerchantApiv1InvoiceStandardResponse.md) - -### Authorization - -[BasicAuth](../README.md#BasicAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## DownloadInvoice - -> string DownloadInvoice(ctx).Page(page).Limit(limit).Statuses(statuses).Execute() - -Download CSV file. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/automotechnologies/doitpay" -) - -func main() { - page := int32(56) // int32 | Page number (optional) (default to 1) - limit := int32(56) // int32 | Page limit (optional) (default to 10) - statuses := "statuses_example" // string | Comma-separated list of statuses to filter by. Example: ?statuses=ACTIVE,PENDING (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PublicInvoiceAPI.DownloadInvoice(context.Background()).Page(page).Limit(limit).Statuses(statuses).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PublicInvoiceAPI.DownloadInvoice``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `DownloadInvoice`: string - fmt.Fprintf(os.Stdout, "Response from `PublicInvoiceAPI.DownloadInvoice`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiDownloadInvoiceRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **page** | **int32** | Page number | [default to 1] - **limit** | **int32** | Page limit | [default to 10] - **statuses** | **string** | Comma-separated list of statuses to filter by. Example: ?statuses=ACTIVE,PENDING | - -### Return type - -**string** - -### Authorization - -[BasicAuth](../README.md#BasicAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ExpireInvoice - -> InternalWebControllersMerchantApiv1InvoiceStandardResponse ExpireInvoice(ctx, invoiceId).Execute() - -Expire invoice by invoice ID. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/automotechnologies/doitpay" -) - -func main() { - invoiceId := "invoiceId_example" // string | Invoice ID to fetch payment method - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PublicInvoiceAPI.ExpireInvoice(context.Background(), invoiceId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PublicInvoiceAPI.ExpireInvoice``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ExpireInvoice`: InternalWebControllersMerchantApiv1InvoiceStandardResponse - fmt.Fprintf(os.Stdout, "Response from `PublicInvoiceAPI.ExpireInvoice`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**invoiceId** | **string** | Invoice ID to fetch payment method | - -### Other Parameters - -Other parameters are passed through a pointer to a apiExpireInvoiceRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**InternalWebControllersMerchantApiv1InvoiceStandardResponse**](InternalWebControllersMerchantApiv1InvoiceStandardResponse.md) - -### Authorization - -[BasicAuth](../README.md#BasicAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## GetInvoiceById - -> InternalWebControllersMerchantApiv1InvoiceStandardResponse GetInvoiceById(ctx, invoiceId).Execute() - -Fetch invoice data by ID. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/automotechnologies/doitpay" -) - -func main() { - invoiceId := "invoiceId_example" // string | Invoice ID to fetch data - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PublicInvoiceAPI.GetInvoiceById(context.Background(), invoiceId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PublicInvoiceAPI.GetInvoiceById``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetInvoiceById`: InternalWebControllersMerchantApiv1InvoiceStandardResponse - fmt.Fprintf(os.Stdout, "Response from `PublicInvoiceAPI.GetInvoiceById`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**invoiceId** | **string** | Invoice ID to fetch data | - -### Other Parameters - -Other parameters are passed through a pointer to a apiGetInvoiceByIdRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**InternalWebControllersMerchantApiv1InvoiceStandardResponse**](InternalWebControllersMerchantApiv1InvoiceStandardResponse.md) - -### Authorization - -[BasicAuth](../README.md#BasicAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## GetInvoices - -> InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination GetInvoices(ctx).Page(page).Limit(limit).Statuses(statuses).Execute() - -List all created invoice data - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/automotechnologies/doitpay" -) - -func main() { - page := int32(56) // int32 | Page number (optional) (default to 1) - limit := int32(56) // int32 | Page limit (optional) (default to 10) - statuses := "statuses_example" // string | Comma-separated list of statuses to filter by. Example: ?statuses=ACTIVE,PENDING (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PublicInvoiceAPI.GetInvoices(context.Background()).Page(page).Limit(limit).Statuses(statuses).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PublicInvoiceAPI.GetInvoices``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetInvoices`: InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination - fmt.Fprintf(os.Stdout, "Response from `PublicInvoiceAPI.GetInvoices`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiGetInvoicesRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **page** | **int32** | Page number | [default to 1] - **limit** | **int32** | Page limit | [default to 10] - **statuses** | **string** | Comma-separated list of statuses to filter by. Example: ?statuses=ACTIVE,PENDING | - -### Return type - -[**InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination**](InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination.md) - -### Authorization - -[BasicAuth](../README.md#BasicAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## GetPaymentMethodById - -> InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse GetPaymentMethodById(ctx, invoiceId).Execute() - -Fetch payment method by invoice ID. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/automotechnologies/doitpay" -) - -func main() { - invoiceId := "invoiceId_example" // string | Invoice ID to fetch payment method - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PublicInvoiceAPI.GetPaymentMethodById(context.Background(), invoiceId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PublicInvoiceAPI.GetPaymentMethodById``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetPaymentMethodById`: InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse - fmt.Fprintf(os.Stdout, "Response from `PublicInvoiceAPI.GetPaymentMethodById`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**invoiceId** | **string** | Invoice ID to fetch payment method | - -### Other Parameters - -Other parameters are passed through a pointer to a apiGetPaymentMethodByIdRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse**](InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse.md) - -### Authorization - -[BasicAuth](../README.md#BasicAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## UpdateInvoiceById - -> InternalWebControllersMerchantApiv1InvoiceStandardResponse UpdateInvoiceById(ctx, invoiceId).Request(request).Execute() - -Update pending invoice - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/automotechnologies/doitpay" -) - -func main() { - invoiceId := "invoiceId_example" // string | invoice id to update - request := *openapiclient.NewInternalWebControllersMerchantApiv1InvoiceInvoiceRequest() // InternalWebControllersMerchantApiv1InvoiceInvoiceRequest | Invoice Request Body - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PublicInvoiceAPI.UpdateInvoiceById(context.Background(), invoiceId).Request(request).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PublicInvoiceAPI.UpdateInvoiceById``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `UpdateInvoiceById`: InternalWebControllersMerchantApiv1InvoiceStandardResponse - fmt.Fprintf(os.Stdout, "Response from `PublicInvoiceAPI.UpdateInvoiceById`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**invoiceId** | **string** | invoice id to update | - -### Other Parameters - -Other parameters are passed through a pointer to a apiUpdateInvoiceByIdRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **request** | [**InternalWebControllersMerchantApiv1InvoiceInvoiceRequest**](InternalWebControllersMerchantApiv1InvoiceInvoiceRequest.md) | Invoice Request Body | - -### Return type - -[**InternalWebControllersMerchantApiv1InvoiceStandardResponse**](InternalWebControllersMerchantApiv1InvoiceStandardResponse.md) - -### Authorization - -[BasicAuth](../README.md#BasicAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/simulate/PublicSimulateAPI.md b/docs/simulate/PublicSimulateAPI.md deleted file mode 100644 index 829c11d..0000000 --- a/docs/simulate/PublicSimulateAPI.md +++ /dev/null @@ -1,73 +0,0 @@ -# \PublicSimulateAPI - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**SimulatePayment**](PublicSimulateAPI.md#SimulatePayment) | **Post** /merchant/v1/simulate-payment | SimulatePayment is handler for simulate payment system. - - - -## SimulatePayment - -> SimulatePayment(ctx).Request(request).Execute() - -SimulatePayment is handler for simulate payment system. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/automotechnologies/doitpay" -) - -func main() { - request := *openapiclient.NewInternalWebControllersMerchantApiv1SimulateSimulateRequest() // InternalWebControllersMerchantApiv1SimulateSimulateRequest | Request payload to simulate payment - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.PublicSimulateAPI.SimulatePayment(context.Background()).Request(request).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PublicSimulateAPI.SimulatePayment``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiSimulatePaymentRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **request** | [**InternalWebControllersMerchantApiv1SimulateSimulateRequest**](InternalWebControllersMerchantApiv1SimulateSimulateRequest.md) | Request payload to simulate payment | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/simulate/SimulateAPI.md b/docs/simulate/SimulateAPI.md new file mode 100644 index 0000000..18ff64a --- /dev/null +++ b/docs/simulate/SimulateAPI.md @@ -0,0 +1,76 @@ +# doitpay\SimulateAPI + +All URIs are relative to *https://api.doitpay.co* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**SimulatePayment**](SimulateAPI.md#SimulatePayment) | **Post** /merchant/v1/simulate-payment | Simulate payment of the system. + + + +## SimulatePayment + +Simulate payment of the system. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + doitpay "github.com/automotechnologies/doitpay-go" + simulate "github.com/automotechnologies/doitpay-go/simulate" +) + +func main() { + doitpayClient := doitpay.NewAPIClient("API-KEY") + + accountNumber := "12345678" + paymentIdentifier := "sample payment identifier" + + request := simulate.InternalWebControllersMerchantApiv1SimulateSimulateRequest{ // [REQUIRED] + AccountNumber: &accountNumber, + PaymentIdentifier: &paymentIdentifier, + } + + doitpayClient := doitpay.NewAPIClient("API-KEY") + + r, err := apiClient.SimulateAPI.SimulatePayment(context.Background()).Request(request).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SimulateAPI.SimulatePayment``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + +This endpoint does not need any path parameters + +### Other Parameters + +Other parameters are passed through a pointer to a apiSimulatePaymentRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request** | [**InternalWebControllersMerchantApiv1SimulateSimulateRequest**](InternalWebControllersMerchantApiv1SimulateSimulateRequest.md) | Request payload to simulate payment | + +### Return type + + (empty response body) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) +[[Back to README]](../../README.md) + diff --git a/docs/virtualaccount/PublicVirtualAccountAPI.md b/docs/virtualaccount/PublicVirtualAccountAPI.md deleted file mode 100644 index ce81e95..0000000 --- a/docs/virtualaccount/PublicVirtualAccountAPI.md +++ /dev/null @@ -1,288 +0,0 @@ -# \PublicVirtualAccountAPI - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**CreateVirtualAccount**](PublicVirtualAccountAPI.md#CreateVirtualAccount) | **Post** /merchant/v1/virtual-account | Create virtual account data. -[**GetVirtualAccountById**](PublicVirtualAccountAPI.md#GetVirtualAccountById) | **Get** /merchant/v1/virtual-account/{virtualAccountId} | Fetch virtual account data by ID. -[**GetVirtualAccountByNumber**](PublicVirtualAccountAPI.md#GetVirtualAccountByNumber) | **Get** /merchant/v1/virtual-account/number/{virtualAccountNumber} | Fetch virtual account data by virtual account number. -[**GetVirtualAccounts**](PublicVirtualAccountAPI.md#GetVirtualAccounts) | **Get** /merchant/v1/virtual-account | List all created virtual account data. - - - -## CreateVirtualAccount - -> InternalWebControllersMerchantApiv1VirtualaccountStandardResponse CreateVirtualAccount(ctx).Request(request).Execute() - -Create virtual account data. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/automotechnologies/doitpay" -) - -func main() { - request := *openapiclient.NewInternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest() // InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest | Request payload to create virtual account - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PublicVirtualAccountAPI.CreateVirtualAccount(context.Background()).Request(request).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PublicVirtualAccountAPI.CreateVirtualAccount``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `CreateVirtualAccount`: InternalWebControllersMerchantApiv1VirtualaccountStandardResponse - fmt.Fprintf(os.Stdout, "Response from `PublicVirtualAccountAPI.CreateVirtualAccount`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiCreateVirtualAccountRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **request** | [**InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest**](InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest.md) | Request payload to create virtual account | - -### Return type - -[**InternalWebControllersMerchantApiv1VirtualaccountStandardResponse**](InternalWebControllersMerchantApiv1VirtualaccountStandardResponse.md) - -### Authorization - -[BasicAuth](../README.md#BasicAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## GetVirtualAccountById - -> InternalWebControllersMerchantApiv1VirtualaccountStandardResponse GetVirtualAccountById(ctx, virtualAccountId).Execute() - -Fetch virtual account data by ID. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/automotechnologies/doitpay" -) - -func main() { - virtualAccountId := int32(56) // int32 | Virtual Account ID - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PublicVirtualAccountAPI.GetVirtualAccountById(context.Background(), virtualAccountId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PublicVirtualAccountAPI.GetVirtualAccountById``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetVirtualAccountById`: InternalWebControllersMerchantApiv1VirtualaccountStandardResponse - fmt.Fprintf(os.Stdout, "Response from `PublicVirtualAccountAPI.GetVirtualAccountById`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**virtualAccountId** | **int32** | Virtual Account ID | - -### Other Parameters - -Other parameters are passed through a pointer to a apiGetVirtualAccountByIdRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**InternalWebControllersMerchantApiv1VirtualaccountStandardResponse**](InternalWebControllersMerchantApiv1VirtualaccountStandardResponse.md) - -### Authorization - -[BasicAuth](../README.md#BasicAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## GetVirtualAccountByNumber - -> InternalWebControllersMerchantApiv1VirtualaccountStandardResponse GetVirtualAccountByNumber(ctx, virtualAccountNumber).Execute() - -Fetch virtual account data by virtual account number. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/automotechnologies/doitpay" -) - -func main() { - virtualAccountNumber := "virtualAccountNumber_example" // string | Virtual Account Number - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PublicVirtualAccountAPI.GetVirtualAccountByNumber(context.Background(), virtualAccountNumber).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PublicVirtualAccountAPI.GetVirtualAccountByNumber``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetVirtualAccountByNumber`: InternalWebControllersMerchantApiv1VirtualaccountStandardResponse - fmt.Fprintf(os.Stdout, "Response from `PublicVirtualAccountAPI.GetVirtualAccountByNumber`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**virtualAccountNumber** | **string** | Virtual Account Number | - -### Other Parameters - -Other parameters are passed through a pointer to a apiGetVirtualAccountByNumberRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**InternalWebControllersMerchantApiv1VirtualaccountStandardResponse**](InternalWebControllersMerchantApiv1VirtualaccountStandardResponse.md) - -### Authorization - -[BasicAuth](../README.md#BasicAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## GetVirtualAccounts - -> InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination GetVirtualAccounts(ctx).Page(page).Limit(limit).Statuses(statuses).Execute() - -List all created virtual account data. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/automotechnologies/doitpay" -) - -func main() { - page := int32(56) // int32 | Page number (optional) (default to 1) - limit := int32(56) // int32 | Page limit (optional) (default to 10) - statuses := "statuses_example" // string | Comma-separated list of statuses to filter by. Example: ?statuses=ACTIVE,PENDING (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PublicVirtualAccountAPI.GetVirtualAccounts(context.Background()).Page(page).Limit(limit).Statuses(statuses).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PublicVirtualAccountAPI.GetVirtualAccounts``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetVirtualAccounts`: InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination - fmt.Fprintf(os.Stdout, "Response from `PublicVirtualAccountAPI.GetVirtualAccounts`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiGetVirtualAccountsRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **page** | **int32** | Page number | [default to 1] - **limit** | **int32** | Page limit | [default to 10] - **statuses** | **string** | Comma-separated list of statuses to filter by. Example: ?statuses=ACTIVE,PENDING | - -### Return type - -[**InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination**](InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination.md) - -### Authorization - -[BasicAuth](../README.md#BasicAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/virtualaccount/VirtualAccountAPI.md b/docs/virtualaccount/VirtualAccountAPI.md new file mode 100644 index 0000000..c045d7c --- /dev/null +++ b/docs/virtualaccount/VirtualAccountAPI.md @@ -0,0 +1,305 @@ +# doitpay\VirtualAccountAPI + +All URIs are relative to *https://api.doitpay.co* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateVirtualAccount**](VirtualAccountAPI.md#CreateVirtualAccount) | **Post** /merchant/v1/virtual-account | Create virtual account data +[**GetVirtualAccountById**](VirtualAccountAPI.md#GetVirtualAccountById) | **Get** /merchant/v1/virtual-account/{virtualAccountId} | Fetch virtual account data by ID +[**GetVirtualAccountByNumber**](VirtualAccountAPI.md#GetVirtualAccountByNumber) | **Get** /merchant/v1/virtual-account/number/{virtualAccountNumber} | Fetch virtual account data by virtual account number +[**GetVirtualAccounts**](VirtualAccountAPI.md#GetVirtualAccounts) | **Get** /merchant/v1/virtual-account | List all created virtual account data + + + +## CreateVirtualAccount + +Create virtual account data + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + doitpay "github.com/automotechnologies/doitpay-go" + virtualaccount "github.com/automotechnologies/doitpay-go/virtualaccount" +) + +func main() { + doitpayClient := doitpay.NewClient("API-KEY") + + amount := float32(200.00) + amountMax := float32(300.00) + amountMin := float32(100.00) + businessId := int32(101) + currency := "USD" + name := "John Doe" + email := "john.doe@example.com" + phone := "555-555-5555" + expirationDate := "2024-10-25" + isClosed := false + isReusable := true + paymentMethodCode := "PMC789" + referenceId := "REF12345" + referenceInternalId := "INT67890" + virtualAccountSuffix := "VAS456" + + customer := virtualaccount.InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer{ + Name: &name, + Email: &email, + Phone: &phone, + } + + request := virtualaccount.InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest{ + Amount: &amount, + AmountMax: &amountMax, + AmountMin: &amountMin, + BusinessId: &businessId, + Currency: ¤cy, + Customer: &customer, + ExpirationDate: &expirationDate, + IsClosed: &isClosed, + IsReusable: &isReusable, + PaymentMethodCode: &paymentMethodCode, + ReferenceId: &referenceId, + ReferenceInternalId: &referenceInternalId, + VirtualAccountSuffix: &virtualAccountSuffix, + } + + resp, r, err := doitpayClient.VirtualAccountAPI.CreateVirtualAccount(context.Background()).Request(request).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VirtualAccountAPI.CreateVirtualAccount``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + // response from `CreateVirtualAccount` + fmt.Fprintf(os.Stdout, "Response from `VirtualAccountAPI.CreateVirtualAccount`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateVirtualAccountRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request** | [**InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest**](InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest.md) | Request payload to create virtual account | + +### Return type + +[**InternalWebControllersMerchantApiv1VirtualaccountStandardResponse**](InternalWebControllersMerchantApiv1VirtualaccountStandardResponse.md) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../../README.md) + + +## GetVirtualAccountById + +Fetch virtual account data by ID + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + doitpay "github.com/automotechnologies/doitpay-go" +) + +func main() { + doitpayClient := doitpay.NewClient("API-KEY") + + virtualAccountID := int32(123) // int32 | Virtual Account ID + + resp, r, err := doitpayClient.VirtualAccountAPI.GetVirtualAccountById(context.Background(), virtualAccountId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VirtualAccountAPI.GetVirtualAccountById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + // response from `GetVirtualAccountById` + fmt.Fprintf(os.Stdout, "Response from `VirtualAccountAPI.GetVirtualAccountById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**virtualAccountId** | **int32** | Virtual Account ID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetVirtualAccountByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**InternalWebControllersMerchantApiv1VirtualaccountStandardResponse**](InternalWebControllersMerchantApiv1VirtualaccountStandardResponse.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../../README.md) + + +## GetVirtualAccountByNumber + +Fetch virtual account data by virtual account number + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + doitpay "github.com/automotechnologies/doitpay-go" +) + +func main() { + doitpayClient := doitpay.NewClient("API-KEY") + + virtualAccountNumber := "12345678" // string | Virtual Account Number + + resp, r, err := doitpayClient.VirtualAccountAPI.GetVirtualAccountByNumber(context.Background(), virtualAccountNumber).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VirtualAccountAPI.GetVirtualAccountByNumber``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + // response from `GetVirtualAccountByNumber` + fmt.Fprintf(os.Stdout, "Response from `VirtualAccountAPI.GetVirtualAccountByNumber`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**virtualAccountNumber** | **string** | Virtual Account Number | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetVirtualAccountByNumberRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**InternalWebControllersMerchantApiv1VirtualaccountStandardResponse**](InternalWebControllersMerchantApiv1VirtualaccountStandardResponse.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../../README.md) + + +## GetVirtualAccounts + +List all created virtual account data + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + doitpay "github.com/automotechnologies/doitpay-go" +) + +func main() { + doitpayClient := doitpay.NewClient("API-KEY") + + page := int32(1) // int32 | Page number (optional) (default to 1) + limit := int32(20) // int32 | Page limit (optional) (default to 10) + statuses := "ACTIVE,PENDING" // string | Comma-separated list of statuses to filter by. Example: ?statuses=ACTIVE,PENDING (optional) + + resp, r, err := doitpayClient.VirtualAccountAPI.GetVirtualAccounts(context.Background()).Page(page).Limit(limit).Statuses(statuses).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VirtualAccountAPI.GetVirtualAccounts``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + // response from `GetVirtualAccounts` + fmt.Fprintf(os.Stdout, "Response from `VirtualAccountAPI.GetVirtualAccounts`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetVirtualAccountsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **int32** | Page number | [default to 1] + **limit** | **int32** | Page limit | [default to 10] + **statuses** | **string** | Comma-separated list of statuses to filter by. Example: ?statuses=ACTIVE,PENDING | + +### Return type + +[**InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination**](InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../../README.md) +