package
0.0.31
Repository: https://github.com/hhow09/go-ecpay-sdk.git
Documentation: pkg.go.dev

# README

Go API client for ecpayBase

綠界金流 API 定義文件

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 0.0.24
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientExperimentalCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import sw "./ecpayBase"

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.

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

ctx := context.WithValue(context.Background(), sw.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 identifield 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.

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

Documentation for API Endpoints

All URIs are relative to https://payment.ecpay.com.tw

ClassMethodHTTP requestDescription
CallBackApiCallbackPeriodReturnURLPostPost /callback/PeriodReturnURL
CallBackApiCallbackReturnURLPostPost /callback/ReturnURL
ECPayApiQueryCreditCardPeriodInfoPost /Cashier/QueryCreditCardPeriodInfo
ECPayApiQueryTradeInfoPost /Cashier/QueryTradeInfo/V5

Documentation For Models

Documentation For Authorization

Endpoints do not require authorization.

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

# Functions

CacheExpires helper function to determine remaining time before repeating a request.
No description provided by the author
NewAioCheckOutAtmOption instantiates a new AioCheckOutAtmOption object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewAioCheckOutAtmOptionWithDefaults instantiates a new AioCheckOutAtmOption object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewAioCheckOutCreditInstallmentOption instantiates a new AioCheckOutCreditInstallmentOption object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewAioCheckOutCreditInstallmentOptionWithDefaults instantiates a new AioCheckOutCreditInstallmentOption object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewAioCheckOutCreditOnetimeOption instantiates a new AioCheckOutCreditOnetimeOption object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewAioCheckOutCreditOnetimeOptionWithDefaults instantiates a new AioCheckOutCreditOnetimeOption object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewAioCheckOutCreditOption instantiates a new AioCheckOutCreditOption object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewAioCheckOutCreditOptionWithDefaults instantiates a new AioCheckOutCreditOption object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewAioCheckOutCreditPeriodOption instantiates a new AioCheckOutCreditPeriodOption object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewAioCheckOutCreditPeriodOptionWithDefaults instantiates a new AioCheckOutCreditPeriodOption object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewAioCheckOutCvsBarcodeOption instantiates a new AioCheckOutCvsBarcodeOption object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewAioCheckOutCvsBarcodeOptionWithDefaults instantiates a new AioCheckOutCvsBarcodeOption object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewAioCheckOutGeneralOption instantiates a new AioCheckOutGeneralOption object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewAioCheckOutGeneralOptionWithDefaults instantiates a new AioCheckOutGeneralOption object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewAioCheckOutInvoiceOption instantiates a new AioCheckOutInvoiceOption object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewAioCheckOutInvoiceOptionWithDefaults instantiates a new AioCheckOutInvoiceOption object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewAPIClient creates a new API client.
NewAPIResponse returns a new APIResonse object.
NewAPIResponseWithError returns a new APIResponse object with the provided error message.
NewConfiguration returns a new Configuration object.
NewCreditCardPeriodInfo instantiates a new CreditCardPeriodInfo object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewCreditCardPeriodInfoWithDefaults instantiates a new CreditCardPeriodInfo object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewExecLogRecord instantiates a new ExecLogRecord object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewExecLogRecordWithDefaults instantiates a new ExecLogRecord object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewOrderResult instantiates a new OrderResult object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewOrderResultWithDefaults instantiates a new OrderResult object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewPeriodOrderResult instantiates a new PeriodOrderResult object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewPeriodOrderResultWithDefaults instantiates a new PeriodOrderResult object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewQueryCreditCardPeriodInfoRequest instantiates a new QueryCreditCardPeriodInfoRequest object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewQueryCreditCardPeriodInfoRequestWithDefaults instantiates a new QueryCreditCardPeriodInfoRequest object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewQueryTradeInfoRequest instantiates a new QueryTradeInfoRequest object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewQueryTradeInfoRequestWithDefaults instantiates a new QueryTradeInfoRequest object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewTradeInfo instantiates a new TradeInfo object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewTradeInfoWithDefaults instantiates a new TradeInfo object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
No description provided by the author
PtrBool is a helper routine that returns a pointer to given integer value.
PtrFloat32 is a helper routine that returns a pointer to given float value.
PtrFloat64 is a helper routine that returns a pointer to given float value.
PtrInt is a helper routine that returns a pointer to given integer value.
PtrInt32 is a helper routine that returns a pointer to given integer value.
PtrInt64 is a helper routine that returns a pointer to given integer value.
PtrString is a helper routine that returns a pointer to given string value.
PtrTime is helper routine that returns a pointer to given Time value.

# Constants

List of AioCheckPaymentTypeEnum.
List of BindingCardEnum.
List of BindingCardEnum.
List of CarruerTypeEnum.
List of CarruerTypeEnum.
List of CarruerTypeEnum.
List of CarruerTypeEnum.
List of ChoosePaymentEnum.
List of ChoosePaymentEnum.
List of ChoosePaymentEnum.
List of ChoosePaymentEnum.
List of ChoosePaymentEnum.
List of ChoosePaymentEnum.
List of ChooseSubPaymentEnum.
List of ChooseSubPaymentEnum.
List of ChooseSubPaymentEnum.
List of ChooseSubPaymentEnum.
List of ChooseSubPaymentEnum.
List of ChooseSubPaymentEnum.
List of ChooseSubPaymentEnum.
List of ChooseSubPaymentEnum.
List of ChooseSubPaymentEnum.
List of ChooseSubPaymentEnum.
List of ChooseSubPaymentEnum.
List of ChooseSubPaymentEnum.
List of ChooseSubPaymentEnum.
List of ChooseSubPaymentEnum.
List of ChooseSubPaymentEnum.
List of ChooseSubPaymentEnum.
List of ChooseSubPaymentEnum.
List of ChooseSubPaymentEnum.
List of ClearanceMarkEnum.
List of ClearanceMarkEnum.
List of CreditPeriodTypeEnum.
List of CreditPeriodTypeEnum.
List of CreditPeriodTypeEnum.
No description provided by the author
List of EncryptTypeEnum.
List of ExecStatusEnum.
List of ExecStatusEnum.
List of ExecStatusEnum.
List of InvoiceDonationEunm.
List of InvoiceDonationEunm.
List of InvoiceMarkEnum.
List of InvoiceMarkEnum.
List of InvoicePrintEnum.
List of InvoicePrintEnum.
List of LanguageEnum.
List of LanguageEnum.
List of LanguageEnum.
List of LanguageEnum.
List of NeedExtraPaidInfoEnum.
List of NeedExtraPaidInfoEnum.
List of RedeemEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of ReturnPaymentTypeEnum.
List of SimulatePaidEnum.
List of SimulatePaidEnum.
List of TaxTypeEnum.
List of TaxTypeEnum.
List of TaxTypeEnum.
List of TaxTypeEnum.
List of UnionPayEnum.
List of UnionPayEnum.
List of UnionPayEnum.

# Variables

ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAPIKeys takes a string apikey as authentication for the request.
ContextBasicAuth takes BasicAuth as authentication for the request.
ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request.
ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
ContextOperationServerIndices uses a server configuration from the index mapping.
ContextOperationServerVariables overrides a server configuration variables using operation specific values.
ContextServerIndex uses a server configuration from the index.
ContextServerVariables overrides a server configuration variables.

# Structs

AioCheckOutAtmOption struct for AioCheckOutAtmOption.
AioCheckOutCreditInstallmentOption struct for AioCheckOutCreditInstallmentOption.
AioCheckOutCreditOnetimeOption struct for AioCheckOutCreditOnetimeOption.
AioCheckOutCreditOption struct for AioCheckOutCreditOption.
AioCheckOutCreditPeriodOption struct for AioCheckOutCreditPeriodOption.
AioCheckOutCvsBarcodeOption struct for AioCheckOutCvsBarcodeOption.
AioCheckOutGeneralOption struct for AioCheckOutGeneralOption.
AioCheckOutInvoiceOption struct for AioCheckOutInvoiceOption.
APIClient manages communication with the ECPay API API v0.0.24 In most cases there should be only one, shared, APIClient.
APIKey provides API key based authentication to a request passed via context using ContextAPIKey.
APIResponse stores the API response returned by the server.
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth.
Configuration stores the configuration of the API client.
CreditCardPeriodInfo struct for CreditCardPeriodInfo.
ExecLogRecord **每次授權明細** 每一次的授權紀錄。 例如,若已成功授權 3 次(TotalSuccessTimes 為 3),則會顯示 3 筆授權紀錄。 欄位內容詳見下列定期定額授權明細之參數說明。.
GenericOpenAPIError Provides access to the body, error and model on returned errors.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
OrderResult struct for OrderResult.
PeriodOrderResult struct for PeriodOrderResult.
QueryCreditCardPeriodInfoRequest struct for QueryCreditCardPeriodInfoRequest.
QueryTradeInfoRequest struct for QueryTradeInfoRequest.
ServerConfiguration stores the information about a server.
ServerVariable stores the information about a server variable.
TradeInfo struct for TradeInfo.

# Type aliases

AioCheckPaymentTypeEnum **交易類型** 請固定填入 `aio`.
BindingCardEnum **記憶卡號** 使用記憶信用卡 使用:請傳 `1` 不使用:請傳 `0`.
CallBackApiService CallBackApi service.
CarruerTypeEnum **載具類別** 若為無載具時,則請帶空字串。 若為特店載具時,則請帶 `1`。 若為買受人之自然人憑證號碼時,則請帶 `2`。 若為買受人之手機條碼資料時,則請帶`3`。 若統一編號 `CustomerIdentifier` 有值時,則載具類別不可為特店載具或自然人憑證載具。 注意事項:當`Print`有值時,載具類別不得有值。.
ChoosePaymentEnum **選擇預設付款方式** 綠界提供下列付款方式,請於建立訂單時傳送過來: - `Credit`: 信用卡及銀聯卡(需申請開通) - `WebATM`: 網路 ATM - `ATM`: 自動櫃員機 - `CVS`: 超商代碼 - `BARCODE`: 超商條碼 - `ALL`: 不指定付款方式,由綠界顯示付款方式選擇頁面。 注意事項: 1.若為手機版時不支援下列付款方式: - WebATM:網路 ATM 2.如需要不透過綠界畫面取得 `ATM`、`CVS`、`BARCODE` 的繳費代碼,請參考 FAQ。.
ChooseSubPaymentEnum **付款子項目** 若設定此參數,建立訂單將轉導至綠界訂單成立頁,依設定的付款方式及付款子項目帶入訂單,無法選擇其他付款子項目。 請參考付款方式一覽表.
ClearanceMarkEnum **通關方式** 當課稅類別`TaxType`為 `2`(零稅率)時,則該參數請帶 `1`(非經海關出口)或 `2`(經海關出口)。.
CreditPeriodTypeEnum **週期種類** 可設定以下參數: `D`:以天為週期 `M`:以月為週期 `Y`:以年為週期.
Decoder is going to support these non implemented content-type.
ECPayApiService ECPayApi service.
No description provided by the author
EncryptTypeEnum **CheckMacValue加密類型** 請固定填入 `1`,使用 SHA256 加密。.
ExecStatusEnum **執行狀態** 回傳值如下: 1.若為 `0` 時代表已取消 2.若為 `1` 時代表執行中 3.若為 `2` 時代表執行完成.
InvoiceDonationEunm **捐贈註記** 若為捐贈時,參數請帶:`1`。 若為不捐贈或統一編號 `CustomerIdentifier` 有值時,參數請帶:`0`。.
InvoiceMarkEnum **電子發票開立註記** 此參數為付款完成後同時開立電子發票。 若要使用時,該參數須設定為「Y」,同時還要設定「電子發票介接相關參數」 注意事項: 正式環境欲使用電子發票功能,須與綠界申請開通,若未開通請致電客服中心 `(02) 2655-1775`。.
InvoicePrintEnum **列印註記** 若為不列印或捐贈註記`Donation`為1(捐贈)時,請帶:`0`。 若為列印或統一編號`CustomerIdentifier`有值時,請帶:`1`.
LanguageEnum **語系設定** 預設語系為中文,若要變更語系參數值請帶: - 英語:`ENG` - 韓語:`KOR` - 日語:`JPN` - 簡體中文:`CHI`.
NeedExtraPaidInfoEnum **是否需要額外的付款資訊** 額外的付款資訊: 若不回傳額外的付款資訊時,參數值請傳:`N`; 若要回傳額外的付款資訊時,參數值請傳:`Y`,付款完成後綠界會以 Server POST 方式回傳額外付款資訊。 注意事項: 回傳額外付款資訊參數請參考-額外回傳的參數.
RedeemEnum **信用卡是否使用紅利折抵** 設為 Y 時,當綠界特店選擇信用卡付款時,會進入紅利折抵的交易流程。 注意事項: 紅利折抵請參考信用卡紅利折抵辦法.
ReturnPaymentTypeEnum **特店選擇的付款方式** 請參考回覆付款方式一覽表.
ServerConfigurations stores multiple ServerConfiguration items.
SimulatePaidEnum **是否為模擬付款** 回傳值: 若為 `1` 時,代表此交易為模擬付款,請勿出貨。 若為 `0` 時,代表此交易非模擬付款。 注意事項: 特店可透過廠商後台網站來針對單筆訂單模擬綠界回傳付款通知,以方便介接 API 的測試。.
TaxTypeEnum **課稅類別** 若為應稅,請帶 `1`。 若為零稅率,請帶 `2`。 若為免稅,請帶 `3`。 若為混合應稅與免稅或零稅率時(限收銀機發票無法分辨時使用,且需通過申請核可),則請帶 `9`。.
UnionPayEnum **銀聯卡交易選項** 可帶入以下選項: `0`: 消費者於交易頁面可選擇是否使用銀聯交易。 `1`: 只使用銀聯卡交易,且綠界會將交易頁面直接導到銀聯網站。 `2`: 不可使用銀聯卡,綠界會將交易頁面隱藏銀聯選項。 注意事項: 1.若需使用銀聯卡服務,請與綠界提出申請方可使用,測試環境未提供銀聯卡服務。 2.不支援信用卡分期付款及定期定額。 3.不支援信用卡紅利折抵 4.不支援信用卡記憶卡號功能.