├── .gitignore ├── CHANGELOG.md ├── LEGAL.md ├── LICENSE ├── README.md ├── com └── alipay │ ├── api │ ├── defaultAlipayClient.go │ ├── exception │ │ └── exception.go │ ├── model │ │ ├── AccountBalance.go │ │ ├── AcquirerInfo.go │ │ ├── AgreementInfo.go │ │ ├── Amount.go │ │ ├── AntomPathConstants.go │ │ ├── ApplePayConfiguration.go │ │ ├── AttachmentType.go │ │ ├── AuthCodeForm.go │ │ ├── AuthMetaData.go │ │ ├── AuthorizationError.go │ │ ├── AvailablePaymentMethod.go │ │ ├── CancellationType.go │ │ ├── CardBrand.go │ │ ├── CardInfo.go │ │ ├── Certificate.go │ │ ├── ChallengeActionForm.go │ │ ├── ClassType.go │ │ ├── CodeDetail.go │ │ ├── CreditPayPlan.go │ │ ├── CustomerBelongsTo.go │ │ ├── CustomsInfo.go │ │ ├── DeclarationRecord.go │ │ ├── DeliveryMethodType.go │ │ ├── DisableReasonType.go │ │ ├── Discount.go │ │ ├── DisputeEvidenceFormatType.go │ │ ├── DisputeNotificationType.go │ │ ├── GrantType.go │ │ ├── HttpMethod.go │ │ ├── IdentityCheckResult.go │ │ ├── Logo.go │ │ ├── MerchantInfo.go │ │ ├── MerchantType.go │ │ ├── Order.go │ │ ├── OrderCodeForm.go │ │ ├── OrderInfo.go │ │ ├── OsType.go │ │ ├── PaymentDetail.go │ │ ├── PaymentFactor.go │ │ ├── PaymentMethod.go │ │ ├── PaymentMethodDetail.go │ │ ├── PaymentMethodInfo.go │ │ ├── PaymentMethodType.go │ │ ├── PaymentOption.go │ │ ├── PaymentResultInfo.go │ │ ├── PaymentVerificationData.go │ │ ├── PeriodRule.go │ │ ├── PeriodType.go │ │ ├── ProductCodeType.go │ │ ├── PromotionResult.go │ │ ├── PromotionType.go │ │ ├── PspCustomerInfo.go │ │ ├── Quote.go │ │ ├── RedirectActionForm.go │ │ ├── RefundDetail.go │ │ ├── RefundRecord.go │ │ ├── ScopeType.go │ │ ├── SettlementDetail.go │ │ ├── SettlementInfo.go │ │ ├── SettlementStrategy.go │ │ ├── SubscriptionStatus.go │ │ ├── SupportCardBrand.go │ │ ├── TerminalType.go │ │ ├── Transaction.go │ │ ├── TransactionStatusType.go │ │ ├── TransferFromDetail.go │ │ ├── TransferToDetail.go │ │ ├── TransitType.go │ │ ├── Trial.go │ │ └── WalletPaymentMethodType.go │ ├── request │ │ ├── AlipayRequest.go │ │ ├── AlipayRequestInterface.go │ │ ├── auth │ │ │ ├── AlipayAuthApplyTokenRequest.go │ │ │ ├── AlipayAuthConsultRequest.go │ │ │ ├── AlipayAuthCreateSessionRequest.go │ │ │ ├── AlipayAuthQueryTokenRequest.go │ │ │ └── AlipayAuthRevokeTokenRequest.go │ │ ├── customs │ │ │ ├── AlipayCustomsDeclareRequest.go │ │ │ └── AlipayCustomsQueryRequest.go │ │ ├── dispute │ │ │ ├── AlipayAcceptDisputeRequest.go │ │ │ ├── AlipayDownloadDisputeEvidenceRequest.go │ │ │ └── AlipaySupplyDefenseDocumentRequest.go │ │ ├── marketplace │ │ │ ├── AlipayCreatePayoutRequest.go │ │ │ ├── AlipayCreateTransferRequest.go │ │ │ ├── AlipayInquireBalanceRequest.go │ │ │ ├── AlipayRegisterRequest.go │ │ │ ├── AlipaySettleRequest.go │ │ │ ├── AlipaySettlementInfoUpdateRequest.go │ │ │ └── AlipaySubmitAttachmentRequest.go │ │ ├── notify │ │ │ ├── AlipayAuthNotify.go │ │ │ ├── AlipayCaptureResultNotify.go │ │ │ ├── AlipayDisputeNotify.go │ │ │ ├── AlipayNotify.go │ │ │ ├── AlipayPayResultNotify.go │ │ │ ├── AlipayRefundNotify.go │ │ │ ├── AlipaySubscriptionNotify.go │ │ │ ├── AlipaySubscriptionPayNotify.go │ │ │ └── AlipayVaultingNotify.go │ │ ├── pay │ │ │ ├── AlipayCaptureRequest.go │ │ │ ├── AlipayDeviceCertificateRequest.go │ │ │ ├── AlipayInquiryRefundRequest.go │ │ │ ├── AlipayPayCancelRequest.go │ │ │ ├── AlipayPayConsultRequest.go │ │ │ ├── AlipayPayQueryRequest.go │ │ │ ├── AlipayPayRequest.go │ │ │ ├── AlipayPaymentSessionRequest.go │ │ │ ├── AlipayRefundRequest.go │ │ │ ├── AlipaySyncArrearRequest.go │ │ │ └── AlipayUploadInvoiceShippingFileRequest.go │ │ ├── risk │ │ │ ├── RiskDecideRequest.go │ │ │ ├── RiskReportRequest.go │ │ │ ├── SendPaymentResultRequest.go │ │ │ └── SendRefundResultRequest.go │ │ ├── subscription │ │ │ ├── AlipaySubscriptionCancelRequest.go │ │ │ ├── AlipaySubscriptionChangeRequest.go │ │ │ ├── AlipaySubscriptionCreateRequest.go │ │ │ └── AlipaySubscriptionUpdateRequest.go │ │ └── vaulting │ │ │ ├── AlipayVaultingPaymentMethodRequest.go │ │ │ ├── AlipayVaultingQueryRequest.go │ │ │ └── AlipayVaultingSessionRequest.go │ ├── response │ │ ├── AlipayResponse.go │ │ ├── auth │ │ │ ├── AlipayAuthApplyTokenResponse.go │ │ │ ├── AlipayAuthConsultResponse.go │ │ │ ├── AlipayAuthCreateSessionResponse.go │ │ │ ├── AlipayAuthQueryTokenResponse.go │ │ │ └── AlipayAuthRevokeTokenResponse.go │ │ ├── customs │ │ │ ├── AlipayCustomsDeclareResponse.go │ │ │ └── AlipayCustomsQueryResponse.go │ │ ├── dispute │ │ │ ├── AlipayAcceptDisputeResponse.go │ │ │ ├── AlipayDownloadDisputeEvidenceResponse.go │ │ │ └── AlipaySupplyDefenseDocumentResponse.go │ │ ├── marketplace │ │ │ ├── AlipayCreatePayoutResponse.go │ │ │ ├── AlipayCreateTransferResponse.go │ │ │ ├── AlipayInquireBalanceResponse.go │ │ │ ├── AlipayRegisterResponse.go │ │ │ ├── AlipaySettleResponse.go │ │ │ ├── AlipaySettlementInfoUpdateResponse.go │ │ │ └── AlipaySubmitAttachmentResponse.go │ │ ├── pay │ │ │ ├── AlipayCaptureResponse.go │ │ │ ├── AlipayDeviceCertificateResponse.go │ │ │ ├── AlipayInquiryRefundResponse.go │ │ │ ├── AlipayPayCancelResponse.go │ │ │ ├── AlipayPayConsultResponse.go │ │ │ ├── AlipayPayQueryResponse.go │ │ │ ├── AlipayPayResponse.go │ │ │ ├── AlipayPaymentSessionResponse.go │ │ │ ├── AlipayRefundResponse.go │ │ │ ├── AlipaySyncArrearResponse.go │ │ │ └── AlipayUploadInvoiceShippingFileResponse.go │ │ ├── risk │ │ │ ├── RiskDecideResponse.go │ │ │ ├── RiskReportResponse.go │ │ │ ├── SendPaymentResultResponse.go │ │ │ └── SendRefundResultResponse.go │ │ ├── subscription │ │ │ ├── AlipaySubscriptionCancelResponse.go │ │ │ ├── AlipaySubscriptionChangeResponse.go │ │ │ ├── AlipaySubscriptionCreateResponse.go │ │ │ └── AlipaySubscriptionUpdateResponse.go │ │ └── vaulting │ │ │ ├── AlipayVaultingPaymentMethodResponse.go │ │ │ ├── AlipayVaultingQueryResponse.go │ │ │ └── AlipayVaultingSessionResponse.go │ └── tools │ │ ├── SignatureTool.go │ │ └── WebhookTool.go │ └── example │ ├── auth_demo.go │ ├── customs_demo.go │ ├── dispute.go │ ├── marketplace_demo.go │ ├── pay_demo.go │ ├── subscription_demo.go │ └── vaulting_demo.go ├── go.mod └── go.sum /.gitignore: -------------------------------------------------------------------------------- 1 | # 忽略操作系统生成的文件 2 | .DS_Store 3 | Thumbs.db 4 | 5 | # 忽略 Go 编译生成的二进制文件 6 | *.exe 7 | *.exe~ 8 | *.dll 9 | *.so 10 | *.dylib 11 | *.test 12 | *.out 13 | 14 | # 忽略构建输出目录 15 | /bin/ 16 | /build/ 17 | /dist/ 18 | 19 | # 忽略缓存和依赖文件 20 | vendor/ 21 | /go.sum 22 | /go.work 23 | 24 | # 忽略 go build 生成的文件 25 | /tmp/ 26 | *.o 27 | *.a 28 | 29 | # 忽略测试生成的文件 30 | /coverage.out 31 | 32 | # 忽略 go tool 编译缓存目录 33 | /go-build/ 34 | 35 | # 忽略临时文件 36 | *.swp 37 | *.tmp 38 | *.log 39 | 40 | # 忽略编辑器或 IDE 生成的文件 41 | *.sublime-workspace 42 | *.sublime-project 43 | *.iml 44 | .idea/ 45 | /.vscode/ -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 1.2.12 - 2025-04-10 4 | * [#14](https://github.com/alipay/global-open-sdk-go/pull/14) feature-250410 5 | - Antom 印度渠道接入AMS拒付相关接口的标准变更 6 | - Antom印度渠道接入(UPI/CARD/NETBAKING)相关接口标准变更 7 | - CKP二期支持商户传入支付方式地区和支付方式要素 8 | 9 | ## 1.2.11 - 2025-02-05 10 | * [#13](https://github.com/alipay/global-open-sdk-go/pull/13) feature-250205 11 | - 支付、查询、支付结果通知新增卡相关信息字段 12 | 13 | ## 1.2.10 - 2025-01-22 14 | * [#12](https://github.com/alipay/global-open-sdk-go/pull/12) feature-250122 15 | - update promotionResults 16 | 17 | 18 | ## 1.2.9 - 2025-01-06 19 | * [#11](https://github.com/alipay/global-open-sdk-go/pull/11) feature-250106 20 | - 订阅支付新增“更新接口” 21 | - 增加验签 22 | 23 | ## 1.2.8 - 2024-12-24 24 | * [#10](https://github.com/alipay/global-open-sdk-go/pull/10) feature-241224 25 | - CKP二期支持商户传入可选支付方式列表 26 | - AMS独立绑卡支持MIT交易 27 | 28 | 29 | ## 1.2.7 - 2024-12-16 30 | * [#9](https://github.com/alipay/global-open-sdk-go/pull/9) feature-241216 31 | - RDR拒付通知优化通用能力变更 32 | - Antom新增ApplePay支付方式 33 | 34 | ## 1.2.6 - 2024-12-02 35 | * [#8](https://github.com/alipay/global-open-sdk-go/pull/8) feature-241202 36 | - update AlipayDisputeNotify 37 | - update AlipayPayQueryResponse 38 | 39 | ## 1.2.5 - 2024-11-25 40 | * [#7](https://github.com/alipay/global-open-sdk-go/pull/7) feature-241125 41 | - update AlipayPayResultNotify 42 | - update AlipayPayQueryRequest 43 | 44 | ## 1.2.5 - 2024-11-25 45 | * [#6](https://github.com/alipay/global-open-sdk-go/pull/6) feature-241125 46 | - update Leg 47 | 48 | ## 1.2.4 - 2024-10-24 49 | * [#5](https://github.com/alipay/global-open-sdk-go/pull/5) feature-notify 50 | - update notify 51 | 52 | ## 1.2.3 - 2024-10-21 53 | * [#4](https://github.com/alipay/global-open-sdk-go/pull/4) feature-241022 54 | - add AlipayVaultingSessionRequest.is3DSAuthentication哈啰集成绑卡SDK 55 | - add AlipayAuthConsultRequest.authMetaData AE企业支付宝代扣集成方案 56 | - add Boolean  request.order.needDeclaration 57 | 58 | ## 1.2.2 - 2024-10-18 59 | * [#4](https://github.com/alipay/global-open-sdk-go/pull/4) update-example 60 | 61 | 62 | ## 1.2.1 - 2024-09-30 63 | * [#3](https://github.com/alipay/global-open-sdk-go/pull/3) update-p1 64 | * add MARKETPLACE - demo 65 | * add vaulting - demo 66 | * add Dispute - demo 67 | * add risk 68 | * add Notify 69 | 70 | 71 | ## 1.2.0 - 2024-09-27 72 | * [#2](https://github.com/alipay/global-open-sdk-go/pull/2) go-sdk-update-release 73 | * go-sdk-update-release 74 | 75 | ## 1.1.0 - 2024-09-27 76 | * [#1](https://github.com/alipay/global-open-sdk-go/pull/1) go-sdk-init 77 | * go-sdk-init 78 | 79 | ## 1.0.3- 2024-09-14 80 | * pay-update 81 | * update:alipayPayRequest 82 | * add:payments/syncArrear 83 | * add:payments/createDeviceCertificate 84 | 85 | ## 1.0.2 - 2024-09-14 86 | * add subscription example 87 | 88 | ## 1.0.1 - 2024-09-04 89 | * update:ScopeType 90 | * add TAOBAO_REBIND 91 | 92 | ## 1.0.0 - 2024-09-04 93 | * Init object library 94 | * Add pay - request response 95 | * Add auth - request response 96 | * Add customs - request response 97 | * Add subscription - request response 98 | * Add defaultAlipayClient 99 | * Add genSign(httpMethod string, path string, clientId string, reqTime string, reqBody string, merchantPrivateKey string) (string, error); 100 | * Add Sign(privateKey *rsa.PrivateKey, data []byte) (string, error); 101 | * Add (alipayClient *DefaultAlipayClient) Execute(alipayRequest *request.AlipayRequest) (any, error); 102 | * Add (alipayClient *DefaultAlipayClient) httpDo(url, method string, params, headers map[string]string, data []byte, alipayResponse any) (any, error) 103 | 104 | 105 | -------------------------------------------------------------------------------- /LEGAL.md: -------------------------------------------------------------------------------- 1 | Legal Disclaimer 2 | 3 | Within this source code, the comments in Chinese shall be the original, governing version. Any comment in other languages are for reference only. In the event of any conflict between the Chinese language version comments and other language version comments, the Chinese language version shall prevail. 4 | 5 | 法律免责声明 6 | 7 | 关于代码注释部分,中文注释为官方版本,其它语言注释仅做参考。中文注释可能与其它语言注释存在不一致,当中文注释与其它语言注释存在不一致时,请以中文注释为准。 -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Alipay 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ``` 2 | Language:GO 3 | GO version:1.22.5+ 4 | Tags:v1.2.12 5 | Copyright:Ant financial services group 6 | ``` 7 | 8 | #### 1 Please use the latest version 9 | 10 | https://mvnrepository.com/artifact/com.alipay.global.sdk/global-open-sdk-go 11 | 12 | ``` 13 | go get github.com/alipay/global-open-sdk-go 14 | ``` 15 | 16 | #### 2 The demo code for create payment 17 | ``` 18 | payRequest, request := pay.NewAlipayPayRequest() 19 | 20 | request.PaymentRequestId = "ad716a-81-4c4c-b51-20916c5225e" 21 | order := &model.Order{} 22 | order.OrderDescription = "example order" 23 | order.ReferenceOrderId = "28947397358748" 24 | order.OrderAmount = model.NewAmount("100", "HKD") 25 | merchant := &model.Merchant{} 26 | merchant.ReferenceMerchantId = "1238rye8yr8erwer" 27 | merchant.MerchantMCC = "7011" 28 | merchant.MerchantName = "example merchant" 29 | merchant.Store = &model.Store{StoreMCC: "7011", ReferenceStoreId: "289285674", StoreName: "store 1111"} 30 | order.Merchant = merchant 31 | order.Env = &model.Env{OsType: model.ANDROID, TerminalType: model.WEB} 32 | request.Order = order 33 | 34 | request.PaymentAmount = model.NewAmount("100", "HKD") 35 | 36 | request.PaymentNotifyUrl = "https://www.yourNotifyUrl.com" 37 | request.PaymentRedirectUrl = "https://www.yourRedirectUrl.com" 38 | 39 | request.PaymentMethod = &model.PaymentMethod{PaymentMethodType: model.ALIPAY_HK, PaymentMethodId: "1234567890"} 40 | 41 | request.ProductCode = model.CASHIER_PAYMENT 42 | 43 | execute, err := client.Execute(payRequest) 44 | if err != nil { 45 | print(err.Error()) 46 | return 47 | } 48 | response := execute.(*responsePay.AlipayPayResponse) 49 | ``` 50 | 51 | The execute method contains the HTTP request to the gateway. 52 | ``` 53 | type DefaultAlipayClient struct { 54 | GatewayUrl string 55 | ClientId string 56 | MerchantPrivateKey string 57 | AlipayPublicKey string 58 | IsSandboxMode bool 59 | } 60 | 61 | func NewDefaultAlipayClient(gatewayUrl string, clientId string, merchantPrivateKey string, alipayPublicKey string) *DefaultAlipayClient { 62 | isSandboxMode := false 63 | if strings.HasPrefix(clientId, "SANDBOX_") { 64 | isSandboxMode = true 65 | } 66 | 67 | return &DefaultAlipayClient{ 68 | GatewayUrl: gatewayUrl, 69 | ClientId: clientId, 70 | MerchantPrivateKey: merchantPrivateKey, 71 | AlipayPublicKey: alipayPublicKey, 72 | IsSandboxMode: isSandboxMode, 73 | } 74 | } 75 | 76 | func (alipayClient *DefaultAlipayClient) Execute(alipayRequest *request.AlipayRequest) (any, error) { 77 | reqPayload, err := json.Marshal(alipayRequest.Param) 78 | if err != nil { 79 | return nil, &exception.AlipaySDKError{Message: "json.Marshal is fail " + err.Error()} 80 | } 81 | path := alipayRequest.Path 82 | httpMethod := alipayRequest.HttpMethod 83 | reqTime := strconv.FormatInt(time.Now().UnixNano(), 10) 84 | sign, err := genSign(fmt.Sprintf("%s", httpMethod), path, alipayClient.ClientId, reqTime, string(reqPayload), getPkcsKeu(alipayClient.MerchantPrivateKey)) 85 | if err != nil { 86 | return nil, err 87 | } 88 | header := buildBaseHeader(reqTime, alipayClient.ClientId, alipayRequest.KeyVersion, sign) 89 | alipayResponse, err := alipayClient.httpDo(alipayClient.GatewayUrl+path, httpMethod, map[string]string{}, header, reqPayload, alipayRequest.AlipayResponse) 90 | if err != nil { 91 | return nil, err 92 | } 93 | return alipayResponse, nil 94 | } 95 | 96 | ``` 97 | 98 | -------------------------------------------------------------------------------- /com/alipay/api/defaultAlipayClient.go: -------------------------------------------------------------------------------- 1 | package defaultAlipayClient 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "fmt" 7 | "github.com/alipay/global-open-sdk-go/com/alipay/api/exception" 8 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 9 | "github.com/alipay/global-open-sdk-go/com/alipay/api/tools" 10 | "io/ioutil" 11 | "net" 12 | "net/http" 13 | "strconv" 14 | "strings" 15 | "time" 16 | ) 17 | 18 | const readTimeout = 15 * time.Second 19 | const connectTimeout = 15 * time.Second 20 | const totalTimeout = 30 * time.Second 21 | 22 | type DefaultAlipayClient struct { 23 | GatewayUrl string 24 | ClientId string 25 | MerchantPrivateKey string 26 | AlipayPublicKey string 27 | IsSandboxMode bool 28 | } 29 | 30 | /** 31 | * 构造方法 32 | * @param gatewayUrl 网关地址 33 | * @param clientId 应用ID 34 | * @param merchantPrivateKey 商户私钥 35 | * @param alipayPublicKey 支付宝公钥 36 | */ 37 | func NewDefaultAlipayClient(gatewayUrl string, clientId string, merchantPrivateKey string, alipayPublicKey string) *DefaultAlipayClient { 38 | isSandboxMode := false 39 | if strings.HasPrefix(clientId, "SANDBOX_") { 40 | isSandboxMode = true 41 | } 42 | 43 | return &DefaultAlipayClient{ 44 | GatewayUrl: gatewayUrl, 45 | ClientId: clientId, 46 | MerchantPrivateKey: merchantPrivateKey, 47 | AlipayPublicKey: alipayPublicKey, 48 | IsSandboxMode: isSandboxMode, 49 | } 50 | } 51 | 52 | // @Description 支持任意方式的http请求 53 | // @Param url 请求地址 54 | // @Param method 请求方式 55 | // @Param headers 请求header头设置 56 | // @Param params 请求地址栏后需要拼接参数操作 57 | // @Param data 请求报文 58 | // @Return 返回类型 "错误信息" 59 | func (alipayClient *DefaultAlipayClient) httpDo(url, method string, params, headers map[string]string, data []byte, alipayResponse any) (any, error) { 60 | 61 | trans := &http.Transport{ 62 | DialContext: (&net.Dialer{ 63 | Timeout: connectTimeout, 64 | }).DialContext, 65 | ResponseHeaderTimeout: readTimeout, 66 | } 67 | 68 | //自定义client 69 | client := &http.Client{ 70 | Timeout: totalTimeout, 71 | Transport: trans, 72 | } 73 | //http.post等方法只是在NewRequest上又封装来了一层而已 74 | req, err := http.NewRequest(method, url, bytes.NewBuffer(data)) 75 | if err != nil { 76 | return nil, &exception.AlipayLibraryError{Message: "http.NewRequest is fail " + err.Error()} 77 | } 78 | req.Header.Set("Content-type", "application/json") 79 | 80 | //add params 81 | q := req.URL.Query() 82 | if params != nil { 83 | for key, val := range params { 84 | q.Add(key, val) 85 | } 86 | req.URL.RawQuery = q.Encode() 87 | } 88 | if headers != nil { 89 | for key, val := range headers { 90 | req.Header.Add(key, val) 91 | } 92 | } 93 | resp, err := client.Do(req) 94 | if err != nil { 95 | return nil, &exception.AlipayLibraryError{Message: "client.Do is fail " + err.Error()} 96 | } 97 | defer resp.Body.Close() 98 | body, err := ioutil.ReadAll(resp.Body) 99 | responseTime := resp.Header.Get("response-time") 100 | sign, err := checkRspSign(resp.Request.Method, req.URL.Path, resp.Header.Get("Client-id"), responseTime, string(body), resp.Header.Get("Signature"), alipayClient.AlipayPublicKey) 101 | if err != nil { 102 | return nil, &exception.AlipayLibraryError{Message: "checkRspSign is fail " + err.Error()} 103 | } 104 | if !sign { 105 | return nil, &exception.AlipayLibraryError{Message: "check signature fail"} 106 | } 107 | //通过指针将request的response值赋值,这样虽然是any类型, 108 | //但是我们在上次必然已经定义了any的类型 109 | err = json.Unmarshal(body, alipayResponse) 110 | if err != nil { 111 | return nil, &exception.AlipayLibraryError{Message: "json.Unmarshal is fail " + err.Error()} 112 | } 113 | 114 | return alipayResponse, nil 115 | } 116 | 117 | func (alipayClient *DefaultAlipayClient) Execute(alipayRequest *request.AlipayRequest) (any, error) { 118 | reqPayload, err := json.Marshal(alipayRequest.Param) 119 | if err != nil { 120 | return nil, &exception.AlipayLibraryError{Message: "json.Marshal is fail " + err.Error()} 121 | } 122 | path := alipayRequest.Path 123 | httpMethod := alipayRequest.HttpMethod 124 | reqTime := strconv.FormatInt(time.Now().UnixNano(), 10) 125 | sign, err := tools.GenSign(fmt.Sprintf("%s", httpMethod), path, alipayClient.ClientId, reqTime, string(reqPayload), alipayClient.MerchantPrivateKey) 126 | if err != nil { 127 | return nil, err 128 | } 129 | header := buildBaseHeader(reqTime, alipayClient.ClientId, alipayRequest.KeyVersion, sign) 130 | alipayResponse, err := alipayClient.httpDo(alipayClient.GatewayUrl+path, httpMethod, map[string]string{}, header, reqPayload, alipayRequest.AlipayResponse) 131 | if err != nil { 132 | return nil, err 133 | } 134 | return alipayResponse, nil 135 | } 136 | 137 | func checkRspSign(httpMethod string, path string, clientId string, responseTime string, rspBody string, rspSignValue string, alipayPublicKey string) (bool, error) { 138 | 139 | signature, err := tools.CheckSignature(path, httpMethod, clientId, responseTime, rspBody, rspSignValue, alipayPublicKey) 140 | if err != nil { 141 | return false, &exception.AlipayLibraryError{Message: "Failed to check signature " + err.Error()} 142 | } 143 | if !signature { 144 | return false, &exception.AlipayLibraryError{Message: "check signature fail"} 145 | } else { 146 | return true, nil 147 | } 148 | } 149 | 150 | func buildBaseHeader(reqTime string, clientId string, keyVersion string, signatureValue string) map[string]string { 151 | if keyVersion == "" { 152 | keyVersion = "1" 153 | } 154 | signatureValue = "algorithm=RSA256,keyVersion=" + keyVersion + ",signature=" + signatureValue 155 | return map[string]string{ 156 | "Content-Type": "application/json; charset=UTF-8", 157 | "Request-Time": reqTime, 158 | "Client-Id": clientId, 159 | "Key-Version": keyVersion, 160 | "Signature": signatureValue, 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /com/alipay/api/exception/exception.go: -------------------------------------------------------------------------------- 1 | package exception 2 | 3 | import "fmt" 4 | 5 | type AlipayLibraryError struct { 6 | Message string 7 | } 8 | 9 | func (p *AlipayLibraryError) Error() string { 10 | return fmt.Sprintf("AlipaySDKErrore=%s", p.Message) 11 | } 12 | -------------------------------------------------------------------------------- /com/alipay/api/model/AccountBalance.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type AccountBalance struct { 4 | AccountNo string `json:"accountNo,omitempty"` 5 | Currency string `json:"currency,omitempty"` 6 | AvailableBalance *Amount `json:"availableBalance,omitempty"` 7 | FrozenBalance *Amount `json:"frozenBalance,omitempty"` 8 | TotalBalance *Amount `json:"totalBalance,omitempty"` 9 | } 10 | -------------------------------------------------------------------------------- /com/alipay/api/model/AcquirerInfo.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type AcquirerInfo struct { 4 | AcquirerName string `json:"acquirerName,omitempty"` 5 | ReferenceRequestId string `json:"referenceRequestId,omitempty"` 6 | AcquirerTransactionId string `json:"acquirerTransactionId,omitempty"` 7 | AcquirerMerchantId string `json:"acquirerMerchantId,omitempty"` 8 | AcquirerResultCode string `json:"acquirerResultCode,omitempty"` 9 | AcquirerResultMessage string `json:"acquirerResultMessage,omitempty"` 10 | } 11 | -------------------------------------------------------------------------------- /com/alipay/api/model/AgreementInfo.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type AgreementInfo struct { 4 | AuthState string `json:"authState,omitempty"` 5 | UserLoginId string `json:"userLoginId,omitempty"` 6 | UserLoginType string `json:"userLoginType,omitempty"` 7 | DisplayUserLoginId string `json:"displayUserLoginId,omitempty"` 8 | } 9 | 10 | type RiskData struct { 11 | Order *RiskOrder `json:"order,omitempty"` 12 | Buyer *RiskBuyer `json:"buyer,omitempty"` 13 | Env *RiskEnv `json:"env,omitempty"` 14 | RiskSignal *RiskSignal `json:"riskSignal,omitempty"` 15 | Address *RiskAddress `json:"address,omitempty"` 16 | CardVerificationResult *CardVerificationResult `json:"cardVerificationResult,omitempty"` 17 | } 18 | 19 | type RiskOrder struct { 20 | OrderType string `json:"orderType,omitempty"` 21 | ReferringSite string `json:"referringSite,omitempty"` 22 | } 23 | 24 | type RiskBuyer struct { 25 | NoteToMerchant string `json:"noteToMerchant,omitempty"` 26 | NoteToShipping string `json:"noteToShipping,omitempty"` 27 | OrderCountIn1H string `json:"orderCountIn1H,omitempty"` 28 | OrderCountIn24H string `json:"orderCountIn24H,omitempty"` 29 | } 30 | 31 | type RiskEnv struct { 32 | IpAddressType string `json:"ipAddressType,omitempty"` 33 | } 34 | 35 | type RiskSignal struct { 36 | RiskCode string `json:"riskCode,omitempty"` 37 | RiskReason string `json:"riskReason,omitempty"` 38 | } 39 | 40 | type RiskAddress struct { 41 | ShippingPhoneType string `json:"shippingPhoneType,omitempty"` 42 | IsBillShipStateSame bool `json:"isBillShipStateSame,omitempty"` 43 | IsPreviousStateSame bool `json:"isPreviousStateSame,omitempty"` 44 | LocToShipDistance int `json:"locToShipDistance,omitempty"` 45 | MinPreviousShipToBillDistance int `json:"minPreviousShipToBillDistance,omitempty"` 46 | } 47 | 48 | type CardVerificationResult struct { 49 | AuthenticationType string `json:"authenticationType,omitempty"` 50 | AuthenticationMethod string `json:"authenticationMethod,omitempty"` 51 | CvvResult string `json:"cvvResult,omitempty"` 52 | AvsResult string `json:"avsResult,omitempty"` 53 | AuthorizationCode string `json:"authorizationCode,omitempty"` 54 | ThreeDSResult *RiskThreeDSResult `json:"threeDSResult,omitempty"` 55 | } 56 | 57 | type RiskThreeDSResult struct { 58 | ThreeDSVersion string `json:"threeDSVersion,omitempty"` 59 | ThreeDSInteractionMode string `json:"threeDSInteractionMode,omitempty"` 60 | Eci string `json:"eci,omitempty"` 61 | Cavv string `json:"cavv,omitempty"` 62 | } 63 | -------------------------------------------------------------------------------- /com/alipay/api/model/Amount.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type Amount struct { 4 | Value string `json:"value,omitempty"` 5 | Currency string `json:"currency,omitempty"` 6 | } 7 | 8 | func NewAmount(value string, currency string) *Amount { 9 | return &Amount{ 10 | Value: value, 11 | Currency: currency, 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /com/alipay/api/model/AntomPathConstants.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | const ( 4 | AUTH_CONSULT_PATH = "/ams/api/v1/authorizations/consult" 5 | AUTH_APPLY_TOKEN_PATH = "/ams/api/v1/authorizations/applyToken" 6 | AUTH_REVOKE_PATH = "/ams/api/v1/authorizations/revoke" 7 | AUTH_QUERY_PATH = "/ams/api/v1/authorizations/query" 8 | CREATE_VAULTING_SESSION_PATH = "/ams/api/v1/vaults/createVaultingSession" 9 | VAULT_PAYMENT_METHOD_PATH = "/ams/api/v1/vaults/vaultPaymentMethod" 10 | INQUIRE_VAULTING_PATH = "/ams/api/v1/vaults/inquireVaulting" 11 | CONSULT_PAYMENT_PATH = "/ams/api/v1/payments/consult" 12 | PAYMENT_PATH = "/ams/api/v1/payments/pay" 13 | CREATE_SESSION_PATH = "/ams/api/v1/payments/createPaymentSession" 14 | CAPTURE_PATH = "/ams/api/v1/payments/capture" 15 | INQUIRY_PAYMENT_PATH = "/ams/api/v1/payments/inquiryPayment" 16 | CANCEL_PATH = "/ams/api/v1/payments/cancel" 17 | SYNC_ARREAR_PATH = "/ams/api/v1/payments/syncArrear" 18 | CREATE_DEVICE_CERTIFICATE_PATH = "/ams/api/v1/payments/createDeviceCertificate" 19 | SUBSCRIPTION_CREATE_PATH = "/ams/api/v1/subscriptions/create" 20 | SUBSCRIPTION_CHANGE_PATH = "/ams/api/v1/subscriptions/change" 21 | SUBSCRIPTION_CANCEL_PATH = "/ams/api/v1/subscriptions/cancel" 22 | SUBSCRIPTION_UPDATE_PATH = "/ams/api/v1/subscriptions/update" 23 | ACCEPT_DISPUTE_PATH = "/ams/api/v1/payments/acceptDispute" 24 | SUPPLY_DEFENCE_DOC_PATH = "/ams/api/v1/payments/supplyDefenseDocument" 25 | DOWNLOAD_DISPUTE_EVIDENCE_PATH = "/ams/api/v1/payments/downloadDisputeEvidence" 26 | REFUND_PATH = "/ams/api/v1/payments/refund" 27 | INQUIRY_REFUND_PATH = "/ams/api/v1/payments/inquiryRefund" 28 | DECLARE_PATH = "/ams/api/v1/customs/declare" 29 | INQUIRY_DECLARE_PATH = "/ams/api/v1/customs/inquiryDeclarationRequests" 30 | MARKETPLACE_SUBMITATTACHMENT_PATH = "/ams/api/open/openapiv2_file/v1/business/attachment/submitAttachment" 31 | MARKETPLACE_REGISTER_PATH = "/ams/api/v1/merchants/register" 32 | MARKETPLACE_SETTLEMENTINFO_UPDATE_PATH = "/ams/api/v1/merchants/settlementInfo/update" 33 | MARKETPLACE_INQUIREBALANCE_PATH = "/ams/api/v1/accounts/inquireBalance" 34 | MARKETPLACE_SETTLE_PATH = "/ams/api/v1/payments/settle" 35 | MARKETPLACE_CREATEPAYOUT_PATH = "/ams/api/v1/funds/createPayout" 36 | MARKETPLACE_CREATETRANSFER_PATH = "/ams/api/v1/funds/createTransfer" 37 | RISK_DECIDE_PATH = "/ams/api/v1/risk/payments/decide" 38 | RISK_REPORT_PATH = "/ams/api/v1/risk/payments/reportRisk" 39 | RISK_SEND_PAYMENT_RESULT_PATH = "/ams/api/v1/risk/payments/sendPaymentResult" 40 | RISK_SEND_REFUND_RESULT_PATH = "/ams/api/v1/risk/payments/sendRefundResult" 41 | ) 42 | -------------------------------------------------------------------------------- /com/alipay/api/model/ApplePayConfiguration.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type ApplePayConfiguration struct { 4 | RequiredBillingContactFields []string `json:"requiredBillingContactFields,omitempty"` 5 | RequiredShippingContactFields []string `json:"requiredShippingContactFields,omitempty"` 6 | ButtonsBundled bool `json:"buttonsBundled,omitempty"` 7 | ApplePayToken string `json:"applePayToken,omitempty"` 8 | } 9 | -------------------------------------------------------------------------------- /com/alipay/api/model/AttachmentType.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type AttachmentType string 4 | 5 | const ( 6 | AttachmentType_SIGNATURE_AUTHORIZATION_LETTER AttachmentType = "SIGNATURE_AUTHORIZATION_LETTER" 7 | AttachmentType_ARTICLES_OF_ASSOCIATION AttachmentType = "ARTICLES_OF_ASSOCIATION" 8 | AttachmentType_LOGO AttachmentType = "LOGO" 9 | 10 | AttachmentType_AUTHORIZER_SIGNATURE_CONFIRMATION_LETTER AttachmentType = "AUTHORIZER_SIGNATURE_CONFIRMATION_LETTER" 11 | AttachmentType_ASSOCIATION_ARTICLE AttachmentType = "ASSOCIATION_ARTICLE" 12 | AttachmentType_FINANCIAL_REPORT AttachmentType = "FINANCIAL_REPORT" 13 | AttachmentType_OWNERSHIP_STRUCTURE_PIC AttachmentType = "OWNERSHIP_STRUCTURE_PIC" 14 | AttachmentType_ADDRESS_PROOF AttachmentType = "ADDRESS_PROOF" 15 | AttachmentType_UBO_PROVE AttachmentType = "UBO_PROVE" 16 | AttachmentType_ENTERPRISE_REGISTRATION AttachmentType = "ENTERPRISE_REGISTRATION" 17 | AttachmentType_LICENSE_INFO AttachmentType = "LICENSE_INFO" 18 | AttachmentType_ID_CARD AttachmentType = "ID_CARD" 19 | AttachmentType_PASSPORT AttachmentType = "PASSPORT" 20 | AttachmentType_DRIVING_LICENSE AttachmentType = "DRIVING_LICENSE" 21 | AttachmentType_CPF AttachmentType = "CPF" 22 | AttachmentType_CNPJ AttachmentType = "CNPJ" 23 | ) 24 | -------------------------------------------------------------------------------- /com/alipay/api/model/AuthCodeForm.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type AuthCodeForm struct { 4 | CodeDetails []CodeDetail `json:"codeDetails,omitempty"` 5 | } 6 | -------------------------------------------------------------------------------- /com/alipay/api/model/AuthMetaData.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type AuthMetaData struct { 4 | AccountHolderName string `json:"accountHolderName,omitempty"` 5 | AccountHolderCertNo string `json:"accountHolderCertNo,omitempty"` 6 | } 7 | -------------------------------------------------------------------------------- /com/alipay/api/model/AuthorizationError.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type AuthorizationError struct { 4 | ErrorCode string `json:"errorCode,omitempty"` 5 | ErrorMessage string `json:"errorMessage,omitempty"` 6 | } 7 | -------------------------------------------------------------------------------- /com/alipay/api/model/AvailablePaymentMethod.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type AvailablePaymentMethod struct { 4 | PaymentMethodTypeList []PaymentMethodTypeItem `json:"paymentMethodTypeList,omitempty"` 5 | PaymentMethodMetaData map[string]any `json:"paymentMethodMetaData,omitempty"` 6 | } 7 | 8 | type PaymentMethodTypeItem struct { 9 | PaymentMethodType string `json:"paymentMethodType,omitempty"` 10 | PaymentMethodOrder int `json:"paymentMethodOrder,omitempty"` 11 | ExpressCheckout bool `json:"expressCheckout,omitempty"` 12 | } 13 | -------------------------------------------------------------------------------- /com/alipay/api/model/CancellationType.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type CancellationType string 4 | 5 | const ( 6 | CancellationType_CANCEL CancellationType = "CANCEL" 7 | CancellationType_TERMINATE CancellationType = "TERMINATE" 8 | ) 9 | -------------------------------------------------------------------------------- /com/alipay/api/model/CardBrand.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type CardBrand string 4 | 5 | const ( 6 | CardBrand_VISA CardBrand = "VISA" 7 | 8 | CardBrand_MASTERCARD CardBrand = "MASTERCARD" 9 | 10 | CardBrand_MAESTRO CardBrand = "MAESTRO" 11 | 12 | CardBrand_AMEX CardBrand = "AMEX" 13 | 14 | CardBrand_JCB CardBrand = "JCB" 15 | 16 | CardBrand_DINERS CardBrand = "DINERS" 17 | 18 | CardBrand_DISCOVER CardBrand = "DISCOVER" 19 | 20 | CardBrand_CUP CardBrand = "CUP" 21 | 22 | CardBrand_MIR CardBrand = "MIR" 23 | 24 | CardBrand_ELO CardBrand = "ELO" 25 | 26 | CardBrand_HIPERCARD CardBrand = "HIPERCARD" 27 | 28 | CardBrand_TROY CardBrand = "TROY" 29 | ) 30 | -------------------------------------------------------------------------------- /com/alipay/api/model/CardInfo.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type CardInfo struct { 4 | CardNo string `json:"cardNo,omitempty"` 5 | CardBrand CardBrand `json:"cardBrand,omitempty"` 6 | CardToken string `json:"cardToken,omitempty"` 7 | IssuingCountry string `json:"issuingCountry,omitempty"` 8 | Funding string `json:"funding,omitempty"` 9 | PaymentMethodRegion string `json:"paymentMethodRegion,omitempty"` 10 | ThreeDSResult ThreeDSResult `json:"threeDSResult,omitempty"` 11 | } 12 | -------------------------------------------------------------------------------- /com/alipay/api/model/Certificate.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type Certificate struct { 4 | CertificateType CertificateType `json:"certificateType,omitempty"` 5 | CertificateNo string `json:"certificateNo,omitempty"` 6 | HolderName *UserName `json:"holderName,omitempty"` 7 | FileKeys []string `json:"fileKeys,omitempty"` 8 | CertificateAuthority string `json:"certificateAuthority,omitempty"` 9 | GrantType string `json:"grantType,omitempty"` 10 | } 11 | 12 | type CertificateType string 13 | 14 | const ( 15 | //ENTERPRISE_REGISTRATION, 16 | //LICENSE_INFO, 17 | //ID_CARD, 18 | //PASSPORT, 19 | //DRIVING_LICENSE, 20 | //CPF, 21 | //CNPJ, 22 | 23 | CertificateType_ENTERPRISE_REGISTRATION CertificateType = "ENTERPRISE_REGISTRATION" 24 | CertificateType_LICENSE_INFO CertificateType = "LICENSE_INFO" 25 | CertificateType_ID_CARD CertificateType = "ID_CARD" 26 | CertificateType_PASSPORT CertificateType = "PASSPORT" 27 | CertificateType_DRIVING_LICENSE CertificateType = "DRIVING_LICENSE" 28 | CertificateType_CPF CertificateType = "CPF" 29 | CertificateType_CNPJ CertificateType = "CNPJ" 30 | ) 31 | -------------------------------------------------------------------------------- /com/alipay/api/model/ChallengeActionForm.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type ChallengeActionForm struct { 4 | ChallengeType ChallengeType `json:"challengeType,omitempty"` 5 | ChallengeRenderValue string `json:"challengeRenderValue,omitempty"` 6 | TriggerSource ChallengeTriggerSourceType `json:"triggerSource,omitempty"` 7 | ExtendInfo string `json:"extendInfo,omitempty"` 8 | } 9 | 10 | type ChallengeType string 11 | 12 | const ( 13 | SMS_OTP ChallengeType = "SMS_OTP" 14 | PLAINTEXT_CARD_NO ChallengeType = "PLAINTEXT_CARD_NO" 15 | CARD_EXPIRE_DATE ChallengeType = "CARD_EXPIRE_DATE" 16 | ) 17 | 18 | type ChallengeTriggerSourceType string 19 | 20 | const ( 21 | AMS ChallengeTriggerSourceType = "AMS" 22 | CHANNEL ChallengeTriggerSourceType = "CHANNEL" 23 | ) 24 | -------------------------------------------------------------------------------- /com/alipay/api/model/ClassType.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type ClassType string 4 | 5 | const ( 6 | FIRSTLEVEL ClassType = "FIRSTLEVEL" 7 | SECONDLEVEL ClassType = "SECONDLEVEL" 8 | THIRDLEVEL ClassType = "THIRDLEVEL" 9 | ) 10 | -------------------------------------------------------------------------------- /com/alipay/api/model/CodeDetail.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type CodeDetail struct { 4 | CodeValueType CodeValueType `json:"codeValueType,omitempty"` 5 | CodeValue string `json:"codeValue,omitempty"` 6 | DisplayType DisplayType `json:"displayType,omitempty"` 7 | } 8 | 9 | type CodeValueType string 10 | 11 | const ( 12 | CodeValueType_BARCODE CodeValueType = "BARCODE" 13 | CodeValueType_QRCODE CodeValueType = "QRCODE" 14 | ) 15 | 16 | type DisplayType string 17 | 18 | const ( 19 | DisplayType_TEXT DisplayType = "TEXT" 20 | DisplayType_MIDDLEIMAGE DisplayType = "MIDDLEIMAGE" 21 | DisplayType_BIGIMAGE DisplayType = "BIGIMAGE" 22 | DisplayType_SMALLIMAGE DisplayType = "SMALLIMAGE" 23 | DisplayType_IMAGE DisplayType = "IMAGE" 24 | ) 25 | -------------------------------------------------------------------------------- /com/alipay/api/model/CreditPayPlan.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type CreditPayPlan struct { 4 | InstallmentNum int `json:"installmentNum,omitempty"` 5 | Interval string `json:"interval,omitempty"` 6 | CreditPayFeeType CreditPayFeeType `json:"creditPayFeeType,omitempty"` 7 | FeePercentage int `json:"feePercentage,omitempty"` 8 | } 9 | 10 | type CreditPayFeeType string 11 | 12 | const ( 13 | PERCENTAGE CreditPayFeeType = "PERCENTAGE" 14 | ) 15 | -------------------------------------------------------------------------------- /com/alipay/api/model/CustomerBelongsTo.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type CustomerBelongsTo string 4 | 5 | const ( 6 | CustomerBelongsTo_RABBIT_LINE_PAY CustomerBelongsTo = "RABBIT_LINE_PAY" 7 | CustomerBelongsTo_TRUEMONEY CustomerBelongsTo = "TRUEMONEY" 8 | CustomerBelongsTo_ALIPAY_HK CustomerBelongsTo = "ALIPAY_HK" 9 | CustomerBelongsTo_TNG CustomerBelongsTo = "TNG" 10 | CustomerBelongsTo_ALIPAY_CN CustomerBelongsTo = "ALIPAY_CN" 11 | CustomerBelongsTo_GCASH CustomerBelongsTo = "GCASH" 12 | CustomerBelongsTo_DANA CustomerBelongsTo = "DANA" 13 | CustomerBelongsTo_KAKAOPAY CustomerBelongsTo = "KAKAOPAY" 14 | CustomerBelongsTo_BKASH CustomerBelongsTo = "BKASH" 15 | CustomerBelongsTo_EASYPAISA CustomerBelongsTo = "EASYPAISA" 16 | CustomerBelongsTo_PAYPAY CustomerBelongsTo = "PAYPAY" 17 | CustomerBelongsTo_BOOST CustomerBelongsTo = "BOOST" 18 | CustomerBelongsTo_GRABPAY_MY CustomerBelongsTo = "GRABPAY_MY" 19 | CustomerBelongsTo_MAYA CustomerBelongsTo = "MAYA" 20 | CustomerBelongsTo_GRABPAY_PH CustomerBelongsTo = "GRABPAY_PH" 21 | CustomerBelongsTo_GRABPAY_SG CustomerBelongsTo = "GRABPAY_SG" 22 | CustomerBelongsTo_NAVERPAY CustomerBelongsTo = "NAVERPAY" 23 | CustomerBelongsTo_JKOPAY CustomerBelongsTo = "JKOPAY" 24 | CustomerBelongsTo_KPLUS CustomerBelongsTo = "KPLUS" 25 | CustomerBelongsTo_DIRECT_DEBIT_SIAMCOMMERCIALBANK CustomerBelongsTo = "DIRECT_DEBIT_SIAMCOMMERCIALBANK" 26 | CustomerBelongsTo_DIRECT_DEBIT_KRUNGTHAIBANK CustomerBelongsTo = "DIRECT_DEBIT_KRUNGTHAIBANK" 27 | CustomerBelongsTo_ZALOPAY CustomerBelongsTo = "ZALOPAY" 28 | CustomerBelongsTo_DIRECTDEBIT_YAPILY CustomerBelongsTo = "DIRECTDEBIT_YAPILY" 29 | ) 30 | -------------------------------------------------------------------------------- /com/alipay/api/model/CustomsInfo.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type CustomsInfo struct { 4 | CustomsCode string `json:"customsCode,omitempty"` 5 | Region string `json:"region,omitempty"` 6 | } 7 | 8 | type MerchantCustomsInfo struct { 9 | MerchantCustomsCode string `json:"merchantCustomsCode,omitempty"` 10 | MerchantCustomsName string `json:"merchantCustomsName,omitempty"` 11 | } 12 | -------------------------------------------------------------------------------- /com/alipay/api/model/DeclarationRecord.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type DeclarationRecord struct { 4 | DeclarationRequestId string `json:"declarationRequestId,omitempty"` 5 | CustomsPaymentId string `json:"customsPaymentId,omitempty"` 6 | CustomsOrderId string `json:"customsOrderId,omitempty"` 7 | Customs CustomsInfo `json:"customs,omitempty"` 8 | MerchantCustomsInfo MerchantCustomsInfo `json:"merchantCustomsInfo,omitempty"` 9 | DeclarationAmount Amount `json:"declarationAmount,omitempty"` 10 | SplitOrder bool `json:"splitOrder,omitempty"` 11 | DeclarationRequestStatus string `json:"declarationRequestStatus,omitempty"` 12 | LastModifiedTime string `json:"lastModifiedTime,omitempty"` 13 | CustomsDeclarationResultCode string `json:"customsDeclarationResultCode,omitempty"` 14 | CustomsDeclarationResultDesc string `json:"customsDeclarationResultDesc,omitempty"` 15 | CustomsDeclarationReturnTime string `json:"customsDeclarationReturnTime,omitempty"` 16 | } 17 | -------------------------------------------------------------------------------- /com/alipay/api/model/DeliveryMethodType.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type DeliveryMethodType string 4 | 5 | const ( 6 | DeliveryMethodType_PHYSICAL DeliveryMethodType = "PHYSICAL" 7 | DeliveryMethodType_DIGITAL DeliveryMethodType = "DIGITAL" 8 | ) 9 | -------------------------------------------------------------------------------- /com/alipay/api/model/DisableReasonType.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type DisableReasonType string 4 | 5 | const ( 6 | PAYMENT_ACCOUNT_NOT_AVAILABLE DisableReasonType = "PAYMENT_ACCOUNT_NOT_AVAILABLE" 7 | EXCEED_CHANNEL_LIMIT_RULE DisableReasonType = "EXCEED_CHANNEL_LIMIT_RULE" 8 | SERVICE_DEGRADE DisableReasonType = "SERVICE_DEGRADE" 9 | CHANNEL_NOT_SUPPORT_CURRENCY DisableReasonType = "CHANNEL_NOT_SUPPORT_CURRENCY" 10 | CHANNEL_DISABLE DisableReasonType = "CHANNEL_DISABLE" 11 | CHANNEL_NOT_IN_SERVICE_TIME DisableReasonType = "CHANNEL_NOT_IN_SERVICE_TIME" 12 | QUERY_IPP_INFO_FAILED DisableReasonType = "QUERY_IPP_INFO_FAILED" 13 | LIMIT_CENTER_ACCESS_FAIL DisableReasonType = "LIMIT_CENTER_ACCESS_FAIL" 14 | CURRENT_CHANNEL_NOT_EXIST DisableReasonType = "CURRENT_CHANNEL_NOT_EXIST" 15 | ) 16 | -------------------------------------------------------------------------------- /com/alipay/api/model/Discount.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type Discount struct { 4 | DiscountTag string `json:"discountTag,omitempty"` 5 | DiscountName string `json:"discountName,omitempty"` 6 | SavingsAmount Amount `json:"savingsAmount,omitempty"` 7 | EstimateSavingsAmount Amount `json:"estimateSavingsAmount,omitempty"` 8 | } 9 | -------------------------------------------------------------------------------- /com/alipay/api/model/DisputeEvidenceFormatType.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type DisputeEvidenceFormatType string 4 | 5 | const ( 6 | DisputeEvidenceFormatType_PDF DisputeEvidenceFormatType = "PDF" 7 | DisputeEvidenceFormatType_WORD DisputeEvidenceFormatType = "WORD" 8 | DisputeEvidenceFormatType_ZIP DisputeEvidenceFormatType = "ZIP" 9 | DisputeEvidenceFormatType_JPG DisputeEvidenceFormatType = "JPG" 10 | ) 11 | 12 | type DisputeEvidenceType string 13 | 14 | const ( 15 | DisputeEvidenceType_DISPUTE_EVIDENCE_TEMPLATE DisputeEvidenceType = "DISPUTE_EVIDENCE_TEMPLATE" 16 | DisputeEvidenceType_DISPUTE_EVIDENCE_FILE DisputeEvidenceType = "DISPUTE_EVIDENCE_FILE" 17 | ) 18 | -------------------------------------------------------------------------------- /com/alipay/api/model/DisputeNotificationType.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type DisputeNotificationType string 4 | 5 | const ( 6 | DisputeNotificationType_DISPUTE_CREATED DisputeNotificationType = "DISPUTE_CREATED" 7 | DisputeNotificationType_DISPUTE_JUDGED DisputeNotificationType = "DISPUTE_JUDGED" 8 | DisputeNotificationType_DISPUTE_CANCELLED DisputeNotificationType = "DISPUTE_CANCELLED" 9 | DisputeNotificationType_DEFENSE_SUPPLIED DisputeNotificationType = "DEFENSE_SUPPLIED" 10 | DisputeNotificationType_DEFENSE_DUE_ALERT DisputeNotificationType = "DEFENSE_DUE_ALERT" 11 | DisputeNotificationType_DISPUTE_ACCEPTED DisputeNotificationType = "DISPUTE_ACCEPTED" 12 | RDR_RESOLVED DisputeNotificationType = "RDR_RESOLVED" 13 | ) 14 | 15 | type DisputeJudgedResult string 16 | 17 | const ( 18 | DisputeJudgedResult_ACCEPT_BY_CUSTOMER DisputeJudgedResult = "ACCEPT_BY_CUSTOMER" 19 | DisputeJudgedResult_ACCEPT_BY_MERCHANT DisputeJudgedResult = "ACCEPT_BY_MERCHANT" 20 | DisputeJudgedResult_VALIDATE_SUCCESS DisputeJudgedResult = "VALIDATE_SUCCESS" 21 | DisputeJudgedResult_VALIDATE_FAIL DisputeJudgedResult = "VALIDATE_FAIL" 22 | ) 23 | 24 | type DisputeAcceptReasonType string 25 | 26 | const ( 27 | MERCHANT_ACCEPTED DisputeAcceptReasonType = "MERCHANT_ACCEPTED" 28 | TIMEOUT DisputeAcceptReasonType = "TIMEOUT" 29 | MANUAL_PROCESSING_ACCEPTED DisputeAcceptReasonType = "MANUAL_PROCESSING_ACCEPTED" 30 | ) 31 | 32 | type DisputeType string 33 | 34 | const ( 35 | DisputeType_CHARGEBACK DisputeType = "CHARGEBACK" 36 | DisputeType_RETRIEVAL_REQUEST DisputeType = "RETRIEVAL_REQUEST" 37 | DisputeType_COMPLIANCE_REQUEST DisputeType = "COMPLIANCE_REQUEST" 38 | ) 39 | -------------------------------------------------------------------------------- /com/alipay/api/model/GrantType.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type GrantType string 4 | 5 | const ( 6 | GrantTypeAUTHORIZATION_CODE GrantType = "AUTHORIZATION_CODE" 7 | GrantTypeREFRESH_TOKEN GrantType = "REFRESH_TOKEN" 8 | ) 9 | -------------------------------------------------------------------------------- /com/alipay/api/model/HttpMethod.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | const ( 4 | // MethodGet HTTP method 5 | MethodGet = "GET" 6 | 7 | // MethodPost HTTP method 8 | MethodPost = "POST" 9 | 10 | // MethodPut HTTP method 11 | MethodPut = "PUT" 12 | 13 | // MethodDelete HTTP method 14 | MethodDelete = "DELETE" 15 | 16 | // MethodPatch HTTP method 17 | MethodPatch = "PATCH" 18 | 19 | // MethodHead HTTP method 20 | MethodHead = "HEAD" 21 | 22 | // MethodOptions HTTP method 23 | MethodOptions = "OPTIONS" 24 | ) 25 | -------------------------------------------------------------------------------- /com/alipay/api/model/IdentityCheckResult.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type IdentityCheckResult string 4 | 5 | const ( 6 | // CHECK_PASSED, CHECK_NOT_PASSED; 7 | IdentityCheckResult_CHECK_PASSED IdentityCheckResult = "CHECK_PASSED" 8 | IdentityCheckResult_CHECK_NOT_PASSED IdentityCheckResult = "CHECK_NOT_PASSED" 9 | ) 10 | 11 | type ClearingChannel string 12 | 13 | const ( 14 | //CUP, NUCC, OTHER; 15 | ClearingChannel_CUP ClearingChannel = "CUP" 16 | ClearingChannel_NUCC ClearingChannel = "NUCC" 17 | ClearingChannel_OTHER ClearingChannel = "OTHER" 18 | ) 19 | -------------------------------------------------------------------------------- /com/alipay/api/model/Logo.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type Logo struct { 4 | LogoName string `json:"logoName,omitempty"` 5 | LogoUrl string `json:"logoUrl,omitempty"` 6 | } 7 | -------------------------------------------------------------------------------- /com/alipay/api/model/MerchantInfo.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type MerchantInfo struct { 4 | ReferenceMerchantId string `json:"referenceMerchantId,omitempty"` 5 | LoginId string `json:"loginId,omitempty"` 6 | LegalEntityType LegalEntityType `json:"legalEntityType,omitempty"` 7 | Company *Company `json:"company,omitempty"` 8 | BusinessInfo *BusinessInfo `json:"businessInfo,omitempty"` 9 | EntityAssociations []*EntityAssociations `json:"entityAssociations,omitempty"` 10 | } 11 | 12 | type LegalEntityType string 13 | 14 | const ( 15 | LegalEntityType_Company LegalEntityType = "COMPANY" 16 | LegalEntityType_INDIVIDUAL LegalEntityType = "INDIVIDUAL" 17 | ) 18 | 19 | type Company struct { 20 | LegalName string `json:"legalName,omitempty"` 21 | CompanyType CompanyType `json:"companyType,omitempty"` 22 | RegisteredAddress *Address `json:"registeredAddress,omitempty"` 23 | OperatingAddress *Address `json:"operatingAddress,omitempty"` 24 | IncorporationDate string `json:"incorporationDate,omitempty"` 25 | StockInfo *StockInfo `json:"stockInfo,omitempty"` 26 | Certificates *Certificate `json:"certificates,omitempty"` 27 | Attachments []*Attachment `json:"attachments,omitempty"` 28 | CompanyUnit *CompanyUnitType `json:"companyUnit,omitempty"` 29 | Contacts []*Contact `json:"contacts,omitempty"` 30 | VatNo string `json:"vatNo,omitempty"` 31 | } 32 | 33 | type BusinessInfo struct { 34 | Mcc string `json:"mcc,omitempty"` 35 | Websites []*WebSite `json:"websites,omitempty"` 36 | EnglishName string `json:"englishName,omitempty"` 37 | DoingBusinessAs string `json:"doingBusinessAs,omitempty"` 38 | MainSalesCountry string `json:"mainSalesCountry,omitempty"` 39 | AppName string `json:"appName,omitempty"` 40 | ServiceDescription string `json:"serviceDescription,omitempty"` 41 | } 42 | 43 | type EntityAssociations struct { 44 | AssociationType AssociationType `json:"associationType,omitempty"` 45 | LegalEntityType LegalEntityType `json:"legalEntityType,omitempty"` 46 | Company *Company `json:"company,omitempty"` 47 | Individual *Individual `json:"individual,omitempty"` 48 | ShareholdingRatio string `json:"shareholdingRatio,omitempty"` 49 | } 50 | 51 | type Individual struct { 52 | Name *UserName `json:"name,omitempty"` 53 | EnglishName *UserName `json:"englishName,omitempty"` 54 | DateOfBirth string `json:"dateOfBirth,omitempty"` 55 | PlaceOfBirth *Address `json:"placeOfBirth,omitempty"` 56 | Certificates *Certificate `json:"certificates,omitempty"` 57 | Nationality string `json:"nationality,omitempty"` 58 | Contacts []*Contact `json:"contacts,omitempty"` 59 | } 60 | 61 | type AssociationType string 62 | 63 | const ( 64 | AssociationType_LEGAL_REPRESENTATIVE AssociationType = "LEGAL_REPRESENTATIVE" 65 | AssociationType_UBO AssociationType = "UBO" 66 | AssociationType_CONTACT AssociationType = "CONTACT" 67 | AssociationType_DIRECTOR AssociationType = "DIRECTOR" 68 | AssociationType_AUTHORIZER AssociationType = "AUTHORIZER" 69 | AssociationType_BOARD_MEMBER AssociationType = "BOARD_MEMBER" 70 | ) 71 | 72 | type WebSite struct { 73 | Name string `json:"name,omitempty"` 74 | Url string `json:"url,omitempty"` 75 | Desc string `json:"desc,omitempty"` 76 | Type string `json:"type,omitempty"` 77 | } 78 | 79 | type StockInfo struct { 80 | ListedRegion string `json:"listedRegion,omitempty"` 81 | TickerSymbol string `json:"tickerSymbol,omitempty"` 82 | } 83 | 84 | type Attachment struct { 85 | AttachmentType AttachmentType `json:"attachmentType,omitempty"` 86 | File string `json:"file,omitempty"` 87 | AttachmentName string `json:"attachmentName,omitempty"` 88 | FileKey string `json:"fileKey,omitempty"` 89 | } 90 | 91 | type CompanyUnitType string 92 | 93 | const ( 94 | CompanyUnitType_HEADQUARTER CompanyUnitType = "HEADQUARTER" 95 | CompanyUnitType_BRANCH CompanyUnitType = "BRANCH" 96 | ) 97 | 98 | type CompanyType string 99 | 100 | const ( 101 | CompanyType_ENTERPRISE CompanyType = "ENTERPRISE" 102 | CompanyType_SOLE_PROPRIETORSHIP CompanyType = "SOLE_PROPRIETORSHIP" 103 | CompanyType_PARTNERSHIP CompanyType = "PARTNERSHIP" 104 | CompanyType_STATE_OWNED_BUSINESS CompanyType = "STATE_OWNED_BUSINESS" 105 | CompanyType_PRIVATELY_OWNED_BUSINESS CompanyType = "PRIVATELY_OWNED_BUSINESS" 106 | CompanyType_PUBLICLY_LISTED_BUSINESS CompanyType = "PUBLICLY_LISTED_BUSINESS" 107 | CompanyType_LTDA CompanyType = "LTDA" 108 | CompanyType_SA CompanyType = "SA" 109 | CompanyType_EIRELI CompanyType = "EIRELI" 110 | CompanyType_BOFC CompanyType = "BOFC" 111 | CompanyType_MEI CompanyType = "MEI" 112 | CompanyType_EI CompanyType = "EI" 113 | ) 114 | 115 | type Contact struct { 116 | Type ContactType `json:"type,omitempty"` 117 | Info string `json:"info,omitempty"` 118 | } 119 | 120 | type ContactType string 121 | 122 | const ( 123 | ContactType_EMAIL ContactType = "EMAIL" 124 | ContactType_PHONE_NO ContactType = "PHONE_NO" 125 | ContactType_COMMERCIAL_PHONE_NO ContactType = "COMMERCIAL_PHONE_NO" 126 | ) 127 | -------------------------------------------------------------------------------- /com/alipay/api/model/MerchantType.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type MerchantType string 4 | 5 | const ( 6 | INDIVIDUAL MerchantType = "INDIVIDUAL" 7 | ENTERPRISE MerchantType = "ENTERPRISE" 8 | ) 9 | -------------------------------------------------------------------------------- /com/alipay/api/model/Order.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type Store struct { 4 | ReferenceStoreId string `json:"referenceStoreId,omitempty"` 5 | StoreName string `json:"storeName,omitempty"` 6 | StoreMCC string `json:"storeMCC,omitempty"` 7 | StoreDisplayName string `json:"storeDisplayName,omitempty"` 8 | StoreTerminalId string `json:"storeTerminalId,omitempty"` 9 | StoreOperatorId string `json:"storeOperatorId,omitempty"` 10 | StoreAddress *Address `json:"storeAddress,omitempty"` 11 | StorePhoneNo string `json:"storePhoneNo,omitempty"` 12 | } 13 | 14 | type Merchant struct { 15 | ReferenceMerchantId string `json:"referenceMerchantId,omitempty"` 16 | MerchantMCC string `json:"merchantMCC,omitempty"` 17 | MerchantName string `json:"merchantName,omitempty"` 18 | MerchantDisplayName string `json:"merchantDisplayName,omitempty"` 19 | MerchantAddress *Address `json:"merchantAddress,omitempty"` 20 | MerchantRegisterDate string `json:"merchantRegisterDate,omitempty"` 21 | Store *Store `json:"store,omitempty"` 22 | MerchantType MerchantType `json:"merchantType,omitempty"` 23 | } 24 | 25 | type Goods struct { 26 | ReferenceGoodsId string `json:"referenceGoodsId,omitempty"` 27 | GoodsName string `json:"goodsName,omitempty"` 28 | GoodsCategory string `json:"goodsCategory,omitempty"` 29 | GoodsBrand string `json:"goodsBrand,omitempty"` 30 | GoodsUnitAmount *Amount `json:"goodsUnitAmount,omitempty"` 31 | GoodsQuantity string `json:"goodsQuantity,omitempty"` 32 | GoodsSkuName string `json:"goodsSkuName,omitempty"` 33 | GoodsUrl string `json:"goodsUrl,omitempty"` 34 | DeliveryMethodType DeliveryMethodType `json:"deliveryMethodType,omitempty"` 35 | GoodsImageUrl string `json:"goodsImageUrl,omitempty"` 36 | PriceId string `json:"priceId,omitempty"` 37 | } 38 | type DeliveryEstimateInfo struct { 39 | Unit string `json:"unit,omitempty"` 40 | Value string `json:"value,omitempty"` 41 | } 42 | 43 | type DeliveryEstimate struct { 44 | Minimum *DeliveryEstimateInfo `json:"minimum,omitempty"` 45 | Maximum *DeliveryEstimateInfo `json:"maximum,omitempty"` 46 | } 47 | 48 | type Shipping struct { 49 | ShippingName *UserName `json:"shippingName,omitempty"` 50 | ShippingAddress *Address `json:"shippingAddress,omitempty"` 51 | ShippingCarrier string `json:"shippingCarrier,omitempty"` 52 | ShippingPhoneNo string `json:"shippingPhoneNo,omitempty"` 53 | ShipToEmail string `json:"shipToEmail,omitempty"` 54 | ShippingFeeId string `json:"shippingFeeId,omitempty"` 55 | ShippingFee *Amount `json:"shippingFee,omitempty"` 56 | ShippingDescription string `json:"shippingDescription,omitempty"` 57 | DeliveryEstimate *DeliveryEstimate `json:"deliveryEstimate,omitempty"` 58 | } 59 | 60 | type Buyer struct { 61 | ReferenceBuyerId string `json:"referenceBuyerId,omitempty"` 62 | BuyerName *UserName `json:"buyerName,omitempty"` 63 | BuyerPhoneNo string `json:"buyerPhoneNo,omitempty"` 64 | BuyerEmail string `json:"buyerEmail,omitempty"` 65 | BuyerRegistrationTime string `json:"buyerRegistrationTime,omitempty"` 66 | IsAccountVerified *bool `json:"isAccountVerified,omitempty"` 67 | SuccessfulOrderCount *int `json:"successfulOrderCount,omitempty"` 68 | } 69 | 70 | type BrowserInfo struct { 71 | AcceptHeader string `json:"acceptHeader,omitempty"` 72 | JavaEnabled *bool `json:"javaEnabled,omitempty"` 73 | JavaScriptEnabled *bool `json:"javaScriptEnabled,omitempty"` 74 | Language string `json:"language,omitempty"` 75 | UserAgent string `json:"userAgent,omitempty"` 76 | } 77 | 78 | type Env struct { 79 | TerminalType TerminalType `json:"terminalType,omitempty"` 80 | OsType OsType `json:"osType,omitempty"` 81 | UserAgent string `json:"userAgent,omitempty"` 82 | DeviceTokenId string `json:"deviceTokenId,omitempty"` 83 | ClientIp string `json:"clientIp,omitempty"` 84 | CookieId string `json:"cookieId,omitempty"` 85 | ExtendInfo string `json:"extendInfo,omitempty"` 86 | StoreTerminalId string `json:"storeTerminalId,omitempty"` 87 | StoreTerminalRequestTime string `json:"storeTerminalRequestTime,omitempty"` 88 | BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` 89 | ColorDepth string `json:"colorDepth,omitempty"` 90 | ScreenHeight string `json:"screenHeight,omitempty"` 91 | ScreenWidth string `json:"screenWidth,omitempty"` 92 | TimeZoneOffset int `json:"timeZoneOffset,omitempty"` 93 | DeviceBrand string `json:"deviceBrand,omitempty"` 94 | DeviceModel string `json:"deviceModel,omitempty"` 95 | DeviceLanguage string `json:"deviceLanguage,omitempty"` 96 | DeviceId string `json:"deviceId,omitempty"` 97 | } 98 | 99 | type Leg struct { 100 | DepartureTime string `json:"departureTime,omitempty"` 101 | ArrivalTime string `json:"arrivalTime,omitempty"` 102 | DepartureAddress Address `json:"departureAddress,omitempty"` 103 | ArrivalAddress Address `json:"arrivalAddress,omitempty"` 104 | CarrierName string `json:"carrierName,omitempty"` 105 | CarrierNo string `json:"carrierNo,omitempty"` 106 | ClassType ClassType `json:"classType,omitempty"` 107 | DepartureAirportCode string `json:"departureAirportCode,omitempty"` 108 | ArrivalAirportCode string `json:"arrivalAirportCode,omitempty"` 109 | } 110 | 111 | type Passenger struct { 112 | PassengerName UserName `json:"passengerName,omitempty"` 113 | PassengerEmail string `json:"passengerEmail,omitempty"` 114 | PassengerPhoneNo string `json:"passengerPhoneNo,omitempty"` 115 | } 116 | type Transit struct { 117 | TransitType TransitType `json:"transitType,omitempty"` 118 | Legs []Leg `json:"legs,omitempty"` 119 | Passengers []Passenger `json:"passengers,omitempty"` 120 | } 121 | type Address struct { 122 | Region string `json:"region,omitempty"` 123 | State string `json:"state,omitempty"` 124 | City string `json:"city,omitempty"` 125 | Address1 string `json:"address1,omitempty"` 126 | Address2 string `json:"address2,omitempty"` 127 | ZipCode string `json:"zipCode,omitempty"` 128 | Label string `json:"label,omitempty"` 129 | } 130 | 131 | type UserName struct { 132 | FirstName string `json:"firstName,omitempty"` 133 | MiddleName string `json:"middleName,omitempty"` 134 | LastName string `json:"lastName,omitempty"` 135 | FullName string `json:"fullName,omitempty"` 136 | } 137 | 138 | type Lodging struct { 139 | HotelName string `json:"hotelName,omitempty"` 140 | HotelAddress *Address `json:"hotelAddress,omitempty"` 141 | CheckInDate string `json:"checkInDate,omitempty"` 142 | CheckOutDate string `json:"checkOutDate,omitempty"` 143 | NumberOfNights int `json:"numberOfNights,omitempty"` 144 | NumberOfRooms int `json:"numberOfRooms,omitempty"` 145 | GuestNames []*UserName `json:"guestNames,omitempty"` 146 | } 147 | 148 | type Gaming struct { 149 | GameName string `json:"gameName,omitempty"` 150 | ToppedUpUser string `json:"toppedUpUser,omitempty"` 151 | ToppedUpEmail string `json:"toppedUpEmail,omitempty"` 152 | ToppedUpPhoneNo string `json:"toppedUpPhoneNo,omitempty"` 153 | } 154 | 155 | type Order struct { 156 | ReferenceOrderId string `json:"referenceOrderId,omitempty"` 157 | OrderDescription string `json:"orderDescription,omitempty"` 158 | OrderAmount *Amount `json:"orderAmount,omitempty"` 159 | Merchant *Merchant `json:"merchant,omitempty"` 160 | Goods []Goods `json:"goods,omitempty"` 161 | Shipping *Shipping `json:"shipping,omitempty"` 162 | Buyer *Buyer `json:"buyer,omitempty"` 163 | Env *Env `json:"env,omitempty"` 164 | ExtendInfo string `json:"extendInfo,omitempty"` 165 | Transit *Transit `json:"transit,omitempty"` 166 | Lodging *Lodging `json:"lodging,omitempty"` 167 | Gaming *Gaming `json:"gaming,omitempty"` 168 | OrderCreatedTime string `json:"orderCreatedTime,omitempty"` 169 | NeedDeclaration bool `json:"needDeclaration,omitempty"` 170 | } 171 | -------------------------------------------------------------------------------- /com/alipay/api/model/OrderCodeForm.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type OrderCodeForm struct { 4 | PaymentMethodType string `json:"paymentMethodType,omitempty"` 5 | ExpireTime string `json:"expireTime,omitempty"` 6 | CodeDetails []CodeDetail `json:"codeDetails,omitempty"` 7 | ExtendInfo string `json:"extendInfo,omitempty"` 8 | } 9 | -------------------------------------------------------------------------------- /com/alipay/api/model/OrderInfo.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type OrderInfo struct { 4 | OrderAmount *Amount `json:"orderAmount,omitempty"` 5 | } 6 | -------------------------------------------------------------------------------- /com/alipay/api/model/OsType.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type OsType string 4 | 5 | const ( 6 | IOS OsType = "IOS" 7 | ANDROID OsType = "ANDROID" 8 | ) 9 | -------------------------------------------------------------------------------- /com/alipay/api/model/PaymentDetail.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type PaymentDetail struct { 4 | Amount *Amount `json:"amount,omitempty"` 5 | PaymentMethod *PaymentMethod `json:"paymentMethod,omitempty"` 6 | } 7 | 8 | type AuthorizationPhase string 9 | 10 | const ( 11 | AuthorizationPhase_PRE_AUTHORIZATION AuthorizationPhase = "PRE_AUTHORIZATION" 12 | AuthorizationPhase_POST_AUTHORIZATION AuthorizationPhase = "POST_AUTHORIZATION" 13 | ) 14 | -------------------------------------------------------------------------------- /com/alipay/api/model/PaymentFactor.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type InStorePaymentScenario string 4 | 5 | const ( 6 | PaymentCode InStorePaymentScenario = "PaymentCode" 7 | OrderCode InStorePaymentScenario = "OrderCode" 8 | EntryCode InStorePaymentScenario = "EntryCode" 9 | ) 10 | 11 | type PresentmentMode string 12 | 13 | const ( 14 | BUNDLE PresentmentMode = "BUNDLE" 15 | TILE PresentmentMode = "TILE" 16 | UNIFIED PresentmentMode = "UNIFIED" 17 | ) 18 | 19 | type PaymentFactor struct { 20 | IsPaymentEvaluation bool `json:"isPaymentEvaluation,omitempty,omitempty"` 21 | InStorePaymentScenario InStorePaymentScenario `json:"inStorePaymentScenario,omitempty,omitempty"` 22 | PresentmentMode PresentmentMode `json:"presentmentMode,omitempty,omitempty"` 23 | CaptureMode string `json:"captureMode,omitempty,omitempty"` 24 | IsAuthorization bool `json:"isAuthorization,omitempty,omitempty"` 25 | } 26 | -------------------------------------------------------------------------------- /com/alipay/api/model/PaymentMethod.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type PaymentMethod struct { 4 | PaymentMethodType string `json:"paymentMethodType,omitempty"` 5 | PaymentMethodId string `json:"paymentMethodId,omitempty"` 6 | PaymentMethodMetaData map[string]any `json:"paymentMethodMetaData,omitempty"` 7 | CustomerId string `json:"customerId,omitempty"` 8 | ExtendInfo string `json:"extendInfo,omitempty"` 9 | RequireIssuerAuthentication bool `json:"requireIssuerAuthentication,omitempty"` 10 | } 11 | -------------------------------------------------------------------------------- /com/alipay/api/model/PaymentMethodDetail.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type PaymentMethodDetail struct { 4 | PaymentMethodDetailType PaymentMethodDetailType `json:"paymentMethodDetailType,omitempty"` 5 | Card *CardPaymentMethodDetail `json:"card,omitempty"` 6 | ExternalAccount *ExternalPaymentMethodDetail `json:"externalAccount,omitempty"` 7 | Discount *DiscountPaymentMethodDetail `json:"discount,omitempty"` 8 | Coupon *CouponPaymentMethodDetail `json:"coupon,omitempty"` 9 | PaymentMethodType string `json:"paymentMethodType,omitempty"` 10 | ExtendInfo string `json:"extendInfo,omitempty"` 11 | } 12 | 13 | type PaymentMethodDetailType string 14 | 15 | const ( 16 | PaymentMethodDetailType_CARD PaymentMethodDetailType = "CARD" 17 | PaymentMethodDetailType_EXTERNALACCOUNT PaymentMethodDetailType = "EXTERNALACCOUNT" 18 | PaymentMethodDetailType_COUPON PaymentMethodDetailType = "COUPON" 19 | PaymentMethodDetailType_DISCOUNT PaymentMethodDetailType = "DISCOUNT" 20 | ) 21 | 22 | type CardPaymentMethodDetail struct { 23 | CardToken string `json:"cardToken,omitempty"` 24 | CardNo string `json:"cardNo,omitempty"` 25 | Brand CardBrand `json:"brand,omitempty"` 26 | SelectedCardBrand CardBrand `json:"selectedCardBrand,omitempty"` 27 | CardIssuer string `json:"cardIssuer,omitempty"` 28 | CountryIssue string `json:"countryIssue,omitempty"` 29 | CardHolderName *UserName `json:"cardHolderName,omitempty"` 30 | ExpiryYear string `json:"expiryYear,omitempty"` 31 | ExpiryMonth string `json:"expiryMonth,omitempty"` 32 | BillingAddress *Address `json:"billingAddress,omitempty"` 33 | Mask string `json:"mask,omitempty"` 34 | Last4 string `json:"last4,omitempty"` 35 | PaymentMethodDetailMetadata string `json:"paymentMethodDetailMetadata,omitempty"` 36 | MaskedCardNo string `json:"maskedCardNo,omitempty"` 37 | Fingerprint string `json:"fingerprint,omitempty"` 38 | AuthenticationFlow string `json:"authenticationFlow,omitempty"` 39 | Funding string `json:"funding,omitempty"` 40 | AvsResultRaw string `json:"avsResultRaw,omitempty"` 41 | Bin string `json:"bin,omitempty"` 42 | IssuerName string `json:"issuerName,omitempty"` 43 | IssuingCountry string `json:"issuingCountry,omitempty"` 44 | LastFour string `json:"lastFour,omitempty"` 45 | CardholderName *UserName `json:"cardholderName,omitempty"` 46 | Cvv string `json:"cvv,omitempty"` 47 | DateOfBirth string `json:"dateOfBirth,omitempty"` 48 | BusinessNo string `json:"businessNo,omitempty"` 49 | CardPasswordDigest string `json:"cardPasswordDigest,omitempty"` 50 | Cpf string `json:"cpf,omitempty"` 51 | PayerEmail string `json:"payerEmail,omitempty"` 52 | NetworkTransactionId string `json:"networkTransactionId,omitempty"` 53 | Is3DSAuthentication bool `json:"is3DSAuthentication,omitempty"` 54 | } 55 | 56 | type ExternalPaymentMethodDetail struct { 57 | AssetToken string `json:"assetToken,omitempty"` 58 | AccountDisplayName string `json:"accountDisplayName,omitempty"` 59 | DisableReason string `json:"disableReason,omitempty"` 60 | PaymentMethodDetailMetadata string `json:"paymentMethodDetailMetadata,omitempty"` 61 | } 62 | 63 | type DiscountPaymentMethodDetail struct { 64 | DiscountId string `json:"discountId,omitempty"` 65 | AvailableAmount *Amount `json:"availableAmount,omitempty"` 66 | DiscountName string `json:"discountName,omitempty"` 67 | DiscountDescription string `json:"discountDescription,omitempty"` 68 | PaymentMethodDetailMetadata string `json:"paymentMethodDetailMetadata,omitempty"` 69 | } 70 | 71 | type CouponPaymentMethodDetail struct { 72 | CouponId string `json:"couponId,omitempty"` 73 | AvailableAmount *Amount `json:"availableAmount,omitempty"` 74 | CouponName string `json:"couponName,omitempty"` 75 | CouponDescription string `json:"couponDescription,omitempty"` 76 | CouponExpireTime string `json:"couponExpireTime,omitempty"` 77 | PaymentMethodDetailMetadata string `json:"paymentMethodDetailMetadata,omitempty"` 78 | } 79 | -------------------------------------------------------------------------------- /com/alipay/api/model/PaymentMethodInfo.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type PaymentMethodInfo struct { 4 | PaymentMethodType string `json:"paymentMethodType,omitempty"` 5 | PaymentMethodDetail string `json:"paymentMethodDetail,omitempty"` 6 | Enabled bool `json:"enabled,omitempty"` 7 | Preferred bool `json:"preferred,omitempty"` 8 | ExtendInfo string `json:"extendInfo,omitempty"` 9 | } 10 | -------------------------------------------------------------------------------- /com/alipay/api/model/PaymentMethodType.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type PaymentMethodType string 4 | 5 | const ( 6 | PaymentMethodType_DISCOUNT PaymentMethodType = "DISCOUNT" 7 | PaymentMethodType_INTEREST_FREE PaymentMethodType = "INTEREST_FREE" 8 | PaymentMethodType_BALANCE_ACCOUNT PaymentMethodType = "BALANCE_ACCOUNT" 9 | PaymentMethodType_SETTLEMENT_CARD PaymentMethodType = "SETTLEMENT_CARD" 10 | PaymentMethodType_APPLEPAY PaymentMethodType = "APPLEPAY" 11 | PaymentMethodType_UPI PaymentMethodType = "UPI" 12 | PaymentMethodType_ONLINEBANKING_NETBANKING PaymentMethodType = "ONLINEBANKING_NETBANKING" 13 | ) 14 | -------------------------------------------------------------------------------- /com/alipay/api/model/PaymentOption.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type PaymentOption struct { 4 | PaymentMethodType string `json:"paymentMethodType,omitempty"` 5 | PaymentMethodCategory PaymentMethodCategoryType `json:"paymentMethodCategory,omitempty"` 6 | PaymentMethodRegion []string `json:"paymentMethodRegion,omitempty"` 7 | Enabled bool `json:"enabled,omitempty"` 8 | Preferred bool `json:"preferred,omitempty"` 9 | DisableReason DisableReasonType `json:"disableReason,omitempty"` 10 | AmountLimitInfoMap map[string]AmountLimitInfo `json:"amountLimitInfoMap,omitempty"` 11 | SupportedCurrencies []string `json:"supportedCurrencies,omitempty"` 12 | PaymentOptionDetail PaymentOptionDetail `json:"paymentOptionDetail,omitempty"` 13 | ExtendInfo string `json:"extendInfo,omitempty"` 14 | Logo Logo `json:"logo,omitempty"` 15 | PromoNames []string `json:"promoNames,omitempty"` 16 | Installment Installment `json:"installment,omitempty"` 17 | PromotionInfos []PromotionInfo `json:"promotionInfos,omitempty"` 18 | } 19 | 20 | type PaymentMethodCategoryType string 21 | 22 | const ( 23 | //ALIPAY_PLUS, WALLET, MOBILE_BANKING_APP, BANK_TRANSFER, ONLINE_BANKING, CARD, OTC; 24 | PaymentMethodCategoryTypeAlipayPlus PaymentMethodCategoryType = "ALIPAY_PLUS" 25 | PaymentMethodCategoryTypeWallet PaymentMethodCategoryType = "WALLET" 26 | PaymentMethodCategoryTypeMOBILEBANKINGAPP PaymentMethodCategoryType = "MOBILE_BANKING_APP" 27 | PaymentMethodCategoryTypeBankTransfer PaymentMethodCategoryType = "BANK_TRANSFER" 28 | PaymentMethodCategoryTypeOnlineBanking PaymentMethodCategoryType = "ONLINE_BANKING" 29 | PaymentMethodCategoryTypeCard PaymentMethodCategoryType = "CARD" 30 | PaymentMethodCategoryTypeOTC PaymentMethodCategoryType = "OTC" 31 | ) 32 | 33 | type AmountLimitInfo struct { 34 | SingleLimit AmountLimit `json:"singleLimit,omitempty"` 35 | DayLimit AmountLimit `json:"dayLimit,omitempty"` 36 | MonthLimit AmountLimit `json:"monthLimit,omitempty"` 37 | } 38 | type AmountLimit struct { 39 | MinAmount Amount `json:"minAmount,omitempty"` 40 | MaxAmount Amount `json:"maxAmount,omitempty"` 41 | RemainAmount Amount `json:"remainAmount,omitempty"` 42 | } 43 | 44 | type PaymentOptionDetail struct { 45 | SupportCardBrands []SupportCardBrand `json:"supportCardBrands,omitempty"` 46 | Funding []string `json:"funding,omitempty"` 47 | SupportBanks []SupportBank `json:"supportBanks,omitempty"` 48 | } 49 | 50 | type SupportBank struct { 51 | BankIdentifierCode string `json:"bankIdentifierCode,omitempty"` 52 | BankShortName string `json:"bankShortName,omitempty"` 53 | BankLogo Logo `json:"bankLogo,omitempty"` 54 | } 55 | 56 | type Installment struct { 57 | SupportCardBrands []SupportCardBrand `json:"supportCardBrands,omitempty"` 58 | Plans []Plan `json:"plans,omitempty"` 59 | } 60 | 61 | type Plan struct { 62 | InterestRate string `json:"interestRate,omitempty"` 63 | MinInstallmentAmount Amount `json:"minInstallmentAmount,omitempty"` 64 | MaxInstallmentAmount Amount `json:"maxInstallmentAmount,omitempty"` 65 | InstallmentNum string `json:"installmentNum,omitempty"` 66 | Interval string `json:"interval,omitempty"` 67 | Enabled bool `json:"enabled,omitempty"` 68 | } 69 | type PromotionInfo struct { 70 | PromotionType PromotionType `json:"promotionType,omitempty"` 71 | Discount Discount `json:"discount,omitempty"` 72 | InterestFree InterestFree `json:"interestFree,omitempty"` 73 | } 74 | 75 | type InterestFree struct { 76 | Provider string `json:"provider,omitempty"` 77 | ExpireTime string `json:"expireTime,omitempty"` 78 | InstallmentFreeNums []int `json:"installmentFreeNums,omitempty"` 79 | MinPaymentAmount Amount `json:"minPaymentAmount,omitempty"` 80 | MaxPaymentAmount Amount `json:"maxPaymentAmount,omitempty"` 81 | FreePercentage int `json:"freePercentage,omitempty"` 82 | } 83 | -------------------------------------------------------------------------------- /com/alipay/api/model/PaymentResultInfo.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type PaymentResultInfo struct { 4 | CardNo string `json:"cardNo,omitempty"` 5 | CardBrand string `json:"cardBrand,omitempty"` 6 | CardToken string `json:"cardToken,omitempty"` 7 | IssuingCountry string `json:"issuingCountry,omitempty"` 8 | Funding string `json:"funding,omitempty"` 9 | PaymentMethodRegion string `json:"paymentMethodRegion,omitempty"` 10 | ThreeDSResult ThreeDSResult `json:"threeDSResult,omitempty"` 11 | AvsResultRaw string `json:"avsResultRaw,omitempty"` 12 | CvvResultRaw string `json:"cvvResultRaw,omitempty"` 13 | NetworkTransactionId string `json:"networkTransactionId,omitempty"` 14 | CreditPayPlan CreditPayPlan `json:"creditPayPlan,omitempty"` 15 | CardholderName string `json:"cardholderName,omitempty"` 16 | CardBin string `json:"cardBin,omitempty"` 17 | LastFour string `json:"lastFour,omitempty"` 18 | ExpiryMonth string `json:"expiryMonth,omitempty"` 19 | ExpiryYear string `json:"expiryYear,omitempty"` 20 | } 21 | 22 | type ThreeDSResult struct { 23 | ThreeDSVersion string `json:"threeDSVersion,omitempty"` 24 | Eci string `json:"eci,omitempty"` 25 | Cavv string `json:"cavv,omitempty"` 26 | DsTransactionId string `json:"dsTransactionId,omitempty"` 27 | Xid string `json:"xid,omitempty"` 28 | } 29 | -------------------------------------------------------------------------------- /com/alipay/api/model/PaymentVerificationData.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type PaymentVerificationData struct { 4 | VerifyRequestId string `json:"verifyRequestId,omitempty"` 5 | AuthenticationCode string `json:"authenticationCode,omitempty"` 6 | } 7 | -------------------------------------------------------------------------------- /com/alipay/api/model/PeriodRule.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type PeriodRule struct { 4 | PeriodType PeriodType `json:"periodType,omitempty"` 5 | PeriodCount int `json:"periodCount,omitempty"` 6 | } 7 | -------------------------------------------------------------------------------- /com/alipay/api/model/PeriodType.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type PeriodType string 4 | 5 | const ( 6 | PeriodType_DAY PeriodType = "DAY" 7 | PeriodType_WEEK PeriodType = "WEEK" 8 | PeriodType_MONTH PeriodType = "MONTH" 9 | PeriodType_YEAR PeriodType = "YEAR" 10 | ) 11 | -------------------------------------------------------------------------------- /com/alipay/api/model/ProductCodeType.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type ProductCodeType string 4 | 5 | const ( 6 | AGREEMENT_PAYMENT ProductCodeType = "AGREEMENT_PAYMENT" 7 | IN_STORE_PAYMENT ProductCodeType = "IN_STORE_PAYMENT" 8 | CASHIER_PAYMENT ProductCodeType = "CASHIER_PAYMENT" 9 | ) 10 | -------------------------------------------------------------------------------- /com/alipay/api/model/PromotionResult.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type PromotionResult struct { 4 | PromotionType PromotionType `json:"promotionType,omitempty"` 5 | Discount Discount `json:"discount,omitempty"` 6 | } 7 | -------------------------------------------------------------------------------- /com/alipay/api/model/PromotionType.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type PromotionType string 4 | 5 | const ( 6 | promotionType_DISCOUNT PromotionType = "DISCOUNT" 7 | promotionType_INTEREST_FREE PromotionType = "INTEREST_FREE" 8 | ) 9 | -------------------------------------------------------------------------------- /com/alipay/api/model/PspCustomerInfo.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type PspCustomerInfo struct { 4 | PspName string `json:"pspName,omitempty"` 5 | PspCustomerId string `json:"pspCustomerId,omitempty"` 6 | DisplayCustomerId string `json:"displayCustomerId,omitempty"` 7 | DisplayCustomerName string `json:"displayCustomerName,omitempty"` 8 | Customer2088Id string `json:"customer2088Id,omitempty"` 9 | ExtendInfo string `json:"extendInfo,omitempty"` 10 | } 11 | -------------------------------------------------------------------------------- /com/alipay/api/model/Quote.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type Quote struct { 4 | QuoteId string `json:"quoteId,omitempty"` 5 | QuoteCurrencyPair string `json:"quoteCurrencyPair,omitempty"` 6 | QuotePrice float64 `json:"quotePrice,omitempty"` 7 | QuoteStartTime string `json:"quoteStartTime,omitempty"` 8 | QuoteExpiryTime string `json:"quoteExpiryTime,omitempty"` 9 | Guaranteed bool `json:"guaranteed,omitempty"` 10 | } 11 | -------------------------------------------------------------------------------- /com/alipay/api/model/RedirectActionForm.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type RedirectActionForm struct { 4 | Method string `json:"method,omitempty"` 5 | Parameters string `json:"parameters,omitempty"` 6 | RedirectURL string `json:"redirectUrl,omitempty"` 7 | ActionFormType string `json:"actionFormType,omitempty"` 8 | } 9 | -------------------------------------------------------------------------------- /com/alipay/api/model/RefundDetail.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type RefundDetail struct { 4 | RefundAmount Amount `json:"refundAmount,omitempty"` 5 | RefundFrom RefundFromType `json:"refundFrom,omitempty"` 6 | } 7 | 8 | type RefundFromType string 9 | 10 | const ( 11 | //SELLER, 12 | //MARKETPLACE, 13 | //UNSETTLED_FUNDS; 14 | RefundFromTypeSELLER RefundFromType = "SELLER" 15 | RefundFromTypeMARKETPLACE RefundFromType = "MARKETPLACE" 16 | RefundFromTypeUNSETTLEDFUNDS RefundFromType = "UNSETTLED_FUNDS" 17 | ) 18 | -------------------------------------------------------------------------------- /com/alipay/api/model/RefundRecord.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type RefundRecord struct { 4 | ReferenceOrderId string `json:"referenceOrderId,omitempty"` 5 | ReferenceGoodsId string `json:"referenceGoodsId,omitempty"` 6 | Amount *Amount `json:"amount,omitempty"` 7 | RefundReason string `json:"refundReason,omitempty"` 8 | RefundTime string `json:"refundTime,omitempty"` 9 | } 10 | -------------------------------------------------------------------------------- /com/alipay/api/model/ScopeType.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type ScopeType string 4 | 5 | const ( 6 | //BASE_USER_INFO, AGREEMENT_PAY, USER_INFO, USER_LOGIN_ID, HASH_LOGIN_ID, SEND_OTP; 7 | ScopeTypeBaseUserInfo ScopeType = "BASE_USER_INFO" 8 | ScopeTypeAgreementPay ScopeType = "AGREEMENT_PAY" 9 | ScopeTypeUserInfo ScopeType = "USER_INFO" 10 | ScopeTypeUserLoginId ScopeType = "USER_LOGIN_ID" 11 | ScopeTypeHashLoginId ScopeType = "HASH_LOGIN_ID" 12 | ScopeTypeSendOtp ScopeType = "SEND_OTP" 13 | ScopeTypeTAOBAOREBIND ScopeType = "TAOBAO_REBIND" 14 | ) 15 | -------------------------------------------------------------------------------- /com/alipay/api/model/SettlementDetail.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type SettlementDetail struct { 4 | SettleTo SettleToType `json:"settleTo,omitempty"` 5 | SettlementAmount *Amount `json:"settlementAmount,omitempty"` 6 | } 7 | 8 | type SettleToType string 9 | 10 | const ( 11 | SettleToType_SELLER SettleToType = "SELLER" 12 | SettleToType_MARKETPLACE SettleToType = "MARKETPLACE" 13 | ) 14 | -------------------------------------------------------------------------------- /com/alipay/api/model/SettlementInfo.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type SettlementInfo struct { 4 | SettlementCurrency string `json:"settlementCurrency"` 5 | SettlementBankAccount *SettlementBankAccount `json:"settlementBankAccount"` 6 | } 7 | 8 | type SettlementBankAccount struct { 9 | BankAccountNo string `json:"bankAccountNo"` 10 | AccountHolderName string `json:"accountHolderName"` 11 | SwiftCode string `json:"swiftCode"` 12 | BankRegion string `json:"bankRegion"` 13 | AccountHolderType AccountHolderType `json:"accountHolderType"` 14 | RoutingNumber string `json:"routingNumber"` 15 | BranchCode string `json:"branchCode"` 16 | AccountHolderTIN string `json:"accountHolderTIN"` 17 | AccountType AccountType `json:"accountType"` 18 | BankName string `json:"bankName"` 19 | AccountHolderAddress *Address `json:"accountHolderAddress"` 20 | Iban string `json:"iban"` 21 | } 22 | 23 | type AccountHolderType string 24 | 25 | const ( 26 | AccountHolderType_INDIVIDUAL AccountHolderType = "INDIVIDUAL" 27 | AccountHolderType_ENTERPRISE AccountHolderType = "ENTERPRISE" 28 | ) 29 | 30 | type AccountType string 31 | 32 | const ( 33 | AccountType_CHECKING AccountType = "CHECKING" 34 | AccountType_FIXED_DEPOSIT AccountType = "FIXED_DEPOSIT" 35 | ) 36 | -------------------------------------------------------------------------------- /com/alipay/api/model/SettlementStrategy.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type SettlementStrategy struct { 4 | SettlementCurrency string `json:"settlementCurrency,omitempty"` 5 | } 6 | -------------------------------------------------------------------------------- /com/alipay/api/model/SubscriptionStatus.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type SubscriptionStatus string 4 | 5 | const ( 6 | SubscriptionStatus_ACTIVE SubscriptionStatus = "ACTIVE" 7 | SubscriptionStatus_TERMINATED SubscriptionStatus = "TERMINATED" 8 | ) 9 | 10 | type SubscriptionNotificationType string 11 | 12 | const ( 13 | SubscriptionNotificationType_CREATE SubscriptionNotificationType = "CREATE" 14 | SubscriptionNotificationType_CHANGE SubscriptionNotificationType = "CHANGE" 15 | SubscriptionNotificationType_CANCEL SubscriptionNotificationType = "CANCEL" 16 | SubscriptionNotificationType_TERMINATE SubscriptionNotificationType = "TERMINATE" 17 | ) 18 | -------------------------------------------------------------------------------- /com/alipay/api/model/SupportCardBrand.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type SupportCardBrand struct { 4 | CardBrand string `json:"cardBrand,omitempty"` 5 | Logo Logo `json:"logo,omitempty"` 6 | } 7 | -------------------------------------------------------------------------------- /com/alipay/api/model/TerminalType.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type TerminalType string 4 | 5 | const ( 6 | WEB TerminalType = "WEB" 7 | WAP TerminalType = "WAP" 8 | APP TerminalType = "APP" 9 | MINI_APP TerminalType = "MINI_APP" 10 | ) 11 | -------------------------------------------------------------------------------- /com/alipay/api/model/Transaction.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 4 | 5 | type TransactionType string 6 | 7 | const ( 8 | TransactionType_PAYMENT TransactionType = "PAYMENT" 9 | TransactionType_REFUND TransactionType = "REFUND" 10 | TransactionType_CANCEL TransactionType = "CANCEL" 11 | TransactionType_CAPTURE TransactionType = "CAPTURE" 12 | TransactionType_VOID TransactionType = "VOID" 13 | TransactionType_AUTHORIZATION TransactionType = "AUTHORIZATION" 14 | ) 15 | 16 | type Transaction struct { 17 | TransactionResult response.Result `json:"transactionResult,omitempty"` 18 | TransactionId string `json:"transactionId,omitempty"` 19 | TransactionType TransactionType `json:"transactionType,omitempty"` 20 | TransactionStatus TransactionStatusType `json:"transactionStatus,omitempty"` 21 | TransactionAmount Amount `json:"transactionAmount,omitempty"` 22 | TransactionRequestId string `json:"transactionRequestId,omitempty"` 23 | TransactionTime string `json:"transactionTime,omitempty"` 24 | 25 | AcquirerInfo AcquirerInfo `json:"acquirerInfo,omitempty"` 26 | } 27 | -------------------------------------------------------------------------------- /com/alipay/api/model/TransactionStatusType.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type TransactionStatusType string 4 | 5 | const ( 6 | TransactionStatusType_SUCCESS TransactionStatusType = "SUCCESS" 7 | TransactionStatusType_FAIL TransactionStatusType = "FAIL" 8 | TransactionStatusType_PROCESSING TransactionStatusType = "PROCESSING" 9 | TransactionStatusType_PENDING TransactionStatusType = "PENDING" 10 | TransactionStatusType_CANCELLED TransactionStatusType = "CANCELLED" 11 | ) 12 | -------------------------------------------------------------------------------- /com/alipay/api/model/TransferFromDetail.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type TransferFromDetail struct { 4 | TransferFromMethod *PaymentMethod `json:"transferFromMethod,omitempty"` 5 | TransferFromAmount *Amount `json:"transferFromAmount,omitempty"` 6 | } 7 | -------------------------------------------------------------------------------- /com/alipay/api/model/TransferToDetail.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type TransferToDetail struct { 4 | TransferToMethod *PaymentMethod `json:"transferToMethod,omitempty"` 5 | TransferToCurrency string `json:"transferToCurrency,omitempty"` 6 | FeeAmount *Amount `json:"feeAmount,omitempty"` 7 | ActualTransferToAmount *Amount `json:"actualTransferToAmount,omitempty"` 8 | PurposeCode string `json:"purposeCode,omitempty"` 9 | TransferNotifyUrl string `json:"transferNotifyUrl,omitempty"` 10 | TransferRemark string `json:"transferRemark,omitempty"` 11 | } 12 | -------------------------------------------------------------------------------- /com/alipay/api/model/TransitType.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type TransitType string 4 | 5 | const ( 6 | FLIGHT TransitType = "FLIGHT" 7 | TRAIN TransitType = "TRAIN" 8 | CRUISE TransitType = "CRUISE" 9 | COACH TransitType = "COACH" 10 | ) 11 | -------------------------------------------------------------------------------- /com/alipay/api/model/Trial.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type Trial struct { 4 | TrialStartPeriod int `json:"trialStartPeriod,omitempty"` 5 | TrialAmount *Amount `json:"trialAmount,omitempty"` 6 | TrialEndPeriod int `json:"trialEndPeriod,omitempty"` 7 | } 8 | -------------------------------------------------------------------------------- /com/alipay/api/model/WalletPaymentMethodType.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | const ( 4 | BPI = "BPI" 5 | RABBIT_LINE_PAY = "RABBIT_LINE_PAY" 6 | TRUEMONEY = "TRUEMONEY" 7 | ALIPAY_HK = "ALIPAY_HK" 8 | TNG = "TNG" 9 | ALIPAY_CN = "ALIPAY_CN" 10 | GCASH = "GCASH" 11 | DANA = "DANA" 12 | KAKAOPAY = "KAKAOPAY" 13 | BKASH = "BKASH" 14 | EASYPAISA = "EASYPAISA" 15 | JKOPAY = "JKOPAY" 16 | PAGALEVE = "PAGALEVE" 17 | AKULAKU_PAYLATER = "AKULAKU_PAYLATER" 18 | KREDIVO_ID = "KREDIVO_ID" 19 | LINKAJA = "LINKAJA" 20 | OVO = "OVO" 21 | GOPAY_ID = "GOPAY_ID" 22 | SHOPEEPAY_ID = "SHOPEEPAY_ID" 23 | DOKU = "DOKU" 24 | PAYPAY = "PAYPAY" 25 | LINEPAY = "LINEPAY" 26 | GRABPAY_MY = "GRABPAY_MY" 27 | BILLEASE = "BILLEASE" 28 | SHOPEEPAY_PH = "SHOPEEPAY_PH" 29 | GRABPAY_PH = "GRABPAY_PH" 30 | GRABPAY_SG = "GRABPAY_SG" 31 | SHOPEEPAY_SG = "SHOPEEPAY_SG" 32 | NAVERPAY = "NAVERPAY" 33 | TOSSPAY = "TOSSPAY" 34 | KPLUS = "KPLUS" 35 | ZALOPAY = "ZALOPAY" 36 | CONNECT_WALLET = "CONNECT_WALLET" 37 | SETTLEMENT_CARD = "SETTLEMENT_CARD" 38 | BALANCE_ACCOUNT = "BALANCE_ACCOUNT" 39 | APPLEPAY = "APPLEPAY" 40 | ) 41 | -------------------------------------------------------------------------------- /com/alipay/api/request/AlipayRequest.go: -------------------------------------------------------------------------------- 1 | package request 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 4 | 5 | type AlipayRequest struct { 6 | Param any `json:"param,omitempty"` 7 | ClientId string `json:"clientId,omitempty"` 8 | Path string `json:"path,omitempty"` 9 | KeyVersion string `json:"keyVersion,omitempty"` 10 | HttpMethod string `json:"httpMethod,omitempty"` 11 | AlipayResponse any `json:"response,omitempty"` 12 | } 13 | 14 | func NewAlipayRequest(param any, path string, alipayResponse any) *AlipayRequest { 15 | return &AlipayRequest{ 16 | Param: param, 17 | ClientId: "", 18 | Path: path, 19 | KeyVersion: "1", 20 | HttpMethod: model.MethodPost, 21 | AlipayResponse: alipayResponse, 22 | } 23 | } 24 | 25 | func NEWAlipayRequest(param any, clientId string, path string, keyVersion string, httpMethod string, alipayResponse any) *AlipayRequest { 26 | return &AlipayRequest{ 27 | Param: param, 28 | ClientId: clientId, 29 | Path: path, 30 | KeyVersion: keyVersion, 31 | HttpMethod: httpMethod, 32 | AlipayResponse: alipayResponse, 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /com/alipay/api/request/AlipayRequestInterface.go: -------------------------------------------------------------------------------- 1 | package request 2 | 3 | type RequestInterface interface { 4 | NewRequest() AlipayRequest 5 | } 6 | -------------------------------------------------------------------------------- /com/alipay/api/request/auth/AlipayAuthApplyTokenRequest.go: -------------------------------------------------------------------------------- 1 | package auth 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseAuth "github.com/alipay/global-open-sdk-go/com/alipay/api/response/auth" 7 | ) 8 | 9 | type AlipayAuthApplyTokenRequest struct { 10 | GrantType model.GrantType `json:"grantType,omitempty"` 11 | CustomerBelongsTo model.CustomerBelongsTo `json:"customerBelongsTo,omitempty"` 12 | AuthCode string `json:"authCode,omitempty"` 13 | RefreshToken string `json:"refreshToken,omitempty"` 14 | ExtendInfo string `json:"extendInfo,omitempty"` 15 | MerchantRegion string `json:"merchantRegion,omitempty"` 16 | } 17 | 18 | func (alipayAuthApplyTokenRequest *AlipayAuthApplyTokenRequest) NewRequest() *request.AlipayRequest { 19 | return request.NewAlipayRequest(&alipayAuthApplyTokenRequest, model.AUTH_APPLY_TOKEN_PATH, &responseAuth.AlipayAuthApplyTokenResponse{}) 20 | } 21 | 22 | func NewAlipayAuthApplyTokenRequest() (*request.AlipayRequest, *AlipayAuthApplyTokenRequest) { 23 | alipayAuthApplyTokenRequest := &AlipayAuthApplyTokenRequest{} 24 | alipayRequest := request.NewAlipayRequest(alipayAuthApplyTokenRequest, model.AUTH_APPLY_TOKEN_PATH, &responseAuth.AlipayAuthApplyTokenResponse{}) 25 | return alipayRequest, alipayAuthApplyTokenRequest 26 | } 27 | -------------------------------------------------------------------------------- /com/alipay/api/request/auth/AlipayAuthConsultRequest.go: -------------------------------------------------------------------------------- 1 | package auth 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseAuth "github.com/alipay/global-open-sdk-go/com/alipay/api/response/auth" 7 | ) 8 | 9 | type AlipayAuthConsultRequest struct { 10 | CustomerBelongsTo model.CustomerBelongsTo `json:"customerBelongsTo,omitempty"` 11 | AuthClientId string `json:"authClientId,omitempty"` 12 | AuthRedirectUrl string `json:"authRedirectUrl,omitempty"` 13 | Scopes []model.ScopeType `json:"scopes,omitempty"` 14 | AuthState string `json:"authState,omitempty"` 15 | TerminalType model.TerminalType `json:"terminalType,omitempty"` 16 | OsType model.OsType `json:"osType,omitempty"` 17 | OsVersion string `json:"osVersion,omitempty"` 18 | ExtendInfo string `json:"extendInfo,omitempty"` 19 | MerchantRegion string `json:"merchantRegion,omitempty"` 20 | RecurringPayment bool `json:"recurringPayment,omitempty"` 21 | GrantType string `json:"grantType,omitempty"` 22 | AuthMetaData *model.AuthMetaData `json:"authMetaData,omitempty"` 23 | } 24 | 25 | func (alipayAuthConsultRequest *AlipayAuthConsultRequest) NewRequest() *request.AlipayRequest { 26 | return request.NewAlipayRequest(&alipayAuthConsultRequest, model.AUTH_CONSULT_PATH, &responseAuth.AlipayAuthConsultResponse{}) 27 | } 28 | 29 | func NewAlipayAuthConsultRequest() (*request.AlipayRequest, *AlipayAuthConsultRequest) { 30 | alipayAuthConsultRequest := &AlipayAuthConsultRequest{} 31 | alipayRequest := request.NewAlipayRequest(alipayAuthConsultRequest, model.AUTH_CONSULT_PATH, &responseAuth.AlipayAuthConsultResponse{}) 32 | return alipayRequest, alipayAuthConsultRequest 33 | } 34 | -------------------------------------------------------------------------------- /com/alipay/api/request/auth/AlipayAuthCreateSessionRequest.go: -------------------------------------------------------------------------------- 1 | package auth 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseAuth "github.com/alipay/global-open-sdk-go/com/alipay/api/response/auth" 7 | ) 8 | 9 | type AlipayAuthCreateSessionRequest struct { 10 | ProductCode model.ProductCodeType `json:"productCode,omitempty"` 11 | AgreementInfo *model.AgreementInfo `json:"agreementInfo,omitempty"` 12 | Scopes []model.ScopeType `json:"scopes,omitempty"` 13 | PaymentMethod *model.PaymentMethod `json:"paymentMethod,omitempty"` 14 | PaymentRedirectUrl string `json:"paymentRedirectUrl,omitempty"` 15 | } 16 | 17 | func (alipayAuthCreateSessionRequest *AlipayAuthCreateSessionRequest) NewRequest() *request.AlipayRequest { 18 | return request.NewAlipayRequest(&alipayAuthCreateSessionRequest, model.CREATE_SESSION_PATH, &responseAuth.AlipayAuthCreateSessionResponse{}) 19 | } 20 | 21 | func NewAlipayAuthCreateSessionRequest() (*request.AlipayRequest, *AlipayAuthCreateSessionRequest) { 22 | alipayAuthCreateSessionRequest := &AlipayAuthCreateSessionRequest{} 23 | alipayRequest := request.NewAlipayRequest(alipayAuthCreateSessionRequest, model.CREATE_SESSION_PATH, &responseAuth.AlipayAuthCreateSessionResponse{}) 24 | return alipayRequest, alipayAuthCreateSessionRequest 25 | } 26 | -------------------------------------------------------------------------------- /com/alipay/api/request/auth/AlipayAuthQueryTokenRequest.go: -------------------------------------------------------------------------------- 1 | package auth 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseAuth "github.com/alipay/global-open-sdk-go/com/alipay/api/response/auth" 7 | ) 8 | 9 | type AlipayAuthQueryTokenRequest struct { 10 | AccessToken string `json:"accessToken"` 11 | } 12 | 13 | func NewAlipayAuthQueryTokenRequest() (*request.AlipayRequest, *AlipayAuthQueryTokenRequest) { 14 | alipayAuthQueryTokenRequest := &AlipayAuthQueryTokenRequest{} 15 | alipayRequest := request.NewAlipayRequest(alipayAuthQueryTokenRequest, model.AUTH_QUERY_PATH, &responseAuth.AlipayAuthQueryTokenResponse{}) 16 | return alipayRequest, alipayAuthQueryTokenRequest 17 | } 18 | -------------------------------------------------------------------------------- /com/alipay/api/request/auth/AlipayAuthRevokeTokenRequest.go: -------------------------------------------------------------------------------- 1 | package auth 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseAuth "github.com/alipay/global-open-sdk-go/com/alipay/api/response/auth" 7 | ) 8 | 9 | type AlipayAuthRevokeTokenRequest struct { 10 | AccessToken string `json:"accessToken,omitempty"` 11 | ExtendInfo string `json:"extendInfo,omitempty"` 12 | } 13 | 14 | func (alipayAuthRevokeTokenRequest *AlipayAuthRevokeTokenRequest) NewRequest() *request.AlipayRequest { 15 | return request.NewAlipayRequest(&alipayAuthRevokeTokenRequest, model.AUTH_REVOKE_PATH, &responseAuth.AlipayAuthRevokeTokenResponse{}) 16 | } 17 | 18 | func NewAlipayAuthRevokeTokenRequest() (*request.AlipayRequest, *AlipayAuthRevokeTokenRequest) { 19 | alipayAuthRevokeTokenRequest := &AlipayAuthRevokeTokenRequest{} 20 | alipayRequest := request.NewAlipayRequest(alipayAuthRevokeTokenRequest, model.AUTH_REVOKE_PATH, &responseAuth.AlipayAuthRevokeTokenResponse{}) 21 | return alipayRequest, alipayAuthRevokeTokenRequest 22 | } 23 | -------------------------------------------------------------------------------- /com/alipay/api/request/customs/AlipayCustomsDeclareRequest.go: -------------------------------------------------------------------------------- 1 | package customs 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseCustoms "github.com/alipay/global-open-sdk-go/com/alipay/api/response/customs" 7 | ) 8 | 9 | type AlipayCustomsDeclareRequest struct { 10 | DeclarationRequestId string `json:"declarationRequestId,omitempty"` 11 | PaymentId string `json:"paymentId,omitempty"` 12 | DeclarationAmount *model.Amount `json:"declarationAmount,omitempty"` 13 | Customs *model.CustomsInfo `json:"customs,omitempty"` 14 | MerchantCustomsInfo *model.MerchantCustomsInfo `json:"merchantCustomsInfo,omitempty"` 15 | SplitOrder bool `json:"splitOrder,omitempty"` 16 | SubOrderId string `json:"subOrderId,omitempty"` 17 | BuyerCertificate *model.Certificate `json:"buyerCertificate,omitempty"` 18 | } 19 | 20 | func (alipayCustomsDeclareRequest *AlipayCustomsDeclareRequest) NewRequest() *request.AlipayRequest { 21 | return request.NewAlipayRequest(&alipayCustomsDeclareRequest, model.DECLARE_PATH, &responseCustoms.AlipayCustomsDeclareResponse{}) 22 | } 23 | 24 | func NewAlipayCustomsDeclareRequest() (*request.AlipayRequest, *AlipayCustomsDeclareRequest) { 25 | alipayCustomsDeclareRequest := &AlipayCustomsDeclareRequest{} 26 | alipayRequest := request.NewAlipayRequest(alipayCustomsDeclareRequest, model.DECLARE_PATH, &responseCustoms.AlipayCustomsDeclareResponse{}) 27 | return alipayRequest, alipayCustomsDeclareRequest 28 | } 29 | -------------------------------------------------------------------------------- /com/alipay/api/request/customs/AlipayCustomsQueryRequest.go: -------------------------------------------------------------------------------- 1 | package customs 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseCustoms "github.com/alipay/global-open-sdk-go/com/alipay/api/response/customs" 7 | ) 8 | 9 | type AlipayCustomsQueryRequest struct { 10 | DeclarationRequestIds []string `json:"declarationRequestIds,omitempty"` 11 | } 12 | 13 | func (alipayCustomsQueryRequest *AlipayCustomsQueryRequest) NewRequest() *request.AlipayRequest { 14 | return request.NewAlipayRequest(&alipayCustomsQueryRequest, model.INQUIRY_DECLARE_PATH, &responseCustoms.AlipayCustomsQueryResponse{}) 15 | } 16 | 17 | func NewAlipayCustomsQueryRequest() (*request.AlipayRequest, *AlipayCustomsQueryRequest) { 18 | alipayCustomsQueryRequest := &AlipayCustomsQueryRequest{} 19 | alipayRequest := request.NewAlipayRequest(alipayCustomsQueryRequest, model.INQUIRY_DECLARE_PATH, &responseCustoms.AlipayCustomsQueryResponse{}) 20 | return alipayRequest, alipayCustomsQueryRequest 21 | } 22 | -------------------------------------------------------------------------------- /com/alipay/api/request/dispute/AlipayAcceptDisputeRequest.go: -------------------------------------------------------------------------------- 1 | package dispute 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseDispute "github.com/alipay/global-open-sdk-go/com/alipay/api/response/dispute" 7 | ) 8 | 9 | type AlipayAcceptDisputeRequest struct { 10 | DisputeId string `json:"disputeId,omitempty"` 11 | } 12 | 13 | func NewAlipayAcceptDisputeRequest() (*request.AlipayRequest, *AlipayAcceptDisputeRequest) { 14 | alipayAcceptDisputeRequest := &AlipayAcceptDisputeRequest{} 15 | alipayRequest := request.NewAlipayRequest(alipayAcceptDisputeRequest, model.ACCEPT_DISPUTE_PATH, &responseDispute.AlipayAcceptDisputeResponse{}) 16 | return alipayRequest, alipayAcceptDisputeRequest 17 | } 18 | -------------------------------------------------------------------------------- /com/alipay/api/request/dispute/AlipayDownloadDisputeEvidenceRequest.go: -------------------------------------------------------------------------------- 1 | package dispute 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseDispute "github.com/alipay/global-open-sdk-go/com/alipay/api/response/dispute" 7 | ) 8 | 9 | type AlipayDownloadDisputeEvidenceRequest struct { 10 | DisputeId string `json:"disputeId,omitempty"` 11 | DisputeEvidenceType model.DisputeEvidenceType `json:"disputeEvidenceType,omitempty"` 12 | } 13 | 14 | func NewAlipayDownloadDisputeEvidenceRequest() (*request.AlipayRequest, *AlipayDownloadDisputeEvidenceRequest) { 15 | alipayDownloadDisputeEvidenceRequest := &AlipayDownloadDisputeEvidenceRequest{} 16 | alipayRequest := request.NewAlipayRequest(alipayDownloadDisputeEvidenceRequest, model.DOWNLOAD_DISPUTE_EVIDENCE_PATH, &responseDispute.AlipayDownloadDisputeEvidenceResponse{}) 17 | return alipayRequest, alipayDownloadDisputeEvidenceRequest 18 | } 19 | -------------------------------------------------------------------------------- /com/alipay/api/request/dispute/AlipaySupplyDefenseDocumentRequest.go: -------------------------------------------------------------------------------- 1 | package dispute 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseDispute "github.com/alipay/global-open-sdk-go/com/alipay/api/response/dispute" 7 | ) 8 | 9 | type AlipaySupplyDefenseDocumentRequest struct { 10 | DisputeId string `json:"disputeId,omitempty"` 11 | DisputeEvidence string `json:"disputeEvidence,omitempty"` 12 | } 13 | 14 | func NewAlipaySupplyDefenseDocumentRequest() (*request.AlipayRequest, *AlipaySupplyDefenseDocumentRequest) { 15 | alipaySupplyDefenseDocumentRequest := &AlipaySupplyDefenseDocumentRequest{} 16 | alipayRequest := request.NewAlipayRequest(alipaySupplyDefenseDocumentRequest, model.SUPPLY_DEFENCE_DOC_PATH, &responseDispute.AlipaySupplyDefenseDocumentResponse{}) 17 | return alipayRequest, alipaySupplyDefenseDocumentRequest 18 | } 19 | -------------------------------------------------------------------------------- /com/alipay/api/request/marketplace/AlipayCreatePayoutRequest.go: -------------------------------------------------------------------------------- 1 | package marketplace 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseMarketplace "github.com/alipay/global-open-sdk-go/com/alipay/api/response/marketplace" 7 | ) 8 | 9 | type AlipayCreatePayoutRequest struct { 10 | TransferRequestId string `json:"transferRequestId,omitempty"` 11 | TransferFromDetail *model.TransferFromDetail `json:"transferFromDetail,omitempty"` 12 | TransferToDetail *model.TransferToDetail `json:"transferToDetail,omitempty"` 13 | } 14 | 15 | func NewAlipayCreatePayoutRequest() (*request.AlipayRequest, *AlipayCreatePayoutRequest) { 16 | alipayCreatePayoutRequest := &AlipayCreatePayoutRequest{} 17 | alipayRequest := request.NewAlipayRequest(alipayCreatePayoutRequest, model.MARKETPLACE_CREATEPAYOUT_PATH, &responseMarketplace.AlipayCreatePayoutResponse{}) 18 | return alipayRequest, alipayCreatePayoutRequest 19 | } 20 | -------------------------------------------------------------------------------- /com/alipay/api/request/marketplace/AlipayCreateTransferRequest.go: -------------------------------------------------------------------------------- 1 | package marketplace 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseMarketplace "github.com/alipay/global-open-sdk-go/com/alipay/api/response/marketplace" 7 | ) 8 | 9 | type AlipayCreateTransferRequest struct { 10 | TransferRequestId string `json:"transferRequestId,omitempty"` 11 | TransferFromDetail *model.TransferFromDetail `json:"transferFromDetail,omitempty"` 12 | TransferToDetail *model.TransferToDetail `json:"transferToDetail,omitempty"` 13 | } 14 | 15 | func NewAlipayCreateTransferRequest() (*request.AlipayRequest, *AlipayCreateTransferRequest) { 16 | alipayCreateTransferRequest := &AlipayCreateTransferRequest{} 17 | alipayRequest := request.NewAlipayRequest(alipayCreateTransferRequest, model.MARKETPLACE_CREATETRANSFER_PATH, &responseMarketplace.AlipayCreateTransferResponse{}) 18 | return alipayRequest, alipayCreateTransferRequest 19 | } 20 | -------------------------------------------------------------------------------- /com/alipay/api/request/marketplace/AlipayInquireBalanceRequest.go: -------------------------------------------------------------------------------- 1 | package marketplace 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseMarketplace "github.com/alipay/global-open-sdk-go/com/alipay/api/response/marketplace" 7 | ) 8 | 9 | type AlipayInquireBalanceRequest struct { 10 | ReferenceMerchantId string `json:"referenceMerchantId,omitempty"` 11 | } 12 | 13 | func NewAlipayInquireBalanceRequest() (*request.AlipayRequest, *AlipayInquireBalanceRequest) { 14 | alipayInquireBalanceRequest := &AlipayInquireBalanceRequest{} 15 | alipayRequest := request.NewAlipayRequest(alipayInquireBalanceRequest, model.MARKETPLACE_INQUIREBALANCE_PATH, &responseMarketplace.AlipayInquireBalanceResponse{}) 16 | return alipayRequest, alipayInquireBalanceRequest 17 | } 18 | -------------------------------------------------------------------------------- /com/alipay/api/request/marketplace/AlipayRegisterRequest.go: -------------------------------------------------------------------------------- 1 | package marketplace 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseMarketplace "github.com/alipay/global-open-sdk-go/com/alipay/api/response/marketplace" 7 | ) 8 | 9 | type AlipayRegisterRequest struct { 10 | RegistrationRequestId string `json:"registrationRequestId,omitempty"` 11 | SettlementInfos []*model.SettlementInfo `json:"settlementInfos,omitempty"` 12 | MerchantInfo *model.MerchantInfo `json:"merchantInfo,omitempty"` 13 | PaymentMethods []*model.PaymentMethod `json:"paymentMethods,omitempty"` 14 | } 15 | 16 | func NewAlipayRegisterRequest() (*request.AlipayRequest, *AlipayRegisterRequest) { 17 | alipayRegisterRequest := &AlipayRegisterRequest{} 18 | alipayRequest := request.NewAlipayRequest(alipayRegisterRequest, model.MARKETPLACE_REGISTER_PATH, &responseMarketplace.AlipayRegisterResponse{}) 19 | return alipayRequest, alipayRegisterRequest 20 | } 21 | -------------------------------------------------------------------------------- /com/alipay/api/request/marketplace/AlipaySettleRequest.go: -------------------------------------------------------------------------------- 1 | package marketplace 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseMarketplace "github.com/alipay/global-open-sdk-go/com/alipay/api/response/marketplace" 7 | ) 8 | 9 | type AlipaySettleRequest struct { 10 | SettlementRequestId string `json:"settlementRequestId,omitempty"` 11 | PaymentId string `json:"paymentId,omitempty"` 12 | SettlementDetails []*model.SettlementDetail `json:"settlementDetails,omitempty"` 13 | } 14 | 15 | func NewAlipaySettleRequest() (*request.AlipayRequest, *AlipaySettleRequest) { 16 | alipaySettleRequest := &AlipaySettleRequest{} 17 | alipayRequest := request.NewAlipayRequest(alipaySettleRequest, model.MARKETPLACE_SETTLE_PATH, &responseMarketplace.AlipaySettleResponse{}) 18 | return alipayRequest, alipaySettleRequest 19 | } 20 | -------------------------------------------------------------------------------- /com/alipay/api/request/marketplace/AlipaySettlementInfoUpdateRequest.go: -------------------------------------------------------------------------------- 1 | package marketplace 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseMarketplace "github.com/alipay/global-open-sdk-go/com/alipay/api/response/marketplace" 7 | ) 8 | 9 | type AlipaySettlementInfoUpdateRequest struct { 10 | UpdateRequestId string `json:"updateRequestId,omitempty"` 11 | ReferenceMerchantId string `json:"referenceMerchantId,omitempty"` 12 | SettlementCurrency string `json:"settlementCurrency,omitempty"` 13 | SettlementBankAccount *model.SettlementBankAccount `json:"settlementBankAccount,omitempty"` 14 | } 15 | 16 | func NewAlipaySettlementInfoUpdateRequest() (*request.AlipayRequest, *AlipaySettlementInfoUpdateRequest) { 17 | alipaySettlementInfoUpdateRequest := &AlipaySettlementInfoUpdateRequest{} 18 | alipayRequest := request.NewAlipayRequest(alipaySettlementInfoUpdateRequest, model.MARKETPLACE_SETTLEMENTINFO_UPDATE_PATH, &responseMarketplace.AlipaySettlementInfoUpdateResponse{}) 19 | return alipayRequest, alipaySettlementInfoUpdateRequest 20 | } 21 | -------------------------------------------------------------------------------- /com/alipay/api/request/marketplace/AlipaySubmitAttachmentRequest.go: -------------------------------------------------------------------------------- 1 | package marketplace 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseMarketplace "github.com/alipay/global-open-sdk-go/com/alipay/api/response/marketplace" 7 | ) 8 | 9 | type AlipaySubmitAttachmentRequest struct { 10 | SubmitAttachmentRequestId string `json:"submitAttachmentRequestId,omitempty"` 11 | AttachmentType model.AttachmentType `json:"attachmentType,omitempty"` 12 | FileSha256 string `json:"fileSha256,omitempty"` 13 | } 14 | 15 | func NewAlipaySubmitAttachmentRequest() (*request.AlipayRequest, *AlipaySubmitAttachmentRequest) { 16 | alipaySubmitAttachmentRequest := &AlipaySubmitAttachmentRequest{} 17 | alipayRequest := request.NewAlipayRequest(alipaySubmitAttachmentRequest, model.MARKETPLACE_SUBMITATTACHMENT_PATH, &responseMarketplace.AlipaySubmitAttachmentResponse{}) 18 | return alipayRequest, alipaySubmitAttachmentRequest 19 | } 20 | -------------------------------------------------------------------------------- /com/alipay/api/request/notify/AlipayAuthNotify.go: -------------------------------------------------------------------------------- 1 | package notify 2 | 3 | type AlipayAuthNotify struct { 4 | AlipayNotify 5 | AuthorizationNotifyType string `json:"authorizationNotifyType,omitempty"` 6 | AuthClientId string `json:"authClientId,omitempty"` 7 | AccessToken string `json:"accessToken,omitempty"` 8 | AuthState string `json:"authState,omitempty"` 9 | AuthCode string `json:"authCode,omitempty"` 10 | Reason string `json:"reason,omitempty"` 11 | UserLoginId string `json:"userLoginId,omitempty"` 12 | UserId string `json:"userId,omitempty"` 13 | } 14 | -------------------------------------------------------------------------------- /com/alipay/api/request/notify/AlipayCaptureResultNotify.go: -------------------------------------------------------------------------------- 1 | package notify 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 4 | 5 | type AlipayCaptureResultNotify struct { 6 | AlipayNotify 7 | CaptureRequestId string `json:"captureRequestId,omitempty"` 8 | PaymentId string `json:"paymentId,omitempty"` 9 | CaptureId string `json:"captureId,omitempty"` 10 | CaptureAmount *model.Amount `json:"captureAmount,omitempty"` 11 | CaptureTime string `json:"captureTime,omitempty"` 12 | AcquirerReferenceNo string `json:"acquirerReferenceNo,omitempty"` 13 | AcquirerInfo *model.AcquirerInfo `json:"acquirerInfo,omitempty"` 14 | } 15 | -------------------------------------------------------------------------------- /com/alipay/api/request/notify/AlipayDisputeNotify.go: -------------------------------------------------------------------------------- 1 | package notify 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 4 | 5 | type AlipayDisputeNotify struct { 6 | AlipayNotify 7 | PaymentRequestId string `json:"paymentRequestId,omitempty"` 8 | DisputeId string `json:"disputeId,omitempty"` 9 | PaymentId string `json:"paymentId,omitempty"` 10 | DisputeTime string `json:"disputeTime,omitempty"` 11 | DisputeAmount *model.Amount `json:"disputeAmount,omitempty"` 12 | DisputeNotificationType model.DisputeNotificationType `json:"disputeNotificationType,omitempty"` 13 | DisputeReasonMsg string `json:"disputeReasonMsg,omitempty"` 14 | DisputeJudgedTime string `json:"disputeJudgedTime,omitempty"` 15 | DisputeJudgedAmount *model.Amount `json:"disputeJudgedAmount,omitempty"` 16 | DisputeJudgedResult model.DisputeJudgedResult `json:"disputeJudgedResult,omitempty"` 17 | DefenseDueTime string `json:"defenseDueTime,omitempty"` 18 | DisputeReasonCode string `json:"disputeReasonCode,omitempty"` 19 | DisputeSource string `json:"disputeSource,omitempty"` 20 | Rrn string `json:"arn,omitempty"` 21 | DisputeAcceptReason model.DisputeAcceptReasonType `json:"disputeAcceptReason,omitempty"` 22 | DisputeAcceptTime string `json:"disputeAcceptTime,omitempty"` 23 | DisputeType string `json:"disputeType,omitempty"` 24 | Defendable bool `json:"defendable,omitempty"` 25 | } 26 | -------------------------------------------------------------------------------- /com/alipay/api/request/notify/AlipayNotify.go: -------------------------------------------------------------------------------- 1 | package notify 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 5 | ) 6 | 7 | type AlipayNotify struct { 8 | NotifyType string `json:"notifyType,omitempty"` 9 | Result response.Result `json:"result,omitempty"` 10 | } 11 | -------------------------------------------------------------------------------- /com/alipay/api/request/notify/AlipayPayResultNotify.go: -------------------------------------------------------------------------------- 1 | package notify 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 4 | 5 | type AlipayPayResultNotify struct { 6 | AlipayNotify 7 | PaymentRequestId string `json:"paymentRequestId,omitempty"` 8 | PaymentId string `json:"paymentId,omitempty"` 9 | PaymentAmount *model.Amount `json:"paymentAmount,omitempty"` 10 | PaymentCreateTime string `json:"paymentCreateTime,omitempty"` 11 | PaymentTime string `json:"paymentTime,omitempty"` 12 | CustomsDeclarationAmount *model.Amount `json:"customsDeclarationAmount,omitempty"` 13 | GrossSettlementAmount *model.Amount `json:"grossSettlementAmount,omitempty"` 14 | SettlementQuote *model.Quote `json:"settlementQuote,omitempty"` 15 | PspCustomerInfo *model.PspCustomerInfo `json:"pspCustomerInfo,omitempty"` 16 | AcquirerReferenceNo string `json:"acquirerReferenceNo,omitempty"` 17 | PaymentResultInfo *model.PaymentResultInfo `json:"paymentResultInfo,omitempty"` 18 | AcquirerInfo *model.AcquirerInfo `json:"acquirerInfo,omitempty"` 19 | PromotionResult []*model.PromotionResult `json:"promotionResult,omitempty"` 20 | PaymentMethodType string `json:"paymentMethodType,omitempty"` 21 | } 22 | -------------------------------------------------------------------------------- /com/alipay/api/request/notify/AlipayRefundNotify.go: -------------------------------------------------------------------------------- 1 | package notify 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 4 | 5 | type AlipayRefundNotify struct { 6 | AlipayNotify 7 | RefundStatus string `json:"refundStatus,omitempty"` 8 | RefundRequestId string `json:"refundRequestId,omitempty"` 9 | RefundId string `json:"refundId,omitempty"` 10 | RefundAmount *model.Amount `json:"refundAmount,omitempty"` 11 | RefundTime string `json:"refundTime,omitempty"` 12 | GrossSettlementAmount *model.Amount `json:"grossSettlementAmount,omitempty"` 13 | SettlementQuote *model.Quote `json:"settlementQuote,omitempty"` 14 | } 15 | -------------------------------------------------------------------------------- /com/alipay/api/request/notify/AlipaySubscriptionNotify.go: -------------------------------------------------------------------------------- 1 | package notify 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 4 | 5 | type AlipaySubscriptionNotify struct { 6 | AlipayNotify 7 | SubscriptionRequestId string `json:"subscriptionRequestId,omitempty"` 8 | SubscriptionId string `json:"subscriptionId,omitempty"` 9 | SubscriptionStatus model.SubscriptionStatus `json:"subscriptionStatus,omitempty"` 10 | SubscriptionNotificationType model.SubscriptionNotificationType `json:"subscriptionNotificationType,omitempty"` 11 | SubscriptionStartTime string `json:"subscriptionStartTime,omitempty"` 12 | SubscriptionEndTime string `json:"subscriptionEndTime,omitempty"` 13 | PeriodRule *model.PeriodRule `json:"periodRule,omitempty"` 14 | } 15 | -------------------------------------------------------------------------------- /com/alipay/api/request/notify/AlipaySubscriptionPayNotify.go: -------------------------------------------------------------------------------- 1 | package notify 2 | 3 | type AlipaySubscriptionPayNotify struct { 4 | AlipayNotify 5 | SubscriptionRequestId string `json:"subscriptionRequestId,omitempty"` 6 | SubscriptionId string `json:"subscriptionId,omitempty"` 7 | PeriodStartTime string `json:"periodStartTime,omitempty"` 8 | PeriodEndTime string `json:"periodEndTime,omitempty"` 9 | PhaseNo string `json:"phaseNo,omitempty"` 10 | } 11 | -------------------------------------------------------------------------------- /com/alipay/api/request/notify/AlipayVaultingNotify.go: -------------------------------------------------------------------------------- 1 | package notify 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 4 | 5 | type AlipayVaultingNotify struct { 6 | AlipayNotify 7 | VaultingRequestId string `json:"vaultingRequestId,omitempty"` 8 | PaymentMethodDetail *model.PaymentMethodDetail `json:"paymentMethodDetail,omitempty"` 9 | VaultingCreateTime string `json:"vaultingCreateTime,omitempty"` 10 | AcquirerInfo string `json:"acquirerInfo,omitempty"` 11 | } 12 | -------------------------------------------------------------------------------- /com/alipay/api/request/pay/AlipayCaptureRequest.go: -------------------------------------------------------------------------------- 1 | package pay 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responsePay "github.com/alipay/global-open-sdk-go/com/alipay/api/response/pay" 7 | ) 8 | 9 | type AlipayCaptureRequest struct { 10 | CaptureRequestId string `json:"captureRequestId,omitempty"` 11 | PaymentId string `json:"paymentId,omitempty"` 12 | CaptureAmount *model.Amount `json:"captureAmount,omitempty"` 13 | IsLastCapture bool `json:"isLastCapture,omitempty"` 14 | } 15 | 16 | func (alipayCaptureRequest *AlipayCaptureRequest) NewRequest() *request.AlipayRequest { 17 | return request.NewAlipayRequest(&alipayCaptureRequest, model.CAPTURE_PATH, &responsePay.AlipayCaptureResponse{}) 18 | } 19 | 20 | func NewAlipayCaptureRequest() (*request.AlipayRequest, *AlipayCaptureRequest) { 21 | alipayCaptureRequest := &AlipayCaptureRequest{} 22 | alipayRequest := request.NewAlipayRequest(alipayCaptureRequest, model.CAPTURE_PATH, &responsePay.AlipayCaptureResponse{}) 23 | return alipayRequest, alipayCaptureRequest 24 | } 25 | -------------------------------------------------------------------------------- /com/alipay/api/request/pay/AlipayDeviceCertificateRequest.go: -------------------------------------------------------------------------------- 1 | package pay 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responsePay "github.com/alipay/global-open-sdk-go/com/alipay/api/response/pay" 7 | ) 8 | 9 | type AlipayDeviceCertificateRequest struct { 10 | DevicePublicKey string `json:"devicePublicKey,omitempty"` 11 | DeviceRequestId string `json:"deviceRequestId,omitempty"` 12 | } 13 | 14 | func (alipayCaptureRequest *AlipayDeviceCertificateRequest) NewRequest() *request.AlipayRequest { 15 | return request.NewAlipayRequest(&alipayCaptureRequest, model.CREATE_DEVICE_CERTIFICATE_PATH, &responsePay.AlipayDeviceCertificateResponse{}) 16 | } 17 | 18 | func NewAlipayDeviceCertificateRequest() (*request.AlipayRequest, *AlipayDeviceCertificateRequest) { 19 | alipayDeviceCertificateRequest := &AlipayDeviceCertificateRequest{} 20 | alipayRequest := request.NewAlipayRequest(alipayDeviceCertificateRequest, model.CREATE_DEVICE_CERTIFICATE_PATH, &responsePay.AlipayDeviceCertificateResponse{}) 21 | return alipayRequest, alipayDeviceCertificateRequest 22 | } 23 | -------------------------------------------------------------------------------- /com/alipay/api/request/pay/AlipayInquiryRefundRequest.go: -------------------------------------------------------------------------------- 1 | package pay 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responsePay "github.com/alipay/global-open-sdk-go/com/alipay/api/response/pay" 7 | ) 8 | 9 | type AlipayInquiryRefundRequest struct { 10 | RefundRequestId string `json:"refundRequestId,omitempty"` 11 | RefundId string `json:"refundId,omitempty"` 12 | MerchantAccountId string `json:"merchantAccountId,omitempty"` 13 | } 14 | 15 | func (alipayInquiryRefundRequest *AlipayInquiryRefundRequest) NewRequest() *request.AlipayRequest { 16 | return request.NewAlipayRequest(&alipayInquiryRefundRequest, model.INQUIRY_REFUND_PATH, &responsePay.AlipayInquiryRefundResponse{}) 17 | } 18 | 19 | func NewAlipayInquiryRefundRequest() (*request.AlipayRequest, *AlipayInquiryRefundRequest) { 20 | alipayInquiryRefundRequest := &AlipayInquiryRefundRequest{} 21 | alipayRequest := request.NewAlipayRequest(alipayInquiryRefundRequest, model.INQUIRY_REFUND_PATH, &responsePay.AlipayInquiryRefundResponse{}) 22 | return alipayRequest, alipayInquiryRefundRequest 23 | } 24 | -------------------------------------------------------------------------------- /com/alipay/api/request/pay/AlipayPayCancelRequest.go: -------------------------------------------------------------------------------- 1 | package pay 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responsePay "github.com/alipay/global-open-sdk-go/com/alipay/api/response/pay" 7 | ) 8 | 9 | type AlipayPayCancelRequest struct { 10 | PaymentId string `json:"paymentId,omitempty"` 11 | PaymentRequestId string `json:"paymentRequestId,omitempty"` 12 | MerchantAccountId string `json:"merchantAccountId,omitempty"` 13 | } 14 | 15 | func NewAlipayPayCancelRequest() (*request.AlipayRequest, *AlipayPayCancelRequest) { 16 | alipayPayCancelRequest := &AlipayPayCancelRequest{} 17 | alipayRequest := request.NewAlipayRequest(alipayPayCancelRequest, model.CANCEL_PATH, &responsePay.AlipayPayCancelResponse{}) 18 | return alipayRequest, alipayPayCancelRequest 19 | } 20 | -------------------------------------------------------------------------------- /com/alipay/api/request/pay/AlipayPayConsultRequest.go: -------------------------------------------------------------------------------- 1 | package pay 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responsePay "github.com/alipay/global-open-sdk-go/com/alipay/api/response/pay" 7 | ) 8 | 9 | type AlipayPayConsultRequest struct { 10 | ProductCode model.ProductCodeType `json:"productCode,omitempty"` 11 | PaymentAmount *model.Amount `json:"paymentAmount,omitempty"` 12 | MerchantRegion string `json:"merchantRegion,omitempty"` 13 | AllowedPaymentMethodRegions []string `json:"allowedPaymentMethodRegions,omitempty"` 14 | AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` 15 | BlockedPaymentMethods []string `json:"blockedPaymentMethods,omitempty"` 16 | Region string `json:"region,omitempty"` 17 | CustomerId string `json:"customerId,omitempty"` 18 | ReferenceUserId string `json:"referenceUserId,omitempty"` 19 | Env *model.Env `json:"env,omitempty"` 20 | ExtendInfo string `json:"extendInfo,omitempty"` 21 | UserRegion string `json:"userRegion,omitempty"` 22 | PaymentFactor *model.PaymentFactor `json:"paymentFactor,omitempty"` 23 | SettlementStrategy *model.SettlementStrategy `json:"settlementStrategy,omitempty"` 24 | Merchant *model.Merchant `json:"merchant,omitempty"` 25 | AllowedPspRegions []string `json:"allowedPspRegions,omitempty"` 26 | Buyer *model.Buyer `json:"buyer,omitempty"` 27 | MerchantAccountId string `json:"merchantAccountId,omitempty"` 28 | } 29 | 30 | func (alipayPayConsultRequest *AlipayPayConsultRequest) NewRequest() *request.AlipayRequest { 31 | return request.NewAlipayRequest(&alipayPayConsultRequest, model.CONSULT_PAYMENT_PATH, &responsePay.AlipayPayConsultResponse{}) 32 | } 33 | 34 | func NewAlipayPayConsultRequest() (*request.AlipayRequest, *AlipayPayConsultRequest) { 35 | alipayPayConsultRequest := &AlipayPayConsultRequest{} 36 | alipayRequest := request.NewAlipayRequest(alipayPayConsultRequest, model.CONSULT_PAYMENT_PATH, &responsePay.AlipayPayConsultResponse{}) 37 | return alipayRequest, alipayPayConsultRequest 38 | } 39 | -------------------------------------------------------------------------------- /com/alipay/api/request/pay/AlipayPayQueryRequest.go: -------------------------------------------------------------------------------- 1 | package pay 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | "github.com/alipay/global-open-sdk-go/com/alipay/api/response/pay" 7 | ) 8 | 9 | type AlipayPayQueryRequest struct { 10 | PaymentRequestId string `json:"paymentRequestId,omitempty"` 11 | PaymentId string `json:"paymentId,omitempty"` 12 | MerchantAccountId string `json:"MerchantAccountId,omitempty"` 13 | } 14 | 15 | func (alipayPayQueryRequest *AlipayPayQueryRequest) NewRequest() *request.AlipayRequest { 16 | return request.NewAlipayRequest(&alipayPayQueryRequest, model.INQUIRY_PAYMENT_PATH, &responsePay.AlipayPayQueryResponse{}) 17 | } 18 | 19 | func NewAlipayPayQueryRequest() (*request.AlipayRequest, *AlipayPayQueryRequest) { 20 | alipayPayQueryRequest := &AlipayPayQueryRequest{} 21 | alipayRequest := request.NewAlipayRequest(alipayPayQueryRequest, model.INQUIRY_PAYMENT_PATH, &responsePay.AlipayPayQueryResponse{}) 22 | return alipayRequest, alipayPayQueryRequest 23 | } 24 | -------------------------------------------------------------------------------- /com/alipay/api/request/pay/AlipayPayRequest.go: -------------------------------------------------------------------------------- 1 | package pay 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responsePay "github.com/alipay/global-open-sdk-go/com/alipay/api/response/pay" 7 | ) 8 | 9 | type AlipayPayRequest struct { 10 | ProductCode model.ProductCodeType `json:"productCode,omitempty"` 11 | PaymentRequestId string `json:"paymentRequestId,omitempty"` 12 | Order *model.Order `json:"order,omitempty"` 13 | PaymentAmount *model.Amount `json:"paymentAmount,omitempty"` 14 | PaymentMethod *model.PaymentMethod `json:"paymentMethod,omitempty"` 15 | PaymentExpiryTime string `json:"paymentExpiryTime,omitempty"` 16 | PaymentRedirectUrl string `json:"paymentRedirectUrl,omitempty"` 17 | PaymentNotifyUrl string `json:"paymentNotifyUrl,omitempty"` 18 | PaymentFactor *model.PaymentFactor `json:"paymentFactor,omitempty"` 19 | SettlementStrategy *model.SettlementStrategy `json:"settlementStrategy,omitempty"` 20 | CreditPayPlan *model.CreditPayPlan `json:"creditPayPlan,omitempty"` 21 | AppId string `json:"appId,omitempty"` 22 | MerchantRegion string `json:"merchantRegion,omitempty"` 23 | UserRegion string `json:"userRegion,omitempty"` 24 | Env *model.Env `json:"env,omitempty"` 25 | PayToMethod *model.PaymentMethod `json:"payToMethod,omitempty"` 26 | IsAuthorization *bool `json:"isAuthorization,omitempty"` 27 | Merchant *model.Merchant `json:"merchant,omitempty"` 28 | PaymentVerificationData *model.PaymentVerificationData `json:"paymentVerificationData,omitempty"` 29 | ExtendInfo string `json:"extendInfo,omitempty"` 30 | MerchantAccountId string `json:"merchantAccountId,omitempty"` 31 | } 32 | 33 | func (alipayPayRequest *AlipayPayRequest) NewRequest() *request.AlipayRequest { 34 | return request.NewAlipayRequest(&alipayPayRequest, model.PAYMENT_PATH, &responsePay.AlipayPayResponse{}) 35 | } 36 | 37 | func NewAlipayPayRequest() (*request.AlipayRequest, *AlipayPayRequest) { 38 | alipayPayRequest := &AlipayPayRequest{} 39 | alipayRequest := request.NewAlipayRequest(alipayPayRequest, model.PAYMENT_PATH, &responsePay.AlipayPayResponse{}) 40 | return alipayRequest, alipayPayRequest 41 | } 42 | -------------------------------------------------------------------------------- /com/alipay/api/request/pay/AlipayPaymentSessionRequest.go: -------------------------------------------------------------------------------- 1 | package pay 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responsePay "github.com/alipay/global-open-sdk-go/com/alipay/api/response/pay" 7 | ) 8 | 9 | type AlipayPaymentSessionRequest struct { 10 | ProductCode model.ProductCodeType `json:"productCode,omitempty"` 11 | PaymentRequestId string `json:"paymentRequestId,omitempty"` 12 | Order *model.Order `json:"order,omitempty"` 13 | PaymentAmount *model.Amount `json:"paymentAmount,omitempty"` 14 | PaymentMethod *model.PaymentMethod `json:"paymentMethod,omitempty"` 15 | PaymentSessionExpiryTime string `json:"paymentSessionExpiryTime,omitempty"` 16 | PaymentRedirectUrl string `json:"paymentRedirectUrl,omitempty"` 17 | PaymentNotifyUrl string `json:"paymentNotifyUrl,omitempty"` 18 | PaymentFactor *model.PaymentFactor `json:"paymentFactor,omitempty"` 19 | SettlementStrategy *model.SettlementStrategy `json:"settlementStrategy,omitempty"` 20 | EnableInstallmentCollection bool `json:"enableInstallmentCollection,omitempty"` 21 | CreditPayPlan *model.CreditPayPlan `json:"creditPayPlan,omitempty"` 22 | MerchantRegion string `json:"merchantRegion,omitempty"` 23 | Env *model.Env `json:"env,omitempty"` 24 | AgreementInfo *model.AgreementInfo `json:"agreementInfo,omitempty"` 25 | RiskData *model.RiskData `json:"riskData,omitempty"` 26 | ProductScene string `json:"productScene,omitempty"` 27 | SavedPaymentMethods []*model.PaymentMethod `json:"savedPaymentMethods,omitempty"` 28 | Locale string `json:"locale,omitempty"` 29 | AvailablePaymentMethod *model.AvailablePaymentMethod `json:"availablePaymentMethod,omitempty"` 30 | AllowedPaymentMethodRegions []string `json:"allowedPaymentMethodRegions,omitempty"` 31 | } 32 | 33 | func (alipayPaymentSessionRequest *AlipayPaymentSessionRequest) NewRequest() *request.AlipayRequest { 34 | return request.NewAlipayRequest(&alipayPaymentSessionRequest, model.CREATE_SESSION_PATH, &responsePay.AlipayPaymentSessionResponse{}) 35 | } 36 | 37 | func NewAlipayPaymentSessionRequest() (*request.AlipayRequest, *AlipayPaymentSessionRequest) { 38 | alipayPaymentSessionRequest := &AlipayPaymentSessionRequest{} 39 | alipayRequest := request.NewAlipayRequest(alipayPaymentSessionRequest, model.CREATE_SESSION_PATH, &responsePay.AlipayPaymentSessionResponse{}) 40 | return alipayRequest, alipayPaymentSessionRequest 41 | } 42 | -------------------------------------------------------------------------------- /com/alipay/api/request/pay/AlipayRefundRequest.go: -------------------------------------------------------------------------------- 1 | package pay 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responsePay "github.com/alipay/global-open-sdk-go/com/alipay/api/response/pay" 7 | ) 8 | 9 | type AlipayRefundRequest struct { 10 | RefundRequestId string `json:"refundRequestId,omitempty"` 11 | PaymentId string `json:"paymentId,omitempty"` 12 | ReferenceRefundId string `json:"referenceRefundId,omitempty"` 13 | RefundAmount *model.Amount `json:"refundAmount,omitempty"` 14 | RefundReason string `json:"refundReason,omitempty"` 15 | RefundNotifyUrl string `json:"refundNotifyUrl,omitempty"` 16 | IsAsyncRefund *bool `json:"isAsyncRefund,omitempty"` 17 | ExtendInfo string `json:"extendInfo,omitempty"` 18 | RefundDetails []model.RefundDetail `json:"refundDetails,omitempty"` 19 | RefundSourceAccountNo string `json:"refundSourceAccountNo,omitempty"` 20 | } 21 | 22 | func (alipayRefundRequest *AlipayRefundRequest) NewRequest() *request.AlipayRequest { 23 | return request.NewAlipayRequest(&alipayRefundRequest, model.REFUND_PATH, &responsePay.AlipayRefundResponse{}) 24 | } 25 | 26 | func NewAlipayRefundRequest() (*request.AlipayRequest, *AlipayRefundRequest) { 27 | alipayRefundRequest := &AlipayRefundRequest{} 28 | alipayRequest := request.NewAlipayRequest(alipayRefundRequest, model.REFUND_PATH, &responsePay.AlipayRefundResponse{}) 29 | return alipayRequest, alipayRefundRequest 30 | } 31 | -------------------------------------------------------------------------------- /com/alipay/api/request/pay/AlipaySyncArrearRequest.go: -------------------------------------------------------------------------------- 1 | package pay 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responsePay "github.com/alipay/global-open-sdk-go/com/alipay/api/response/pay" 7 | ) 8 | 9 | type AlipaySyncArrearRequest struct { 10 | PaymentId string `json:"paymentId,omitempty"` 11 | PaymentRequestId string `json:"paymentRequestId,omitempty"` 12 | } 13 | 14 | func (alipayCaptureRequest *AlipaySyncArrearRequest) NewRequest() *request.AlipayRequest { 15 | return request.NewAlipayRequest(&alipayCaptureRequest, model.SYNC_ARREAR_PATH, &responsePay.AlipaySyncArrearResponse{}) 16 | } 17 | 18 | func NewAlipaySyncArrearRequest() (*request.AlipayRequest, *AlipaySyncArrearRequest) { 19 | alipaySyncArrearRequest := &AlipaySyncArrearRequest{} 20 | alipayRequest := request.NewAlipayRequest(alipaySyncArrearRequest, model.SYNC_ARREAR_PATH, &responsePay.AlipaySyncArrearResponse{}) 21 | return alipayRequest, alipaySyncArrearRequest 22 | } 23 | -------------------------------------------------------------------------------- /com/alipay/api/request/pay/AlipayUploadInvoiceShippingFileRequest.go: -------------------------------------------------------------------------------- 1 | package pay 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 5 | responsePay "github.com/alipay/global-open-sdk-go/com/alipay/api/response/pay" 6 | ) 7 | 8 | type AlipayUploadInvoiceShippingFileRequest struct { 9 | PaymentRequestId string `json:"paymentRequestId,omitempty"` 10 | MerchantId string `json:"merchantId,omitempty"` 11 | FileId string `json:"fileId,omitempty"` 12 | UploadFile string `json:"uploadFile,omitempty"` 13 | FileType string `json:"fileType,omitempty"` 14 | FileName string `json:"fileName,omitempty"` 15 | } 16 | 17 | func (alipayUploadInvoiceShippingFileRequest *AlipayUploadInvoiceShippingFileRequest) NewRequest() *request.AlipayRequest { 18 | return request.NewAlipayRequest(&alipayUploadInvoiceShippingFileRequest, "/ams/api/v1/payments/uploadInvoiceShippingFile", &responsePay.AlipayUploadInvoiceShippingFileResponse{}) 19 | } 20 | 21 | func NewAlipayUploadInvoiceShippingFileRequest() (*request.AlipayRequest, *AlipayUploadInvoiceShippingFileRequest) { 22 | alipayUploadInvoiceShippingFileRequest := &AlipayUploadInvoiceShippingFileRequest{} 23 | alipayRequest := request.NewAlipayRequest(alipayUploadInvoiceShippingFileRequest, "/ams/api/v1/payments/uploadInvoiceShippingFile", &responsePay.AlipayUploadInvoiceShippingFileResponse{}) 24 | return alipayRequest, alipayUploadInvoiceShippingFileRequest 25 | } 26 | -------------------------------------------------------------------------------- /com/alipay/api/request/risk/RiskDecideRequest.go: -------------------------------------------------------------------------------- 1 | package risk 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseRisk "github.com/alipay/global-open-sdk-go/com/alipay/api/response/risk" 7 | ) 8 | 9 | type RiskDecideRequest struct { 10 | ReferenceTransactionId string `json:"referenceTransactionId,omitempty"` 11 | AuthorizationPhase model.AuthorizationPhase `json:"authorizationPhase,omitempty"` 12 | Orders []*model.Order `json:"orders,omitempty"` 13 | Buyer *model.Buyer `json:"buyer,omitempty"` 14 | ActualPaymentAmount *model.Amount `json:"actualPaymentAmount,omitempty"` 15 | PaymentDetails []*model.PaymentDetail `json:"paymentDetails,omitempty"` 16 | DiscountAmount *model.Amount `json:"discountAmount,omitempty"` 17 | EnvInfo *model.Env `json:"envInfo,omitempty"` 18 | } 19 | 20 | func NewRiskDecideRequest() (*request.AlipayRequest, *RiskDecideRequest) { 21 | riskDecideRequest := &RiskDecideRequest{} 22 | alipayRequest := request.NewAlipayRequest(riskDecideRequest, model.RISK_DECIDE_PATH, &responseRisk.RiskDecideResponse{}) 23 | return alipayRequest, riskDecideRequest 24 | } 25 | -------------------------------------------------------------------------------- /com/alipay/api/request/risk/RiskReportRequest.go: -------------------------------------------------------------------------------- 1 | package risk 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseRisk "github.com/alipay/global-open-sdk-go/com/alipay/api/response/risk" 7 | ) 8 | 9 | type RiskReportRequest struct { 10 | ReferenceTransactionId string `json:"referenceTransactionId,omitempty"` 11 | ReportReason string `json:"reportReason,omitempty"` 12 | RiskType string `json:"riskType,omitempty"` 13 | RiskOccurrenceTime string `json:"riskOccurrenceTime,omitempty"` 14 | } 15 | 16 | func NewRiskReportRequest() (*request.AlipayRequest, *RiskReportRequest) { 17 | riskReportRequest := &RiskReportRequest{} 18 | alipayRequest := request.NewAlipayRequest(riskReportRequest, model.RISK_REPORT_PATH, &responseRisk.RiskReportResponse{}) 19 | return alipayRequest, riskReportRequest 20 | } 21 | -------------------------------------------------------------------------------- /com/alipay/api/request/risk/SendPaymentResultRequest.go: -------------------------------------------------------------------------------- 1 | package risk 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseRisk "github.com/alipay/global-open-sdk-go/com/alipay/api/response/risk" 7 | ) 8 | 9 | type SendPaymentResultRequest struct { 10 | ReferenceTransactionId string `json:"referenceTransactionId,omitempty"` 11 | PaymentStatus string `json:"paymentStatus,omitempty"` 12 | AuthorizationError *model.AuthorizationError `json:"authorizationError,omitempty"` 13 | CardVerificationResult *model.CardVerificationResult `json:"cardVerificationResult,omitempty"` 14 | PaymentMethodProvider string `json:"paymentMethodProvider,omitempty"` 15 | } 16 | 17 | func NewSendPaymentResultRequest() (*request.AlipayRequest, *SendPaymentResultRequest) { 18 | sendPaymentResultRequest := &SendPaymentResultRequest{} 19 | alipayRequest := request.NewAlipayRequest(sendPaymentResultRequest, model.RISK_SEND_PAYMENT_RESULT_PATH, &responseRisk.SendPaymentResultResponse{}) 20 | return alipayRequest, sendPaymentResultRequest 21 | } 22 | -------------------------------------------------------------------------------- /com/alipay/api/request/risk/SendRefundResultRequest.go: -------------------------------------------------------------------------------- 1 | package risk 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseRisk "github.com/alipay/global-open-sdk-go/com/alipay/api/response/risk" 7 | ) 8 | 9 | type SendRefundResultRequest struct { 10 | ReferenceTransactionId string `json:"referenceTransactionId,omitempty"` 11 | ReferenceRefundId string `json:"referenceRefundId,omitempty"` 12 | ActualRefundAmount *model.Amount `json:"actualRefundAmount,omitempty"` 13 | RefundRecords []*model.RefundRecord `json:"refundRecords,omitempty"` 14 | } 15 | 16 | func NewSendRefundResultRequest() (*request.AlipayRequest, *SendRefundResultRequest) { 17 | sendRefundResultRequest := &SendRefundResultRequest{} 18 | alipayRequest := request.NewAlipayRequest(sendRefundResultRequest, model.RISK_SEND_REFUND_RESULT_PATH, &responseRisk.SendRefundResultResponse{}) 19 | return alipayRequest, sendRefundResultRequest 20 | } 21 | -------------------------------------------------------------------------------- /com/alipay/api/request/subscription/AlipaySubscriptionCancelRequest.go: -------------------------------------------------------------------------------- 1 | package subscription 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseSubscription "github.com/alipay/global-open-sdk-go/com/alipay/api/response/subscription" 7 | ) 8 | 9 | type AlipaySubscriptionCancelRequest struct { 10 | SubscriptionId string `json:"subscriptionId,omitempty"` 11 | SubscriptionRequestId string `json:"subscriptionRequestId,omitempty"` 12 | CancellationType model.CancellationType `json:"cancellationType,omitempty"` 13 | } 14 | 15 | func (alipaySubscriptionCancelRequest *AlipaySubscriptionCancelRequest) NewRequest() *request.AlipayRequest { 16 | return request.NewAlipayRequest(&alipaySubscriptionCancelRequest, model.SUBSCRIPTION_CANCEL_PATH, &responseSubscription.AlipaySubscriptionCancelResponse{}) 17 | } 18 | 19 | func NewAlipaySubscriptionCancelRequest() (*request.AlipayRequest, *AlipaySubscriptionCancelRequest) { 20 | alipaySubscriptionCancelRequest := &AlipaySubscriptionCancelRequest{} 21 | alipayRequest := request.NewAlipayRequest(alipaySubscriptionCancelRequest, model.SUBSCRIPTION_CANCEL_PATH, &responseSubscription.AlipaySubscriptionCancelResponse{}) 22 | return alipayRequest, alipaySubscriptionCancelRequest 23 | } 24 | -------------------------------------------------------------------------------- /com/alipay/api/request/subscription/AlipaySubscriptionChangeRequest.go: -------------------------------------------------------------------------------- 1 | package subscription 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseSubscription "github.com/alipay/global-open-sdk-go/com/alipay/api/response/subscription" 7 | ) 8 | 9 | type AlipaySubscriptionChangeRequest struct { 10 | SubscriptionChangeRequestId string `json:"subscriptionChangeRequestId,omitempty"` 11 | SubscriptionId string `json:"subscriptionId,omitempty"` 12 | SubscriptionDescription string `json:"subscriptionDescription,omitempty"` 13 | SubscriptionStartTime string `json:"subscriptionStartTime,omitempty"` 14 | SubscriptionEndTime string `json:"subscriptionEndTime,omitempty"` 15 | PeriodRule *model.PeriodRule `json:"periodRule,omitempty"` 16 | SubscriptionExpiryTime string `json:"subscriptionExpiryTime,omitempty"` 17 | OrderInfo *model.OrderInfo `json:"orderInfo,omitempty"` 18 | PaymentAmount *model.Amount `json:"paymentAmount,omitempty"` 19 | PaymentAmountDifference *model.Amount `json:"paymentAmountDifference,omitempty"` 20 | } 21 | 22 | func (alipaySubscriptionChangeRequest *AlipaySubscriptionChangeRequest) NewRequest() *request.AlipayRequest { 23 | return request.NewAlipayRequest(&alipaySubscriptionChangeRequest, model.SUBSCRIPTION_CHANGE_PATH, &responseSubscription.AlipaySubscriptionChangeResponse{}) 24 | } 25 | 26 | func NewAlipaySubscriptionChangeRequest() (*request.AlipayRequest, *AlipaySubscriptionChangeRequest) { 27 | alipaySubscriptionChangeRequest := &AlipaySubscriptionChangeRequest{} 28 | alipayRequest := request.NewAlipayRequest(alipaySubscriptionChangeRequest, model.SUBSCRIPTION_CHANGE_PATH, &responseSubscription.AlipaySubscriptionChangeResponse{}) 29 | return alipayRequest, alipaySubscriptionChangeRequest 30 | } 31 | -------------------------------------------------------------------------------- /com/alipay/api/request/subscription/AlipaySubscriptionCreateRequest.go: -------------------------------------------------------------------------------- 1 | package subscription 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseSubscription "github.com/alipay/global-open-sdk-go/com/alipay/api/response/subscription" 7 | ) 8 | 9 | type AlipaySubscriptionCreateRequest struct { 10 | SubscriptionRequestId string `json:"subscriptionRequestId,omitempty"` 11 | SubscriptionDescription string `json:"subscriptionDescription,omitempty"` 12 | SubscriptionRedirectUrl string `json:"subscriptionRedirectUrl,omitempty"` 13 | SubscriptionStartTime string `json:"subscriptionStartTime,omitempty"` 14 | SubscriptionEndTime string `json:"subscriptionEndTime,omitempty"` 15 | PeriodRule *model.PeriodRule `json:"periodRule,omitempty"` 16 | SubscriptionExpiryTime string `json:"subscriptionExpiryTime,omitempty"` 17 | PaymentMethod *model.PaymentMethod `json:"paymentMethod,omitempty"` 18 | SubscriptionNotificationUrl string `json:"subscriptionNotificationUrl,omitempty"` 19 | PaymentNotificationUrl string `json:"paymentNotificationUrl,omitempty"` 20 | OrderInfo *model.OrderInfo `json:"orderInfo,omitempty"` 21 | PaymentAmount *model.Amount `json:"paymentAmount,omitempty"` 22 | SettlementStrategy *model.SettlementStrategy `json:"settlementStrategy,omitempty"` 23 | Env *model.Env `json:"env,omitempty"` 24 | Trials []*model.Trial `json:"trials,omitempty"` 25 | } 26 | 27 | func (alipaySubscriptionCreateRequest *AlipaySubscriptionCreateRequest) NewRequest() *request.AlipayRequest { 28 | return request.NewAlipayRequest(&alipaySubscriptionCreateRequest, model.SUBSCRIPTION_CREATE_PATH, &responseSubscription.AlipaySubscriptionCreateResponse{}) 29 | } 30 | 31 | func NewAlipaySubscriptionCreateRequest() (*request.AlipayRequest, *AlipaySubscriptionCreateRequest) { 32 | alipaySubscriptionCreateRequest := &AlipaySubscriptionCreateRequest{} 33 | alipayRequest := request.NewAlipayRequest(alipaySubscriptionCreateRequest, model.SUBSCRIPTION_CREATE_PATH, &responseSubscription.AlipaySubscriptionCreateResponse{}) 34 | return alipayRequest, alipaySubscriptionCreateRequest 35 | } 36 | -------------------------------------------------------------------------------- /com/alipay/api/request/subscription/AlipaySubscriptionUpdateRequest.go: -------------------------------------------------------------------------------- 1 | package subscription 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseSubscription "github.com/alipay/global-open-sdk-go/com/alipay/api/response/subscription" 7 | ) 8 | 9 | type AlipaySubscriptionUpdateRequest struct { 10 | SubscriptionUpdateRequestId string `json:"subscriptionUpdateRequestId,omitempty"` 11 | SubscriptionId string `json:"subscriptionId,omitempty"` 12 | SubscriptionDescription string `json:"subscriptionDescription,omitempty"` 13 | PeriodRule *model.PeriodRule `json:"periodRule,omitempty"` 14 | PaymentAmount *model.Amount `json:"paymentAmount,omitempty"` 15 | SubscriptionEndTime string `json:"subscriptionEndTime,omitempty"` 16 | OrderInfo *model.OrderInfo `json:"orderInfo,omitempty"` 17 | } 18 | 19 | func (alipaySubscriptionUpdateRequest *AlipaySubscriptionUpdateRequest) NewRequest() *request.AlipayRequest { 20 | return request.NewAlipayRequest(&alipaySubscriptionUpdateRequest, model.SUBSCRIPTION_UPDATE_PATH, &responseSubscription.AlipaySubscriptionUpdateResponse{}) 21 | } 22 | -------------------------------------------------------------------------------- /com/alipay/api/request/vaulting/AlipayVaultingPaymentMethodRequest.go: -------------------------------------------------------------------------------- 1 | package vaulting 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseVaulting "github.com/alipay/global-open-sdk-go/com/alipay/api/response/vaulting" 7 | ) 8 | 9 | type AlipayVaultingPaymentMethodRequest struct { 10 | VaultingRequestId string `json:"vaultingRequestId,omitempty"` 11 | VaultingNotificationUrl string `json:"vaultingNotificationUrl,omitempty"` 12 | RedirectUrl string `json:"redirectUrl,omitempty"` 13 | MerchantRegion string `json:"merchantRegion,omitempty"` 14 | PaymentMethodDetail *model.PaymentMethodDetail `json:"paymentMethodDetail,omitempty"` 15 | Env *model.Env `json:"env,omitempty"` 16 | } 17 | 18 | func NewAlipayVaultingPaymentMethodRequest() (*request.AlipayRequest, *AlipayVaultingPaymentMethodRequest) { 19 | alipayVaultingPaymentMethodRequest := &AlipayVaultingPaymentMethodRequest{} 20 | alipayRequest := request.NewAlipayRequest(alipayVaultingPaymentMethodRequest, model.VAULT_PAYMENT_METHOD_PATH, &responseVaulting.AlipayVaultingPaymentMethodResponse{}) 21 | return alipayRequest, alipayVaultingPaymentMethodRequest 22 | } 23 | -------------------------------------------------------------------------------- /com/alipay/api/request/vaulting/AlipayVaultingQueryRequest.go: -------------------------------------------------------------------------------- 1 | package vaulting 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseVaulting "github.com/alipay/global-open-sdk-go/com/alipay/api/response/vaulting" 7 | ) 8 | 9 | type AlipayVaultingQueryRequest struct { 10 | VaultingRequestId string `json:"vaultingRequestId,omitempty"` 11 | } 12 | 13 | func NewAlipayVaultingQueryRequest() (*request.AlipayRequest, *AlipayVaultingQueryRequest) { 14 | alipayVaultingPaymentMethodRequest := &AlipayVaultingQueryRequest{} 15 | alipayRequest := request.NewAlipayRequest(alipayVaultingPaymentMethodRequest, model.INQUIRE_VAULTING_PATH, &responseVaulting.AlipayVaultingQueryResponse{}) 16 | return alipayRequest, alipayVaultingPaymentMethodRequest 17 | } 18 | -------------------------------------------------------------------------------- /com/alipay/api/request/vaulting/AlipayVaultingSessionRequest.go: -------------------------------------------------------------------------------- 1 | package vaulting 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request" 6 | responseVaulting "github.com/alipay/global-open-sdk-go/com/alipay/api/response/vaulting" 7 | ) 8 | 9 | type AlipayVaultingSessionRequest struct { 10 | PaymentMethodType string `json:"paymentMethodType,omitempty"` 11 | VaultingRequestId string `json:"vaultingRequestId,omitempty"` 12 | VaultingNotificationUrl string `json:"vaultingNotificationUrl,omitempty"` 13 | RedirectUrl string `json:"redirectUrl,omitempty"` 14 | MerchantRegion string `json:"merchantRegion,omitempty"` 15 | Is3DSAuthentication bool `json:"is3DSAuthentication,omitempty"` 16 | } 17 | 18 | func NewAlipayVaultingSessionRequest() (*request.AlipayRequest, *AlipayVaultingSessionRequest) { 19 | alipayVaultingSessionRequest := &AlipayVaultingSessionRequest{} 20 | alipayRequest := request.NewAlipayRequest(alipayVaultingSessionRequest, model.CREATE_VAULTING_SESSION_PATH, &responseVaulting.AlipayVaultingSessionResponse{}) 21 | return alipayRequest, alipayVaultingSessionRequest 22 | } 23 | -------------------------------------------------------------------------------- /com/alipay/api/response/AlipayResponse.go: -------------------------------------------------------------------------------- 1 | package response 2 | 3 | type Result struct { 4 | ResultCode string `json:"resultCode"` 5 | ResultStatus string `json:"resultStatus"` 6 | ResultMessage string `json:"resultMessage"` 7 | } 8 | 9 | type AlipayResponse struct { 10 | Result Result `json:"result"` 11 | } 12 | -------------------------------------------------------------------------------- /com/alipay/api/response/auth/AlipayAuthApplyTokenResponse.go: -------------------------------------------------------------------------------- 1 | package responseAuth 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 6 | ) 7 | 8 | type AlipayAuthApplyTokenResponse struct { 9 | response.AlipayResponse 10 | AccessToken string `json:"accessToken"` 11 | AccessTokenExpiryTime string `json:"accessTokenExpiryTime"` 12 | RefreshToken string `json:"refreshToken"` 13 | RefreshTokenExpiryTime string `json:"refreshTokenExpiryTime"` 14 | ExtendInfo string `json:"extendInfo"` 15 | UserLoginId string `json:"userLoginId"` 16 | PspCustomerInfo model.PspCustomerInfo `json:"pspCustomerInfo"` 17 | GrantType string `json:"grant_type"` 18 | } 19 | -------------------------------------------------------------------------------- /com/alipay/api/response/auth/AlipayAuthConsultResponse.go: -------------------------------------------------------------------------------- 1 | package responseAuth 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 6 | ) 7 | 8 | type AlipayAuthConsultResponse struct { 9 | response.AlipayResponse 10 | AuthUrl string `json:"authUrl"` 11 | ExtendInfo string `json:"extendInfo"` 12 | NormalUrl string `json:"normalUrl"` 13 | SchemeUrl string `json:"schemeUrl"` 14 | ApplinkUrl string `json:"applinkUrl"` 15 | AppIdentifier string `json:"appIdentifier"` 16 | AuthCodeForm model.AuthCodeForm `json:"authCodeForm"` 17 | GrantType string `json:"grant_type"` 18 | } 19 | -------------------------------------------------------------------------------- /com/alipay/api/response/auth/AlipayAuthCreateSessionResponse.go: -------------------------------------------------------------------------------- 1 | package responseAuth 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 4 | 5 | type AlipayAuthCreateSessionResponse struct { 6 | response.AlipayResponse 7 | PaymentSessionId string `json:"paymentSessionId,omitempty"` 8 | PaymentSessionData string `json:"paymentSessionData,omitempty"` 9 | PaymentSessionExpiryTime string `json:"paymentSessionExpiryTime,omitempty"` 10 | } 11 | -------------------------------------------------------------------------------- /com/alipay/api/response/auth/AlipayAuthQueryTokenResponse.go: -------------------------------------------------------------------------------- 1 | package responseAuth 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 4 | 5 | type AlipayAuthQueryTokenResponse struct { 6 | response.AlipayResponse 7 | AccessToken string `json:"accessToken"` 8 | AccessTokenExpiryTime string `json:"accessTokenExpiryTime"` 9 | RefreshToken string `json:"refreshToken"` 10 | RefreshTokenExpiryTime string `json:"refreshTokenExpiryTime"` 11 | TokenStatusType string `json:"tokenStatusType"` 12 | } 13 | -------------------------------------------------------------------------------- /com/alipay/api/response/auth/AlipayAuthRevokeTokenResponse.go: -------------------------------------------------------------------------------- 1 | package responseAuth 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 4 | 5 | type AlipayAuthRevokeTokenResponse struct { 6 | response.AlipayResponse 7 | ExtendInfo string `json:"extendInfo"` 8 | } 9 | -------------------------------------------------------------------------------- /com/alipay/api/response/customs/AlipayCustomsDeclareResponse.go: -------------------------------------------------------------------------------- 1 | package responseCustoms 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 6 | ) 7 | 8 | type AlipayCustomsDeclareResponse struct { 9 | response.AlipayResponse 10 | CustomsPaymentId string `json:"customsPaymentId"` 11 | CustomsOrderId string `json:"customsOrderId"` 12 | IdentityCheckResult model.IdentityCheckResult `json:"identityCheckResult"` 13 | ClearingChannel model.ClearingChannel `json:"clearingChannel"` 14 | ClearingTransactionId string `json:"clearingTransactionId"` 15 | CustomsProviderRegistrationId string `json:"customsProviderRegistrationId"` 16 | } 17 | -------------------------------------------------------------------------------- /com/alipay/api/response/customs/AlipayCustomsQueryResponse.go: -------------------------------------------------------------------------------- 1 | package responseCustoms 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 6 | ) 7 | 8 | type AlipayCustomsQueryResponse struct { 9 | response.AlipayResponse 10 | DeclarationRequestsNotFound []string `json:"declarationRequestsNotFound"` 11 | DeclarationRecords []model.DeclarationRecord `json:"declarationRecords"` 12 | } 13 | -------------------------------------------------------------------------------- /com/alipay/api/response/dispute/AlipayAcceptDisputeResponse.go: -------------------------------------------------------------------------------- 1 | package responseDispute 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 4 | 5 | type AlipayAcceptDisputeResponse struct { 6 | response.AlipayResponse 7 | DisputeId string `json:"disputeId,omitempty"` 8 | DisputeResolutionTime string `json:"disputeResolutionTime,omitempty"` 9 | } 10 | -------------------------------------------------------------------------------- /com/alipay/api/response/dispute/AlipayDownloadDisputeEvidenceResponse.go: -------------------------------------------------------------------------------- 1 | package responseDispute 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 6 | ) 7 | 8 | type AlipayDownloadDisputeEvidenceResponse struct { 9 | response.AlipayResponse 10 | DisputeEvidence string `json:"disputeEvidence,omitempty"` 11 | DisputeEvidenceFormat model.DisputeEvidenceFormatType `json:"disputeEvidenceFormat,omitempty"` 12 | } 13 | -------------------------------------------------------------------------------- /com/alipay/api/response/dispute/AlipaySupplyDefenseDocumentResponse.go: -------------------------------------------------------------------------------- 1 | package responseDispute 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 4 | 5 | type AlipaySupplyDefenseDocumentResponse struct { 6 | response.AlipayResponse 7 | DisputeId string `json:"disputeId,omitempty"` 8 | DisputeResolutionTime string `json:"disputeResolutionTime,omitempty"` 9 | } 10 | -------------------------------------------------------------------------------- /com/alipay/api/response/marketplace/AlipayCreatePayoutResponse.go: -------------------------------------------------------------------------------- 1 | package responseMarketplace 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 6 | ) 7 | 8 | type AlipayCreatePayoutResponse struct { 9 | response.AlipayResponse 10 | TransferId string `json:"transferId,omitempty"` 11 | TransferRequestId string `json:"transferRequestId,omitempty"` 12 | TransferFromDetail *model.TransferFromDetail `json:"transferFromDetail,omitempty"` 13 | TransferToDetail *model.TransferToDetail `json:"transferToDetail,omitempty"` 14 | } 15 | -------------------------------------------------------------------------------- /com/alipay/api/response/marketplace/AlipayCreateTransferResponse.go: -------------------------------------------------------------------------------- 1 | package responseMarketplace 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 6 | ) 7 | 8 | type AlipayCreateTransferResponse struct { 9 | response.AlipayResponse 10 | TransferId string `json:"transferId,omitempty"` 11 | TransferRequestId string `json:"transferRequestId,omitempty"` 12 | TransferFromDetail *model.TransferFromDetail `json:"transferFromDetail,omitempty"` 13 | TransferToDetail *model.TransferToDetail `json:"transferToDetail,omitempty"` 14 | } 15 | -------------------------------------------------------------------------------- /com/alipay/api/response/marketplace/AlipayInquireBalanceResponse.go: -------------------------------------------------------------------------------- 1 | package responseMarketplace 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 6 | ) 7 | 8 | type AlipayInquireBalanceResponse struct { 9 | response.AlipayResponse 10 | AccountBalances []*model.AccountBalance `json:"accountBalances,omitempty"` 11 | } 12 | -------------------------------------------------------------------------------- /com/alipay/api/response/marketplace/AlipayRegisterResponse.go: -------------------------------------------------------------------------------- 1 | package responseMarketplace 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 4 | 5 | type AlipayRegisterResponse struct { 6 | response.AlipayResponse 7 | RegistrationStatus string `json:"registrationStatus,omitempty"` 8 | } 9 | -------------------------------------------------------------------------------- /com/alipay/api/response/marketplace/AlipaySettleResponse.go: -------------------------------------------------------------------------------- 1 | package responseMarketplace 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 4 | 5 | type AlipaySettleResponse struct { 6 | response.AlipayResponse 7 | SettlementRequestId string `json:"settlementRequestId,omitempty"` 8 | SettlementId string `json:"settlementId,omitempty"` 9 | } 10 | -------------------------------------------------------------------------------- /com/alipay/api/response/marketplace/AlipaySettlementInfoUpdateResponse.go: -------------------------------------------------------------------------------- 1 | package responseMarketplace 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 4 | 5 | type AlipaySettlementInfoUpdateResponse struct { 6 | response.AlipayResponse 7 | UpdateStatus string `json:"updateStatus,omitempty"` 8 | } 9 | -------------------------------------------------------------------------------- /com/alipay/api/response/marketplace/AlipaySubmitAttachmentResponse.go: -------------------------------------------------------------------------------- 1 | package responseMarketplace 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 6 | ) 7 | 8 | type AlipaySubmitAttachmentResponse struct { 9 | response.AlipayResponse 10 | SubmitAttachmentRequestId string `json:"submitAttachmentRequestId,omitempty"` 11 | AttachmentType model.AttachmentType `json:"attachmentType,omitempty"` 12 | AttachmentKey string `json:"attachmentKey,omitempty"` 13 | } 14 | -------------------------------------------------------------------------------- /com/alipay/api/response/pay/AlipayCaptureResponse.go: -------------------------------------------------------------------------------- 1 | package responsePay 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 6 | ) 7 | 8 | type AlipayCaptureResponse struct { 9 | response.AlipayResponse 10 | CaptureRequestId string `json:"captureRequestId"` 11 | CaptureId string `json:"captureId"` 12 | PaymentId string `json:"paymentId"` 13 | CaptureAmount model.Amount `json:"captureAmount"` 14 | CaptureTime string `json:"captureTime"` 15 | AcquirerReferenceNo string `json:"acquirerReferenceNo"` 16 | } 17 | -------------------------------------------------------------------------------- /com/alipay/api/response/pay/AlipayDeviceCertificateResponse.go: -------------------------------------------------------------------------------- 1 | package responsePay 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 4 | 5 | type AlipayDeviceCertificateResponse struct { 6 | response.AlipayResponse 7 | DeviceCertificate string `json:"deviceCertificate,omitempty"` 8 | } 9 | -------------------------------------------------------------------------------- /com/alipay/api/response/pay/AlipayInquiryRefundResponse.go: -------------------------------------------------------------------------------- 1 | package responsePay 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 6 | ) 7 | 8 | type AlipayInquiryRefundResponse struct { 9 | response.AlipayResponse 10 | RefundId string `json:"refundId"` 11 | RefundRequestId string `json:"refundRequestId"` 12 | RefundAmount model.Amount `json:"refundAmount"` 13 | RefundStatus model.TransactionStatusType `json:"refundStatus"` 14 | RefundTime string `json:"refundTime"` 15 | GrossSettlementAmount model.Amount `json:"grossSettlementAmount"` 16 | SettlementQuote model.Quote `json:"settlementQuote"` 17 | AcquirerInfo model.AcquirerInfo `json:"acquirerInfo"` 18 | } 19 | -------------------------------------------------------------------------------- /com/alipay/api/response/pay/AlipayPayCancelResponse.go: -------------------------------------------------------------------------------- 1 | package responsePay 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 4 | 5 | type AlipayPayCancelResponse struct { 6 | response.AlipayResponse 7 | PaymentId string `json:"paymentId"` 8 | PaymentRequestId string `json:"paymentRequestId"` 9 | CancelTime string `json:"cancelTime"` 10 | } 11 | -------------------------------------------------------------------------------- /com/alipay/api/response/pay/AlipayPayConsultResponse.go: -------------------------------------------------------------------------------- 1 | package responsePay 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 6 | ) 7 | 8 | type AlipayPayConsultResponse struct { 9 | response.AlipayResponse 10 | PaymentOptions []model.PaymentOption `json:"paymentOptions"` 11 | PaymentMethodInfos []model.PaymentMethodInfo `json:"paymentMethodInfos"` 12 | ExtendInfo string `json:"extendInfo"` 13 | } 14 | -------------------------------------------------------------------------------- /com/alipay/api/response/pay/AlipayPayQueryResponse.go: -------------------------------------------------------------------------------- 1 | package responsePay 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 6 | "time" 7 | ) 8 | 9 | type AlipayPayQueryResponse struct { 10 | response.AlipayResponse 11 | PaymentStatus model.TransactionStatusType `json:"paymentStatus"` 12 | PaymentResultCode string `json:"paymentResultCode"` 13 | PaymentResultMessage string `json:"paymentResultMessage"` 14 | PaymentRequestId string `json:"paymentRequestId"` 15 | PaymentId string `json:"paymentId"` 16 | AuthPaymentId string `json:"authPaymentId"` 17 | PaymentAmount model.Amount `json:"paymentAmount"` 18 | ActualPaymentAmount model.Amount `json:"actualPaymentAmount"` 19 | PaymentQuote model.Quote `json:"paymentQuote"` 20 | AuthExpiryTime string `json:"authExpiryTime"` 21 | PaymentCreateTime time.Time `json:"paymentCreateTime"` 22 | PaymentTime time.Time `json:"paymentTime"` 23 | NonGuaranteeCouponAmount model.Amount `json:"nonGuaranteeCouponAmount"` 24 | PspCustomerInfo model.PspCustomerInfo `json:"pspCustomerInfo"` 25 | RedirectActionForm model.RedirectActionForm `json:"redirectActionForm"` 26 | CardInfo model.CardInfo `json:"cardInfo"` 27 | AcquirerReferenceNo string `json:"acquirerReferenceNo"` 28 | ExtendInfo string `json:"extendInfo"` 29 | Transactions []model.Transaction `json:"transactions"` 30 | CustomsDeclarationAmount model.Amount `json:"customsDeclarationAmount"` 31 | GrossSettlementAmount model.Amount `json:"grossSettlementAmount"` 32 | SettlementQuote model.Quote `json:"settlementQuote"` 33 | PaymentResultInfo model.PaymentResultInfo `json:"paymentResultInfo"` 34 | AcquirerInfo model.AcquirerInfo `json:"acquirerInfo"` 35 | MerchantAccountId string `json:"merchantAccountId"` 36 | PromotionResults []model.PromotionResult `json:"promotionResult"` 37 | EarliestSettlementTime string `json:"earliestSettlementTime"` 38 | PaymentMethodType string `json:"paymentMethodType,omitempty"` 39 | } 40 | -------------------------------------------------------------------------------- /com/alipay/api/response/pay/AlipayPayResponse.go: -------------------------------------------------------------------------------- 1 | package responsePay 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 6 | ) 7 | 8 | type AlipayPayResponse struct { 9 | response.AlipayResponse 10 | PaymentRequestId string `json:"paymentRequestId"` 11 | PaymentId string `json:"paymentId"` 12 | PaymentAmount model.Amount `json:"paymentAmount"` 13 | PaymentData string `json:"paymentData"` 14 | ActualPaymentAmount model.Amount `json:"actualPaymentAmount"` 15 | PaymentQuote model.Quote `json:"paymentQuote"` 16 | PaymentTime string `json:"paymentTime"` 17 | PaymentCreateTime string `json:"paymentCreateTime"` 18 | AuthExpiryTime string `json:"authExpiryTime"` 19 | NonGuaranteeCouponValue model.Amount `json:"nonGuaranteeCouponValue"` 20 | PaymentActionForm string `json:"paymentActionForm"` 21 | PspCustomerInfo model.PspCustomerInfo `json:"pspCustomerInfo"` 22 | ChallengeActionForm model.ChallengeActionForm `json:"challengeActionForm"` 23 | RedirectActionForm model.RedirectActionForm `json:"redirectActionForm"` 24 | OrderCodeForm model.OrderCodeForm `json:"orderCodeForm"` 25 | GrossSettlementAmount model.Amount `json:"grossSettlementAmount"` 26 | SettlementQuote model.Quote `json:"settlementQuote"` 27 | ExtendInfo string `json:"extendInfo"` 28 | NormalUrl string `json:"normalUrl"` 29 | SchemeUrl string `json:"schemeUrl"` 30 | ApplinkUrl string `json:"applinkUrl"` 31 | AppIdentifier string `json:"appIdentifier"` 32 | PaymentResultInfo model.PaymentResultInfo `json:"paymentResultInfo"` 33 | AcquirerInfo model.AcquirerInfo `json:"acquirerInfo"` 34 | PromotionResult []model.PromotionResult `json:"promotionResult"` 35 | } 36 | -------------------------------------------------------------------------------- /com/alipay/api/response/pay/AlipayPaymentSessionResponse.go: -------------------------------------------------------------------------------- 1 | package responsePay 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 4 | 5 | type AlipayPaymentSessionResponse struct { 6 | response.AlipayResponse 7 | PaymentSessionData string `json:"paymentSessionData"` 8 | PaymentSessionExpiryTime string `json:"paymentSessionExpiryTime"` 9 | PaymentSessionId string `json:"paymentSessionId"` 10 | NormalUrl string `json:"normalUrl"` 11 | } 12 | -------------------------------------------------------------------------------- /com/alipay/api/response/pay/AlipayRefundResponse.go: -------------------------------------------------------------------------------- 1 | package responsePay 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 6 | ) 7 | 8 | type AlipayRefundResponse struct { 9 | response.AlipayResponse 10 | RefundRequestId string `json:"refundRequestId"` 11 | RefundId string `json:"refundId"` 12 | PaymentId string `json:"paymentId"` 13 | RefundAmount model.Amount `json:"refundAmount"` 14 | RefundTime string `json:"refundTime"` 15 | RefundNonGuaranteeCouponAmount model.Amount `json:"refundNonGuaranteeCouponAmount"` 16 | GrossSettlementAmount model.Amount `json:"grossSettlementAmount"` 17 | SettlementQuote model.Quote `json:"settlementQuote"` 18 | AcquirerInfo model.AcquirerInfo `json:"acquirerInfo"` 19 | AcquirerReferenceNo string `json:"acquirerReferenceNo"` 20 | } 21 | -------------------------------------------------------------------------------- /com/alipay/api/response/pay/AlipaySyncArrearResponse.go: -------------------------------------------------------------------------------- 1 | package responsePay 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 4 | 5 | type AlipaySyncArrearResponse struct { 6 | response.AlipayResponse 7 | } 8 | -------------------------------------------------------------------------------- /com/alipay/api/response/pay/AlipayUploadInvoiceShippingFileResponse.go: -------------------------------------------------------------------------------- 1 | package responsePay 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 4 | 5 | type AlipayUploadInvoiceShippingFileResponse struct { 6 | response.AlipayResponse 7 | } 8 | -------------------------------------------------------------------------------- /com/alipay/api/response/risk/RiskDecideResponse.go: -------------------------------------------------------------------------------- 1 | package responseRisk 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 4 | 5 | type RiskDecideResponse struct { 6 | response.AlipayResponse 7 | Decision string `json:"decision,omitempty"` 8 | AuthenticationDecision string `json:"authenticationDecision,omitempty"` 9 | } 10 | -------------------------------------------------------------------------------- /com/alipay/api/response/risk/RiskReportResponse.go: -------------------------------------------------------------------------------- 1 | package responseRisk 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 4 | 5 | type RiskReportResponse struct { 6 | response.AlipayResponse 7 | } 8 | -------------------------------------------------------------------------------- /com/alipay/api/response/risk/SendPaymentResultResponse.go: -------------------------------------------------------------------------------- 1 | package responseRisk 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 4 | 5 | type SendPaymentResultResponse struct { 6 | response.AlipayResponse 7 | } 8 | -------------------------------------------------------------------------------- /com/alipay/api/response/risk/SendRefundResultResponse.go: -------------------------------------------------------------------------------- 1 | package responseRisk 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 4 | 5 | type SendRefundResultResponse struct { 6 | response.AlipayResponse 7 | } 8 | -------------------------------------------------------------------------------- /com/alipay/api/response/subscription/AlipaySubscriptionCancelResponse.go: -------------------------------------------------------------------------------- 1 | package responseSubscription 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 4 | 5 | type AlipaySubscriptionCancelResponse struct { 6 | response.AlipayResponse 7 | } 8 | -------------------------------------------------------------------------------- /com/alipay/api/response/subscription/AlipaySubscriptionChangeResponse.go: -------------------------------------------------------------------------------- 1 | package responseSubscription 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 4 | 5 | type AlipaySubscriptionChangeResponse struct { 6 | response.AlipayResponse 7 | } 8 | -------------------------------------------------------------------------------- /com/alipay/api/response/subscription/AlipaySubscriptionCreateResponse.go: -------------------------------------------------------------------------------- 1 | package responseSubscription 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 4 | 5 | type AlipaySubscriptionCreateResponse struct { 6 | response.AlipayResponse 7 | SchemeUrl string `json:"schemeUrl"` 8 | ApplinkUrl string `json:"applinkUrl"` 9 | NormalUrl string `json:"normalUrl"` 10 | AppIdentifier string `json:"appIdentifier"` 11 | } 12 | -------------------------------------------------------------------------------- /com/alipay/api/response/subscription/AlipaySubscriptionUpdateResponse.go: -------------------------------------------------------------------------------- 1 | package responseSubscription 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 4 | 5 | type AlipaySubscriptionUpdateResponse struct { 6 | response.AlipayResponse 7 | } 8 | -------------------------------------------------------------------------------- /com/alipay/api/response/vaulting/AlipayVaultingPaymentMethodResponse.go: -------------------------------------------------------------------------------- 1 | package responseVaulting 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 6 | ) 7 | 8 | type AlipayVaultingPaymentMethodResponse struct { 9 | response.AlipayResponse 10 | VaultingRequestId string `json:"vaultingRequestId,omitempty"` 11 | PaymentMethodDetail *model.PaymentMethodDetail `json:"paymentMethodDetail,omitempty"` 12 | NormalUrl string `json:"normalUrl,omitempty"` 13 | SchemeUrl string `json:"schemeUrl,omitempty"` 14 | ApplinkUrl string `json:"applinkUrl,omitempty"` 15 | } 16 | -------------------------------------------------------------------------------- /com/alipay/api/response/vaulting/AlipayVaultingQueryResponse.go: -------------------------------------------------------------------------------- 1 | package responseVaulting 2 | 3 | import ( 4 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 6 | ) 7 | 8 | type AlipayVaultingQueryResponse struct { 9 | response.AlipayResponse 10 | VaultingRequestId string `json:"vaultingRequestId,omitempty"` 11 | NormalUrl string `json:"normalUrl,omitempty"` 12 | SchemeUrl string `json:"schemeUrl,omitempty"` 13 | ApplinkUrl string `json:"applinkUrl,omitempty"` 14 | VaultingStatus string `json:"vaultingStatus,omitempty"` 15 | PaymentMethodDetail *model.PaymentMethodDetail `json:"paymentMethodDetail,omitempty"` 16 | } 17 | -------------------------------------------------------------------------------- /com/alipay/api/response/vaulting/AlipayVaultingSessionResponse.go: -------------------------------------------------------------------------------- 1 | package responseVaulting 2 | 3 | import "github.com/alipay/global-open-sdk-go/com/alipay/api/response" 4 | 5 | type AlipayVaultingSessionResponse struct { 6 | response.AlipayResponse 7 | VaultingSessionData string `json:"vaultingSessionData,omitempty"` 8 | VaultingSessionId string `json:"vaultingSessionId,omitempty"` 9 | VaultingSessionExpiryTime string `json:"vaultingSessionExpiryTime,omitempty"` 10 | } 11 | -------------------------------------------------------------------------------- /com/alipay/api/tools/SignatureTool.go: -------------------------------------------------------------------------------- 1 | package tools 2 | 3 | import ( 4 | "crypto" 5 | "crypto/rand" 6 | "crypto/rsa" 7 | "crypto/sha256" 8 | "crypto/x509" 9 | "encoding/base64" 10 | "encoding/pem" 11 | "errors" 12 | "github.com/alipay/global-open-sdk-go/com/alipay/api/exception" 13 | "net/url" 14 | ) 15 | 16 | func GenSign(httpMethod string, path string, clientId string, reqTime string, reqBody string, merchantPrivateKey string) (string, error) { 17 | block, _ := pem.Decode([]byte(getPkcsKey(merchantPrivateKey))) 18 | if block == nil { 19 | return "", &exception.AlipayLibraryError{Message: "Failed to decode private key"} 20 | } 21 | privateKey, err := x509.ParsePKCS8PrivateKey(block.Bytes) 22 | if err != nil { 23 | return "", &exception.AlipayLibraryError{Message: "Failed to parse private key " + err.Error()} 24 | } 25 | payload := genSignContent(httpMethod, path, clientId, reqTime, reqBody) 26 | signature, err := Sign(privateKey.(*rsa.PrivateKey), []byte(payload)) 27 | if err != nil { 28 | return "", &exception.AlipayLibraryError{Message: "Failed to sign data " + err.Error()} 29 | } 30 | 31 | return signature, nil 32 | 33 | } 34 | 35 | func Sign(privateKey *rsa.PrivateKey, data []byte) (string, error) { 36 | // 计算数据的SHA256哈希 37 | hashed := sha256.Sum256(data) 38 | 39 | // 使用私钥签名哈希值 40 | signature, err := rsa.SignPKCS1v15(rand.Reader, privateKey, crypto.Hash.HashFunc(crypto.SHA256), hashed[:]) 41 | if err != nil { 42 | return "", err 43 | } 44 | //base64编码 如果signature直接传string会造成乱码 45 | base64Signature := base64.StdEncoding.EncodeToString(signature) 46 | return Encode(base64Signature) 47 | } 48 | 49 | func Verify(httpMethod string, path string, clientId string, rspTimeStr string, rspBody string, signature string, alipayPublicKey string) (bool, error) { 50 | rspContent := genSignContent(httpMethod, path, clientId, rspTimeStr, rspBody) 51 | return verifySignatureWithSHA256RSA(rspContent, Decode(signature), alipayPublicKey) 52 | } 53 | 54 | func verifySignatureWithSHA256RSA(rspContent string, signature string, strPk string) (bool, error) { 55 | publicKey, err := getPublicKeyFromBase64String(strPk) 56 | if err != nil { 57 | return false, err 58 | } 59 | 60 | hash := sha256.New() 61 | hash.Write([]byte(rspContent)) 62 | digest := hash.Sum(nil) 63 | 64 | signatureBytes, err := base64.StdEncoding.DecodeString(signature) 65 | if err != nil { 66 | return false, err 67 | } 68 | 69 | err = rsa.VerifyPKCS1v15(publicKey, crypto.SHA256, digest, signatureBytes) 70 | if err != nil { 71 | return false, err 72 | } 73 | 74 | return true, nil 75 | } 76 | 77 | func getPublicKeyFromBase64String(publicKeyString string) (*rsa.PublicKey, error) { 78 | keyBytes, err := base64.StdEncoding.DecodeString(publicKeyString) 79 | if err != nil { 80 | return nil, err 81 | } 82 | 83 | pub, err := x509.ParsePKIXPublicKey(keyBytes) 84 | if err != nil { 85 | return nil, err 86 | } 87 | 88 | switch pub := pub.(type) { 89 | case *rsa.PublicKey: 90 | return pub, nil 91 | default: 92 | return nil, errors.New("not an RSA public key") 93 | } 94 | } 95 | 96 | func genSignContent(httpMethod string, path string, clientId string, reqTime string, reqBody string) string { 97 | return httpMethod + " " + path + "\n" + clientId + "." + reqTime + "." + reqBody 98 | } 99 | 100 | func Encode(signature string) (string, error) { 101 | return url.QueryEscape(signature), nil 102 | } 103 | 104 | func Decode(originalStr string) string { 105 | unescape, err := url.QueryUnescape(originalStr) 106 | if err != nil { 107 | return "" 108 | } 109 | return unescape 110 | } 111 | 112 | func getPkcsKey(key string) string { 113 | return "-----BEGIN PRIVATE KEY-----\n" + key + "\n-----END PRIVATE KEY-----" 114 | } 115 | -------------------------------------------------------------------------------- /com/alipay/api/tools/WebhookTool.go: -------------------------------------------------------------------------------- 1 | package tools 2 | 3 | import ( 4 | "errors" 5 | "strings" 6 | ) 7 | 8 | func CheckSignature(requestUri, httpMethod, clientId, requestTime, responseBody, signature, alipayPublicKey string) (bool, error) { 9 | realSignature := "" 10 | 11 | // Check if signature is nil or empty 12 | if signature == "" { 13 | return false, errors.New("empty notify signature") 14 | } 15 | 16 | // Get valid part from raw signature 17 | parts := strings.Split(signature, "signature=") 18 | if len(parts) > 1 { 19 | realSignature = parts[1] 20 | } 21 | 22 | // Verify signature 23 | isValid, _ := Verify(httpMethod, requestUri, clientId, requestTime, responseBody, realSignature, alipayPublicKey) 24 | if !isValid { 25 | return false, errors.New("signature verification failed") 26 | } 27 | 28 | return true, nil 29 | } 30 | -------------------------------------------------------------------------------- /com/alipay/example/auth_demo.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | defaultAlipayClient "github.com/alipay/global-open-sdk-go/com/alipay/api" 6 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 7 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request/auth" 8 | responseAuth "github.com/alipay/global-open-sdk-go/com/alipay/api/response/auth" 9 | "github.com/google/uuid" 10 | ) 11 | 12 | func main() { 13 | const alipayGatewayUrl = "" 14 | const alipayClientId = "" 15 | const alipayMerchantPrivateKey = "" 16 | const alipayAlipayPublicKey = "" 17 | 18 | client := defaultAlipayClient.NewDefaultAlipayClient( 19 | alipayGatewayUrl, 20 | alipayClientId, 21 | alipayMerchantPrivateKey, 22 | alipayAlipayPublicKey) 23 | 24 | authConsult(client) 25 | //applyToken("281001139639787089651362", client) 26 | //revokeToken("28288803001291161724296551000BgIrDiWzU0171000529", client) 27 | } 28 | 29 | func authConsult(client *defaultAlipayClient.DefaultAlipayClient) { 30 | request, authConsultRequest := auth.NewAlipayAuthConsultRequest() 31 | authConsultRequest.AuthRedirectUrl = "https://www.yourRedirectUrl.com" 32 | authConsultRequest.AuthState = uuid.NewString() 33 | authConsultRequest.CustomerBelongsTo = model.ALIPAY_CN 34 | authConsultRequest.OsType = model.ANDROID 35 | authConsultRequest.OsVersion = "1.0.0" 36 | authConsultRequest.Scopes = []model.ScopeType{model.ScopeTypeAgreementPay} 37 | authConsultRequest.TerminalType = model.APP 38 | 39 | execute, err := client.Execute(request) 40 | if err != nil { 41 | print(err.Error()) 42 | return 43 | } 44 | response := execute.(*responseAuth.AlipayAuthConsultResponse) 45 | fmt.Println("result: ", response.AlipayResponse.Result) 46 | fmt.Println("response: ", response) 47 | } 48 | 49 | func applyToken(authCode string, client *defaultAlipayClient.DefaultAlipayClient) { 50 | request, authApplyTokenRequest := auth.NewAlipayAuthApplyTokenRequest() 51 | authApplyTokenRequest.GrantType = model.GrantTypeAUTHORIZATION_CODE 52 | authApplyTokenRequest.CustomerBelongsTo = model.ALIPAY_CN 53 | authApplyTokenRequest.AuthCode = authCode 54 | 55 | execute, err := client.Execute(request) 56 | if err != nil { 57 | print(err.Error()) 58 | return 59 | } 60 | response := execute.(*responseAuth.AlipayAuthApplyTokenResponse) 61 | fmt.Println("result: ", response.AlipayResponse.Result) 62 | fmt.Println("response: ", response) 63 | } 64 | 65 | func revokeToken(accessToken string, client *defaultAlipayClient.DefaultAlipayClient) { 66 | request, authRevokeTokenRequest := auth.NewAlipayAuthRevokeTokenRequest() 67 | authRevokeTokenRequest.AccessToken = accessToken 68 | execute, err := client.Execute(request) 69 | if err != nil { 70 | print(err.Error()) 71 | return 72 | } 73 | response := execute.(*responseAuth.AlipayAuthRevokeTokenResponse) 74 | fmt.Println("result: ", response.AlipayResponse.Result) 75 | fmt.Println("response: ", response) 76 | } 77 | -------------------------------------------------------------------------------- /com/alipay/example/customs_demo.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | defaultAlipayClient "github.com/alipay/global-open-sdk-go/com/alipay/api" 6 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 7 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request/customs" 8 | responseCustoms "github.com/alipay/global-open-sdk-go/com/alipay/api/response/customs" 9 | "github.com/google/uuid" 10 | ) 11 | 12 | func main() { 13 | const alipayGatewayUrl = "" 14 | const alipayClientId = "" 15 | const alipayMerchantPrivateKey = "" 16 | const alipayAlipayPublicKey = "" 17 | 18 | client := defaultAlipayClient.NewDefaultAlipayClient( 19 | alipayGatewayUrl, 20 | alipayClientId, 21 | alipayMerchantPrivateKey, 22 | alipayAlipayPublicKey) 23 | declare("202408221940108001001887E0207467163", client) 24 | //inquiryDeclaration([]string{""}, client) 25 | 26 | } 27 | 28 | func declare(paymentId string, client *defaultAlipayClient.DefaultAlipayClient) { 29 | request, customsDeclareRequest := customs.NewAlipayCustomsDeclareRequest() 30 | customsDeclareRequest.PaymentId = paymentId 31 | customsDeclareRequest.DeclarationRequestId = uuid.NewString() 32 | customsDeclareRequest.DeclarationAmount = &model.Amount{Value: "10000", Currency: "CNY"} 33 | customsDeclareRequest.MerchantCustomsInfo = &model.MerchantCustomsInfo{ 34 | MerchantCustomsName: "merchantCustomsName", 35 | MerchantCustomsCode: "merchantCustomsCode", 36 | } 37 | customsDeclareRequest.SplitOrder = false 38 | customsDeclareRequest.Customs = &model.CustomsInfo{ 39 | Region: "CN", 40 | CustomsCode: "ZHENGZHOU", 41 | } 42 | customsDeclareRequest.BuyerCertificate = &model.Certificate{ 43 | CertificateNo: "certificateNo", 44 | CertificateType: model.CertificateType_ID_CARD, 45 | HolderName: &model.UserName{ 46 | FirstName: "firstName", 47 | LastName: "lastName", 48 | FullName: "fullName", 49 | }, 50 | } 51 | execute, err := client.Execute(request) 52 | if err != nil { 53 | print(err.Error()) 54 | return 55 | } 56 | response := execute.(*responseCustoms.AlipayCustomsDeclareResponse) 57 | fmt.Println("result: ", response.AlipayResponse.Result) 58 | fmt.Println("response: ", response) 59 | 60 | } 61 | 62 | func inquiryDeclaration(declareRequestId []string, client *defaultAlipayClient.DefaultAlipayClient) { 63 | request, customsQueryRequest := customs.NewAlipayCustomsQueryRequest() 64 | customsQueryRequest.DeclarationRequestIds = declareRequestId 65 | execute, err := client.Execute(request) 66 | if err != nil { 67 | print(err.Error()) 68 | return 69 | } 70 | response := execute.(*responseCustoms.AlipayCustomsQueryResponse) 71 | fmt.Println("result: ", response.AlipayResponse.Result) 72 | fmt.Println("response: ", response) 73 | } 74 | -------------------------------------------------------------------------------- /com/alipay/example/dispute.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | defaultAlipayClient "github.com/alipay/global-open-sdk-go/com/alipay/api" 5 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 6 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request/dispute" 7 | responseDispute "github.com/alipay/global-open-sdk-go/com/alipay/api/response/dispute" 8 | ) 9 | 10 | func main() { 11 | const alipayGatewayUrl = "" 12 | const alipayClientId = "" 13 | const alipayMerchantPrivateKey = "" 14 | const alipayAlipayPublicKey = "" 15 | 16 | client := defaultAlipayClient.NewDefaultAlipayClient( 17 | alipayGatewayUrl, 18 | alipayClientId, 19 | alipayMerchantPrivateKey, 20 | alipayAlipayPublicKey) 21 | 22 | acceptDispute(client, "202409141900000000000001J0000009488") 23 | } 24 | 25 | func acceptDispute(client *defaultAlipayClient.DefaultAlipayClient, disputeId string) { 26 | request, acceptDisputeRequest := dispute.NewAlipayAcceptDisputeRequest() 27 | acceptDisputeRequest.DisputeId = disputeId 28 | 29 | response, err := client.Execute(request) 30 | if err != nil { 31 | panic(err) 32 | } 33 | println(response.(*responseDispute.AlipayAcceptDisputeResponse)) 34 | } 35 | 36 | func supplyDefenseDocument(client *defaultAlipayClient.DefaultAlipayClient, disputeId string) { 37 | request, supplyDefenseDocumentRequest := dispute.NewAlipaySupplyDefenseDocumentRequest() 38 | supplyDefenseDocumentRequest.DisputeId = disputeId 39 | supplyDefenseDocumentRequest.DisputeEvidence = "test" 40 | 41 | response, err := client.Execute(request) 42 | if err != nil { 43 | panic(err) 44 | } 45 | println(response.(*responseDispute.AlipaySupplyDefenseDocumentResponse)) 46 | } 47 | 48 | func downloadDisputeEvidence(client *defaultAlipayClient.DefaultAlipayClient, disputeId string) { 49 | request, downloadDisputeEvidenceRequest := dispute.NewAlipayDownloadDisputeEvidenceRequest() 50 | downloadDisputeEvidenceRequest.DisputeId = disputeId 51 | downloadDisputeEvidenceRequest.DisputeEvidenceType = model.DisputeEvidenceType_DISPUTE_EVIDENCE_TEMPLATE 52 | 53 | response, err := client.Execute(request) 54 | if err != nil { 55 | panic(err) 56 | } 57 | println(response.(*responseDispute.AlipayDownloadDisputeEvidenceResponse)) 58 | } 59 | -------------------------------------------------------------------------------- /com/alipay/example/marketplace_demo.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | defaultAlipayClient "github.com/alipay/global-open-sdk-go/com/alipay/api" 7 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 8 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request/marketplace" 9 | responseMarketplace "github.com/alipay/global-open-sdk-go/com/alipay/api/response/marketplace" 10 | "github.com/google/uuid" 11 | ) 12 | 13 | func main() { 14 | const alipayGatewayUrl = "" 15 | const alipayClientId = "" 16 | const alipayMerchantPrivateKey = "" 17 | const alipayAlipayPublicKey = "" 18 | 19 | client := defaultAlipayClient.NewDefaultAlipayClient( 20 | alipayGatewayUrl, 21 | alipayClientId, 22 | alipayMerchantPrivateKey, 23 | alipayAlipayPublicKey) 24 | 25 | register(client) 26 | //update(client, "mid_zhangtianren_ztr_20230807_180716_981") 27 | //queryBalance(client, "mid_zhangtianren_ztr_20230807_180716_981") 28 | } 29 | 30 | func register(client *defaultAlipayClient.DefaultAlipayClient) { 31 | request, registerRequest := marketplace.NewAlipayRegisterRequest() 32 | registerRequest.RegistrationRequestId = uuid.NewString() 33 | registerRequest.SettlementInfos = []*model.SettlementInfo{ 34 | { 35 | SettlementCurrency: "BRL", 36 | SettlementBankAccount: &model.SettlementBankAccount{ 37 | BranchCode: "1231", 38 | RoutingNumber: "12", 39 | BankRegion: "BR", 40 | AccountType: model.AccountType_CHECKING, 41 | AccountHolderTIN: "12345678901", 42 | AccountHolderName: "Timi", 43 | BankAccountNo: "12312412421", 44 | AccountHolderType: model.AccountHolderType_ENTERPRISE, 45 | }, 46 | }, 47 | } 48 | 49 | registerRequest.MerchantInfo = &model.MerchantInfo{ 50 | LoginId: uuid.NewString()[:8] + "wangzunj3ao.wzj@digital-engine.com", 51 | LegalEntityType: model.LegalEntityType_Company, 52 | Company: &model.Company{ 53 | LegalName: "legalName", 54 | RegisteredAddress: &model.Address{ 55 | Region: "BR", 56 | }, 57 | CompanyType: model.CompanyType_LTDA, 58 | OperatingAddress: &model.Address{ 59 | Region: "BR", 60 | Address1: "address1", 61 | }, 62 | Attachments: []*model.Attachment{ 63 | { 64 | AttachmentName: "1.jpg", 65 | FileKey: "test", 66 | AttachmentType: model.AttachmentType_ARTICLES_OF_ASSOCIATION, 67 | }, 68 | { 69 | AttachmentName: "2.jpg", 70 | FileKey: "test", 71 | AttachmentType: model.AttachmentType_ASSOCIATION_ARTICLE, 72 | }, 73 | }, 74 | Certificates: &model.Certificate{ 75 | CertificateNo: "12312412", 76 | CertificateType: model.CertificateType_ENTERPRISE_REGISTRATION, 77 | }, 78 | }, 79 | BusinessInfo: &model.BusinessInfo{ 80 | DoingBusinessAs: "businessName_DBA", 81 | Websites: []*model.WebSite{ 82 | { 83 | Url: "www.global.alipay.com", 84 | }, 85 | }, 86 | }, 87 | ReferenceMerchantId: uuid.NewString(), 88 | EntityAssociations: []*model.EntityAssociations{ 89 | { 90 | Individual: &model.Individual{ 91 | Certificates: &model.Certificate{ 92 | CertificateNo: "123214321", 93 | CertificateType: model.CertificateType_CPF, 94 | }, 95 | Name: &model.UserName{ 96 | FirstName: "firstName", 97 | LastName: "lastName", 98 | MiddleName: "middleName", 99 | FullName: "fullName", 100 | }, 101 | DateOfBirth: "1990-01-01", 102 | }, 103 | LegalEntityType: model.LegalEntityType_INDIVIDUAL, 104 | AssociationType: model.AssociationType_LEGAL_REPRESENTATIVE, 105 | }, 106 | { 107 | Individual: &model.Individual{ 108 | Certificates: &model.Certificate{ 109 | CertificateNo: "123214321", 110 | CertificateType: model.CertificateType_CPF, 111 | FileKeys: []string{"wetrewqratewtewgewgewg"}, 112 | }, 113 | Name: &model.UserName{ 114 | FirstName: "firstName", 115 | LastName: "lastName", 116 | MiddleName: "middleName", 117 | FullName: "fullName", 118 | }, 119 | DateOfBirth: "1990-01-01", 120 | }, 121 | LegalEntityType: model.LegalEntityType_INDIVIDUAL, 122 | AssociationType: model.AssociationType_UBO, 123 | }, 124 | }, 125 | } 126 | 127 | response, err := client.Execute(request) 128 | if err != nil { 129 | fmt.Println(err) 130 | } else { 131 | fmt.Println(response) 132 | } 133 | 134 | } 135 | 136 | func update(client *defaultAlipayClient.DefaultAlipayClient, referenceMerchantId string) { 137 | request, updateRequest := marketplace.NewAlipaySettlementInfoUpdateRequest() 138 | updateRequest.ReferenceMerchantId = referenceMerchantId 139 | updateRequest.UpdateRequestId = uuid.NewString() 140 | updateRequest.SettlementCurrency = "BRL" 141 | updateRequest.SettlementBankAccount = &model.SettlementBankAccount{ 142 | BranchCode: "1231", 143 | RoutingNumber: "12", 144 | BankRegion: "BR", 145 | AccountType: model.AccountType_CHECKING, 146 | AccountHolderTIN: "12345678901", 147 | AccountHolderName: "Timi", 148 | BankAccountNo: "12312412421", 149 | AccountHolderType: model.AccountHolderType_ENTERPRISE, 150 | } 151 | 152 | response, err := client.Execute(request) 153 | if err != nil { 154 | fmt.Println(err) 155 | } else { 156 | fmt.Println(response) 157 | } 158 | } 159 | 160 | func queryBalance(client *defaultAlipayClient.DefaultAlipayClient, referenceMerchantId string) { 161 | request, queryBalanceRequest := marketplace.NewAlipayInquireBalanceRequest() 162 | queryBalanceRequest.ReferenceMerchantId = referenceMerchantId 163 | response, err := client.Execute(request) 164 | if err != nil { 165 | fmt.Println(err) 166 | } else { 167 | indent, _ := json.MarshalIndent(response.(*responseMarketplace.AlipayInquireBalanceResponse), "", " ") 168 | fmt.Println(string(indent)) 169 | } 170 | } 171 | 172 | func settleRequest(client *defaultAlipayClient.DefaultAlipayClient, paymentId string) { 173 | request, settleRequest := marketplace.NewAlipaySettleRequest() 174 | settleRequest.PaymentId = paymentId 175 | settleRequest.SettlementRequestId = uuid.NewString() 176 | settleRequest.SettlementDetails = []*model.SettlementDetail{ 177 | { 178 | SettleTo: model.SettleToType_SELLER, 179 | SettlementAmount: &model.Amount{ 180 | Currency: "BRL", 181 | Value: "90", 182 | }, 183 | }, 184 | { 185 | SettleTo: model.SettleToType_MARKETPLACE, 186 | SettlementAmount: &model.Amount{ 187 | Currency: "BRL", 188 | Value: "10", 189 | }, 190 | }, 191 | } 192 | 193 | response, err := client.Execute(request) 194 | if err != nil { 195 | fmt.Println(err) 196 | } else { 197 | fmt.Println(response) 198 | } 199 | } 200 | 201 | func createPayout(client *defaultAlipayClient.DefaultAlipayClient) { 202 | request, createPayoutRequest := marketplace.NewAlipayCreatePayoutRequest() 203 | createPayoutRequest.TransferRequestId = uuid.NewString() 204 | createPayoutRequest.TransferFromDetail = &model.TransferFromDetail{ 205 | TransferFromMethod: &model.PaymentMethod{ 206 | PaymentMethodId: uuid.NewString(), 207 | PaymentMethodType: model.BALANCE_ACCOUNT, 208 | }, 209 | } 210 | createPayoutRequest.TransferToDetail = &model.TransferToDetail{ 211 | TransferToMethod: &model.PaymentMethod{ 212 | PaymentMethodId: uuid.NewString(), 213 | PaymentMethodType: model.SETTLEMENT_CARD, 214 | }, 215 | TransferToCurrency: "BRL", 216 | PurposeCode: "GSD", 217 | TransferNotifyUrl: "www.global.alipay.com", 218 | } 219 | 220 | response, err := client.Execute(request) 221 | if err != nil { 222 | fmt.Println(err) 223 | } else { 224 | fmt.Println(response) 225 | } 226 | 227 | } 228 | 229 | func createTransfer(client *defaultAlipayClient.DefaultAlipayClient) { 230 | request, createTransferRequest := marketplace.NewAlipayCreateTransferRequest() 231 | createTransferRequest.TransferRequestId = uuid.NewString() 232 | 233 | createTransferRequest.TransferFromDetail = &model.TransferFromDetail{ 234 | TransferFromMethod: &model.PaymentMethod{ 235 | PaymentMethodId: uuid.NewString(), 236 | PaymentMethodType: model.BALANCE_ACCOUNT, 237 | }, 238 | TransferFromAmount: model.NewAmount("100", "BRL"), 239 | } 240 | 241 | createTransferRequest.TransferToDetail = &model.TransferToDetail{ 242 | TransferToMethod: &model.PaymentMethod{ 243 | PaymentMethodId: uuid.NewString(), 244 | PaymentMethodType: model.BALANCE_ACCOUNT, 245 | }, 246 | TransferToCurrency: "BRL", 247 | PurposeCode: "GSD", 248 | TransferNotifyUrl: "www.global.alipay.com", 249 | } 250 | 251 | response, err := client.Execute(request) 252 | if err != nil { 253 | fmt.Println(err) 254 | } else { 255 | fmt.Println(response) 256 | } 257 | } 258 | -------------------------------------------------------------------------------- /com/alipay/example/pay_demo.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | defaultAlipayClient "github.com/alipay/global-open-sdk-go/com/alipay/api" 6 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 7 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request/pay" 8 | responsePay "github.com/alipay/global-open-sdk-go/com/alipay/api/response/pay" 9 | "github.com/google/uuid" 10 | ) 11 | 12 | func main() { 13 | const alipayGatewayUrl = "" 14 | const alipayClientId = "" 15 | const alipayMerchantPrivateKey = "" 16 | const alipayAlipayPublicKey = "" 17 | 18 | client := defaultAlipayClient.NewDefaultAlipayClient( 19 | alipayGatewayUrl, 20 | alipayClientId, 21 | alipayMerchantPrivateKey, 22 | alipayAlipayPublicKey) 23 | 24 | doPay(client) 25 | //payQuery("1e6d724d-da95-407b-9802-6f2217c301d6", client) 26 | //refund("202408151940108001001886C0209996792", client) 27 | //queryRefund("ad53716a-81-4c4c-b151-216c5225e", client) 28 | //cancel("ad53716a-81-4c4c-b51-20916c5225e", client) 29 | //consult(client) 30 | //createSession(client) 31 | } 32 | 33 | func doPay(body *defaultAlipayClient.DefaultAlipayClient) { 34 | payRequest, request := pay.NewAlipayPayRequest() 35 | 36 | request.PaymentRequestId = uuid.NewString() 37 | order := &model.Order{} 38 | order.OrderDescription = "example order" 39 | order.ReferenceOrderId = uuid.NewString() 40 | order.OrderAmount = model.NewAmount("100", "HKD") 41 | merchant := &model.Merchant{} 42 | merchant.ReferenceMerchantId = "1238rye8yr8erwer" 43 | merchant.MerchantMCC = "7011" 44 | merchant.MerchantName = "example merchant" 45 | merchant.Store = &model.Store{StoreMCC: "7011", ReferenceStoreId: "289285674", StoreName: "store 1111"} 46 | order.Merchant = merchant 47 | order.Env = &model.Env{OsType: model.ANDROID, TerminalType: model.WEB} 48 | request.Order = order 49 | 50 | request.PaymentAmount = model.NewAmount("100", "HKD") 51 | 52 | request.PaymentNotifyUrl = "https://www.yourNotifyUrl.com" 53 | request.PaymentRedirectUrl = "https://www.yourRedirectUrl.com" 54 | 55 | request.PaymentMethod = &model.PaymentMethod{PaymentMethodType: model.ALIPAY_HK} 56 | 57 | request.ProductCode = model.CASHIER_PAYMENT 58 | 59 | execute, err := body.Execute(payRequest) 60 | if err != nil { 61 | print(err.Error()) 62 | return 63 | } 64 | response := execute.(*responsePay.AlipayPayResponse) 65 | fmt.Println("result: ", response.AlipayResponse.Result) 66 | fmt.Println("response: ", response) 67 | } 68 | 69 | func payQuery(paymentRequestId string, body *defaultAlipayClient.DefaultAlipayClient) { 70 | queryRequest := pay.AlipayPayQueryRequest{} 71 | queryRequest.PaymentRequestId = paymentRequestId 72 | request := queryRequest.NewRequest() 73 | //1. 这里接收结果 74 | execute, err := body.Execute(request) 75 | if err != nil { 76 | print(err.Error()) 77 | return 78 | } 79 | response := execute.(*responsePay.AlipayPayQueryResponse) 80 | fmt.Println(response.AlipayResponse.Result.ResultCode) 81 | fmt.Println(response) 82 | } 83 | 84 | func refund(paymentId string, client *defaultAlipayClient.DefaultAlipayClient) { 85 | refundRequest := pay.AlipayRefundRequest{} 86 | refundRequest.RefundRequestId = uuid.NewString() 87 | refundRequest.PaymentId = paymentId 88 | refundRequest.RefundAmount = model.NewAmount("100", "HKD") 89 | refundRequest.RefundReason = "example refund" 90 | request := refundRequest.NewRequest() 91 | execute, err := client.Execute(request) 92 | if err != nil { 93 | print(err.Error()) 94 | return 95 | } 96 | response := execute.(*responsePay.AlipayRefundResponse) 97 | fmt.Println(response.AlipayResponse.Result.ResultCode) 98 | fmt.Println(response) 99 | 100 | } 101 | 102 | func queryRefund(refundRequestId string, client *defaultAlipayClient.DefaultAlipayClient) { 103 | queryRefundRequest := pay.AlipayInquiryRefundRequest{} 104 | queryRefundRequest.RefundRequestId = refundRequestId 105 | request := queryRefundRequest.NewRequest() 106 | execute, err := client.Execute(request) 107 | if err != nil { 108 | print(err.Error()) 109 | return 110 | } 111 | response := execute.(*responsePay.AlipayInquiryRefundResponse) 112 | fmt.Println(response.AlipayResponse.Result.ResultCode) 113 | fmt.Println(response) 114 | } 115 | 116 | func consult(client *defaultAlipayClient.DefaultAlipayClient) { 117 | consultRequest := &pay.AlipayPayConsultRequest{} 118 | request := consultRequest.NewRequest() 119 | consultRequest.SettlementStrategy = &model.SettlementStrategy{ 120 | SettlementCurrency: "USD", 121 | } 122 | consultRequest.ProductCode = model.CASHIER_PAYMENT 123 | consultRequest.UserRegion = "SG" 124 | consultRequest.AllowedPaymentMethodRegions = []string{"SG", "HK", "CN"} 125 | consultRequest.Env = &model.Env{ 126 | OsType: model.IOS, 127 | TerminalType: model.APP, 128 | } 129 | consultRequest.PaymentAmount = model.NewAmount("1000", "USD") 130 | consultRequest.PaymentFactor = &model.PaymentFactor{ 131 | PresentmentMode: model.BUNDLE, 132 | } 133 | 134 | execute, err := client.Execute(request) 135 | if err != nil { 136 | print(err.Error()) 137 | return 138 | } 139 | response := execute.(*responsePay.AlipayPayConsultResponse) 140 | fmt.Println(response.AlipayResponse.Result.ResultCode) 141 | fmt.Println(response) 142 | 143 | } 144 | 145 | func cancel(paymentRequestId string, client *defaultAlipayClient.DefaultAlipayClient) { 146 | request, cancelRequest := pay.NewAlipayPayCancelRequest() 147 | cancelRequest.PaymentRequestId = paymentRequestId 148 | execute, err := client.Execute(request) 149 | if err != nil { 150 | print(err.Error()) 151 | return 152 | } 153 | response := execute.(*responsePay.AlipayPayCancelResponse) 154 | fmt.Println(response.AlipayResponse.Result.ResultCode) 155 | fmt.Println(response) 156 | 157 | } 158 | 159 | func createSession(client *defaultAlipayClient.DefaultAlipayClient) { 160 | request, createSessionRequest := pay.NewAlipayPaymentSessionRequest() 161 | createSessionRequest.PaymentRequestId = uuid.NewString() 162 | createSessionRequest.Order = &model.Order{ 163 | OrderDescription: "example order", 164 | ReferenceOrderId: "289473927358748", 165 | OrderAmount: model.NewAmount("100", "HKD"), 166 | Buyer: &model.Buyer{ 167 | ReferenceBuyerId: "111112132143434", 168 | }, 169 | } 170 | createSessionRequest.PaymentAmount = model.NewAmount("100", "HKD") 171 | createSessionRequest.ProductCode = model.CASHIER_PAYMENT 172 | createSessionRequest.PaymentMethod = &model.PaymentMethod{ 173 | PaymentMethodType: model.SHOPEEPAY_SG, 174 | } 175 | createSessionRequest.PaymentNotifyUrl = "https://www.yourNotifyUrl.com" 176 | createSessionRequest.PaymentRedirectUrl = "https://www.yourRedirectUrl.com" 177 | createSessionRequest.Env = &model.Env{ 178 | OsType: model.IOS, 179 | TerminalType: model.APP, 180 | } 181 | 182 | execute, err := client.Execute(request) 183 | if err != nil { 184 | print(err.Error()) 185 | return 186 | } 187 | response := execute.(*responsePay.AlipayPaymentSessionResponse) 188 | fmt.Println(response.AlipayResponse.Result.ResultCode) 189 | fmt.Println(response) 190 | } 191 | -------------------------------------------------------------------------------- /com/alipay/example/subscription_demo.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | defaultAlipayClient "github.com/alipay/global-open-sdk-go/com/alipay/api" 6 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 7 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request/subscription" 8 | responseSubscription "github.com/alipay/global-open-sdk-go/com/alipay/api/response/subscription" 9 | "github.com/google/uuid" 10 | ) 11 | 12 | func main() { 13 | const alipayGatewayUrl = "" 14 | const alipayClientId = "" 15 | const alipayMerchantPrivateKey = "" 16 | const alipayAlipayPublicKey = "" 17 | 18 | client := defaultAlipayClient.NewDefaultAlipayClient( 19 | alipayGatewayUrl, 20 | alipayClientId, 21 | alipayMerchantPrivateKey, 22 | alipayAlipayPublicKey) 23 | 24 | //SubscriptionsCreate(client) 25 | SubscriptionsChange(client, "202409141900000000000001J0000009488") 26 | //subscriptionCancel(client, "202409141900000000000001J0000009488") 27 | 28 | } 29 | 30 | func SubscriptionsCreate(client *defaultAlipayClient.DefaultAlipayClient) { 31 | 32 | request, alipaySubscriptionCreateRequest := subscription.NewAlipaySubscriptionCreateRequest() 33 | alipaySubscriptionCreateRequest.SubscriptionRequestId = uuid.NewString() 34 | alipaySubscriptionCreateRequest.Env = &model.Env{ 35 | ClientIp: "1.*.*.*", 36 | OsType: model.ANDROID, 37 | TerminalType: model.WEB, 38 | } 39 | alipaySubscriptionCreateRequest.PaymentAmount = &model.Amount{ 40 | Currency: "HKD", 41 | Value: "10", 42 | } 43 | alipaySubscriptionCreateRequest.PaymentNotificationUrl = "https://www.yourNotifyUrl.com" 44 | alipaySubscriptionCreateRequest.PeriodRule = &model.PeriodRule{ 45 | PeriodType: model.PeriodType_MONTH, 46 | PeriodCount: 1, 47 | } 48 | alipaySubscriptionCreateRequest.SettlementStrategy = &model.SettlementStrategy{ 49 | SettlementCurrency: "USD", 50 | } 51 | alipaySubscriptionCreateRequest.SubscriptionDescription = "test_subscription" 52 | alipaySubscriptionCreateRequest.SubscriptionStartTime = "2024-09-12T12:01:01+08:00" 53 | alipaySubscriptionCreateRequest.SubscriptionEndTime = "2024-09-14T12:01:01+08:00" 54 | // The duration of subscription preparation process should be less than 48 hours 55 | alipaySubscriptionCreateRequest.SubscriptionExpiryTime = "2024-09-15T12:01:01+08:00" 56 | alipaySubscriptionCreateRequest.PaymentNotificationUrl = "https://www.yourNotifyUrl.com" 57 | 58 | alipaySubscriptionCreateRequest.OrderInfo = &model.OrderInfo{ 59 | OrderAmount: &model.Amount{ 60 | Currency: "HKD", 61 | Value: "10", 62 | }, 63 | } 64 | 65 | alipaySubscriptionCreateRequest.PaymentMethod = &model.PaymentMethod{ 66 | PaymentMethodType: model.ALIPAY_HK, 67 | } 68 | 69 | alipaySubscriptionCreateRequest.SubscriptionRedirectUrl = "https://www.alipay.com" 70 | alipaySubscriptionCreateRequest.SubscriptionNotificationUrl = "https://www.alipay.com" 71 | 72 | execute, err := client.Execute(request) 73 | if err != nil { 74 | panic(err) 75 | } 76 | fmt.Println(alipaySubscriptionCreateRequest.SubscriptionRequestId) 77 | response := execute.(*responseSubscription.AlipaySubscriptionCreateResponse) 78 | fmt.Println(response) 79 | } 80 | 81 | func SubscriptionsChange(client *defaultAlipayClient.DefaultAlipayClient, subscriptionId string) { 82 | request, changeRequest := subscription.NewAlipaySubscriptionChangeRequest() 83 | changeRequest.SubscriptionId = subscriptionId 84 | changeRequest.SubscriptionChangeRequestId = uuid.NewString() 85 | changeRequest.PaymentAmountDifference = &model.Amount{ 86 | Currency: "HKD", 87 | Value: "100", 88 | } 89 | changeRequest.PaymentAmount = &model.Amount{ 90 | Currency: "HKD", 91 | Value: "100", 92 | } 93 | changeRequest.PeriodRule = &model.PeriodRule{ 94 | PeriodType: model.PeriodType_MONTH, 95 | PeriodCount: 1, 96 | } 97 | changeRequest.SubscriptionStartTime = "2024-09-12T12:01:01+08:00" 98 | changeRequest.SubscriptionEndTime = "2024-09-13T12:01:01+08:00" 99 | changeRequest.OrderInfo = &model.OrderInfo{ 100 | OrderAmount: &model.Amount{ 101 | Currency: "BRL", 102 | Value: "100", 103 | }, 104 | } 105 | 106 | execute, err := client.Execute(request) 107 | if err != nil { 108 | panic(err) 109 | } 110 | response := execute.(*responseSubscription.AlipaySubscriptionChangeResponse) 111 | fmt.Println(response) 112 | } 113 | 114 | func subscriptionCancel(client *defaultAlipayClient.DefaultAlipayClient, subscriptionId string) { 115 | request, cancelRequest := subscription.NewAlipaySubscriptionCancelRequest() 116 | cancelRequest.SubscriptionId = subscriptionId 117 | cancelRequest.CancellationType = model.CancellationType_CANCEL 118 | execute, err := client.Execute(request) 119 | if err != nil { 120 | panic(err) 121 | } 122 | response := execute.(*responseSubscription.AlipaySubscriptionCancelResponse) 123 | fmt.Println(response) 124 | } 125 | -------------------------------------------------------------------------------- /com/alipay/example/vaulting_demo.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | defaultAlipayClient "github.com/alipay/global-open-sdk-go/com/alipay/api" 6 | "github.com/alipay/global-open-sdk-go/com/alipay/api/model" 7 | "github.com/alipay/global-open-sdk-go/com/alipay/api/request/vaulting" 8 | responseVaulting "github.com/alipay/global-open-sdk-go/com/alipay/api/response/vaulting" 9 | "github.com/google/uuid" 10 | ) 11 | 12 | func main() { 13 | const alipayGatewayUrl = "" 14 | const alipayClientId = "" 15 | const alipayMerchantPrivateKey = "" 16 | const alipayAlipayPublicKey = "" 17 | 18 | client := defaultAlipayClient.NewDefaultAlipayClient( 19 | alipayGatewayUrl, 20 | alipayClientId, 21 | alipayMerchantPrivateKey, 22 | alipayAlipayPublicKey) 23 | 24 | //createVaultingSession(client) 25 | //vaultPaymentMethod(client) 26 | inquireVaulting(client, "9116fffd-58d0-49ee-9fa1-4fec2c43c83d") 27 | 28 | } 29 | 30 | func createVaultingSession(client *defaultAlipayClient.DefaultAlipayClient) { 31 | request, vaultingRequest := vaulting.NewAlipayVaultingSessionRequest() 32 | vaultingRequest.VaultingRequestId = uuid.NewString() 33 | vaultingRequest.PaymentMethodType = "CARD" 34 | vaultingRequest.VaultingNotificationUrl = "https://www.yourNotifyUrl.com" 35 | vaultingRequest.RedirectUrl = "https://www.yourRedirectUrl.com" 36 | vaultingRequest.MerchantRegion = "BR" 37 | 38 | response, err := client.Execute(request) 39 | if err != nil { 40 | fmt.Println(err) 41 | } else { 42 | fmt.Println(vaultingRequest.VaultingRequestId) 43 | fmt.Println(response.(*responseVaulting.AlipayVaultingSessionResponse)) 44 | } 45 | } 46 | 47 | func vaultPaymentMethod(client *defaultAlipayClient.DefaultAlipayClient) { 48 | request, vaultPaymentMethodRequest := vaulting.NewAlipayVaultingPaymentMethodRequest() 49 | vaultPaymentMethodRequest.VaultingRequestId = uuid.NewString() 50 | vaultPaymentMethodRequest.VaultingNotificationUrl = "https://www.yourNotifyUrl.com" 51 | vaultPaymentMethodRequest.RedirectUrl = "https://www.yourRedirectUrl.com" 52 | vaultPaymentMethodRequest.MerchantRegion = "BR" 53 | 54 | vaultPaymentMethodRequest.PaymentMethodDetail = &model.PaymentMethodDetail{ 55 | PaymentMethodType: "CARD", 56 | Card: &model.CardPaymentMethodDetail{ 57 | CardNo: "4111111111111111", 58 | Brand: model.CardBrand_VISA, 59 | BillingAddress: &model.Address{ 60 | Address1: "address1", 61 | Address2: "address2", 62 | City: "city", 63 | State: "state", 64 | ZipCode: "zipcode", 65 | }, 66 | CardholderName: &model.UserName{ 67 | FirstName: "firstname", 68 | LastName: "lastname", 69 | }, 70 | ExpiryYear: "2026", 71 | ExpiryMonth: "06", 72 | Cvv: "123", 73 | }, 74 | } 75 | 76 | vaultPaymentMethodRequest.Env = &model.Env{ 77 | TerminalType: model.APP, 78 | } 79 | 80 | response, err := client.Execute(request) 81 | if err != nil { 82 | fmt.Println(err) 83 | } else { 84 | fmt.Println(response.(*responseVaulting.AlipayVaultingPaymentMethodResponse)) 85 | } 86 | } 87 | 88 | func inquireVaulting(client *defaultAlipayClient.DefaultAlipayClient, vaultingRequestId string) { 89 | request, inquireVaultingRequest := vaulting.NewAlipayVaultingQueryRequest() 90 | inquireVaultingRequest.VaultingRequestId = vaultingRequestId 91 | response, err := client.Execute(request) 92 | if err != nil { 93 | fmt.Println(err) 94 | } else { 95 | fmt.Println(response.(*responseVaulting.AlipayVaultingQueryResponse)) 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/alipay/global-open-sdk-go 2 | 3 | go 1.22.5 4 | 5 | require ( 6 | github.com/google/uuid v1.6.0 // indirect 7 | ) 8 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= 2 | github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 3 | github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= 4 | github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= 5 | --------------------------------------------------------------------------------