Documentation
¶
Index ¶
- Constants
- Variables
- type Tokipay
- type TokipayDeeplinkDataResponse
- type TokipayDeeplinkRequest
- type TokipayDeeplinkResponse
- type TokipayPaymentInput
- type TokipayPaymentQrRequest
- type TokipayPaymentRequestResponse
- type TokipayPaymentResponse
- type TokipayPaymentResponseExt
- type TokipayPaymentScanUserRequest
- type TokipayPaymentSentUserRequest
- type TokipayPaymentStatusDataResponse
- type TokipayPaymentStatusResponse
- type TokipayRefundInput
- type TokipayRefundRequest
- type TokipayThirdPartyPhoneRequest
- type TokipayThirdPartyPhoneResponse
Constants ¶
Variables ¶
View Source
var ( TokipayPaymentQr = utils.API{ Url: "/jump/v4/spose/payment/request", Method: http.MethodPost, } TokipayPaymentSentUser = utils.API{ Url: "/jump/v4/spose/payment/user-request", Method: http.MethodPost, } TokipayPaymentScanUser = utils.API{ Url: "/jump/v4/spose/payment/scan/user-request", Method: http.MethodPost, } TokipayPaymentStatus = utils.API{ Url: "/jump/v4/spose/payment/status?requestId=", Method: http.MethodGet, } TokipayPaymentCancel = utils.API{ Url: "/jump/v4/spose/payment/request?requestId=", Method: http.MethodDelete, } TokipayRefund = utils.API{ Url: "/jump/v4/spose/payment/refund", Method: http.MethodPut, } TokipayDeeplink = utils.API{ Url: "/jump/v1/third-party/payment/deeplink", Method: http.MethodPost, } TokipayPhoneRequest = utils.API{ Url: "/jump/v1/third-party/payment/request", Method: http.MethodPost, } TokipayTransactionStatus = utils.API{ Url: "/jump/v1/third-party/payment/status?requestId=", Method: http.MethodGet, } )
SocialPay
Functions ¶
This section is empty.
Types ¶
type Tokipay ¶
type Tokipay interface {
PaymentQr(input TokipayPaymentInput) (TokipayPaymentResponse, error)
PaymentSentUser(input TokipayPaymentInput) (TokipayPaymentResponse, error)
PaymentScanUser(input TokipayPaymentInput) (TokipayPaymentResponse, error)
PaymentStatus(requestId string) (TokipayPaymentStatusResponse, error)
PaymentCancel(requestId string) (TokipayPaymentStatusResponse, error)
PaymentThirdPartyDeeplink(input TokipayPaymentInput) (TokipayDeeplinkResponse, error)
PaymentThirdPartyPhoneRequest(input TokipayPaymentInput) (TokipayThirdPartyPhoneResponse, error)
PaymentThirdPartyStatus(requestId string) (TokipayPaymentStatusResponse, error)
}
func New ¶
func New(endpoint, apiKey, imApiKey, authorization, merchantId, successUrl, failureUrl, appSchemaIos string) Tokipay
New creates a new instance of the tokipay client with the provided configuration. Parameters:
- endpoint: The API endpoint URL. (don't need to add jump/v4/spose)
- apiKey: The API key for authentication.
- imApiKey: The IM API key for additional services.
- authorization: The authorization token for requests.
- merchantId: The merchant identifier.
- successUrl: The URL to redirect to upon a successful payment.
- failureUrl: The URL to redirect to upon a failed payment.
- appSchemaIos: The iOS app schema for deep linking.
Returns a Tokipay interface for interacting with the payment API.
type TokipayDeeplinkDataResponse ¶
type TokipayDeeplinkDataResponse struct {
Deeplink string `json:"deeplink"`
}
type TokipayDeeplinkRequest ¶
type TokipayDeeplinkRequest struct {
SuccessUrl string `json:"successUrl"`
FailureUrl string `json:"failureUrl"`
OrderId string `json:"orderId"`
MerchantId string `json:"merchantId"`
Amount int64 `json:"amount"`
Notes string `json:"notes"`
AppSchemaIos string `json:"appSchemaIos"`
Authorization string `json:"authorization"`
TokiWebSuccessUrl string `json:"tokiWebSuccessUrl"`
TokiWebFailureUrl string `json:"tokiWebFailureUrl"`
}
type TokipayDeeplinkResponse ¶
type TokipayDeeplinkResponse struct {
StatusCode int `json:"statusCode"`
Error string `json:"error"`
Message string `json:"message"`
Data TokipayDeeplinkDataResponse `json:"data"`
Type string `json:"type"`
}
type TokipayPaymentInput ¶
type TokipayPaymentQrRequest ¶
type TokipayPaymentQrRequest struct {
SuccessUrl string `json:"successUrl"`
FailureUrl string `json:"failureUrl"`
OrderId string `json:"orderId"`
MerchantId string `json:"merchantId"`
Amount int64 `json:"amount"`
Notes string `json:"notes"`
Authorization string `json:"authorization"`
}
Tokipay Payment Qr Request
type TokipayPaymentRequestResponse ¶
type TokipayPaymentRequestResponse struct {
RequestId string `json:"requestId"`
}
type TokipayPaymentResponse ¶
type TokipayPaymentResponse struct {
StatusCode int `json:"statusCode"`
Error string `json:"error"`
Message string `json:"message"`
Data TokipayPaymentRequestResponse `json:"data"`
Type string `json:"type"`
}
Tokipay Payment Response
type TokipayPaymentScanUserRequest ¶
type TokipayPaymentScanUserRequest struct {
SuccessUrl string `json:"successUrl"`
FailureUrl string `json:"failureUrl"`
OrderId string `json:"orderId"`
MerchantId string `json:"merchantId"`
Amount int64 `json:"amount"`
Notes string `json:"notes"`
Authorization string `json:"authorization"`
RequestId string `json:"requestId"`
}
Tokipay Payment Scan user request
type TokipayPaymentSentUserRequest ¶
type TokipayPaymentSentUserRequest struct {
SuccessUrl string `json:"successUrl"`
FailureUrl string `json:"failureUrl"`
OrderId string `json:"orderId"`
MerchantId string `json:"merchantId"`
Amount int64 `json:"amount"`
Notes string `json:"notes"`
Authorization string `json:"authorization"`
PhoneNo string `json:"phoneNo"`
CountryCode string `json:"countryCode"`
}
Tokipay Payment Sent user request
type TokipayPaymentStatusDataResponse ¶
type TokipayPaymentStatusDataResponse struct {
Status string `json:"status"`
}
type TokipayPaymentStatusResponse ¶
type TokipayPaymentStatusResponse struct {
StatusCode int `json:"statusCode"`
Error string `json:"error"`
Message string `json:"message"`
Data TokipayPaymentStatusDataResponse `json:"data"`
Type string `json:"type"`
}
type TokipayRefundInput ¶
type TokipayRefundRequest ¶
type TokipayThirdPartyPhoneRequest ¶
type TokipayThirdPartyPhoneRequest struct {
SuccessUrl string `json:"successUrl"`
FailureUrl string `json:"failureUrl"`
OrderId string `json:"orderId"`
MerchantId string `json:"merchantId"`
Amount int64 `json:"amount"`
Notes string `json:"notes"`
PhoneNo string `json:"phoneNo"`
CountryCode string `json:"countryCode"`
Authorization string `json:"authorization"`
TokiWebSuccessUrl string `json:"tokiWebSuccessUrl"`
TokiWebFailureUrl string `json:"tokiWebFailureUrl"`
}
Click to show internal directories.
Click to hide internal directories.