Giter Site home page Giter Site logo

essensoft / paylink Goto Github PK

View Code? Open in Web Editor NEW
1.7K 74.0 477.0 20.06 MB

一套基于 .NET 开发的支付SDK,它简化了API调用及通知的处理流程。

License: MIT License

C# 100.00% Batchfile 0.01%
essensoft payment alipay weixin wechatpay paylink wechat wechat-pay

paylink's Issues

微信统一支付出错

在window服务器正常,在Centos7上出错,错误信息
System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.--->System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.\n at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, ExceptionDispatchInfo exception)\n at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)\n at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)\n at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)\n at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)\n at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)\n at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)\n at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)\n at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)\n at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)\n at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)\n at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)\n at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)\n at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)\n at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)\n at System.Net.Security.SslState.PartialFrameCallback(AsyncProtocolRequest asyncRequest)\n---End of stack trace from previous location where exception was thrown---\n at System.Net.Security.SslState.ThrowIfExceptional()\n at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)\n at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)\n at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult)\n at System.Net.Security.SslStream. < >c. < AuthenticateAsClientAsync > b__47_1(IAsyncResult iar)\n at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)\n---End of stack trace from previous location where exception was thrown---\n at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)\n---End of inner exception stack trace---\n at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)\n at System.Threading.Tasks.ValueTask1.get_Result()\n at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)\n at System.Threading.Tasks.ValueTask1.get_Result()\n at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask1 creationTask)\n at System.Threading.Tasks.ValueTask1.get_Result()\n at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)\n at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\n at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\n at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\n at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)\n at Essensoft.AspNetCore.Payment.WeChatPay.Utility.HttpClientExtensions.DoPostAsync(HttpClient client, String url, String content)\n at Essensoft.AspNetCore.Payment.WeChatPay.WeChatPayClient.ExecuteAsync[T](IWeChatPayRequest1 request, String optionsName)\n at Donvv.Meeting.Controllers.PaymentController.MpPay(Int32 id, String openId) in E: \\DonvvMeeting\\server\\Meeting\\Meeting\\Donvv.Meeting\\Controllers\\PaymentController.cs: line 84 ","Properties ":{"SourceContext ":"Donvv.Meeting.Controllers.PaymentController ","ActionId ":"0791aadb - d831 - 4f4c - 95cd - 8fb940f6595e ","ActionName ":"Donvv.Meeting.Controllers.PaymentController.MpPay(Donvv.Meeting)","RequestId ":"0HLLUB9I9NS1B: 00000001 ","RequestPath ":" / api / Payment / MpPay
尝试解决方法:
ServicePointManager.ServerCertificateValidationCallback +=
(sender, certificate, chain, sslPolicyErrors) => true;无效
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; 无效
export DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0 无效
export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
export SSL_CERT_DIR=/dev/null 无效

申请退款Bug

我支付是正常的
但是退款就提示这个问题:
The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.

支付宝异步会掉老是报错

支付宝异步会掉老是报错,但正常支持成功!在支付成功后进行异步回调时会报签名不正确问题,为啥??

using (var rsa = RSA.Create())
            {
                var type = "RSA2" == signType ? HashAlgorithmName.SHA256 : HashAlgorithmName.SHA1;
                rsa.ImportParameters(parameters);
                var request= rsa.VerifyData(Encoding.UTF8.GetBytes(data), Convert.FromBase64String(sign), type, RSASignaturePadding.Pkcs1);
                return request;
            }

就这段一直返回false

abp怎么用呢

我在领域层实现功能,但怎么在web去注入相关的服务呢?
教程是 // 引入Payment 依赖注入
services.AddAlipay();
services.AddWeChatPay();

        // 在 appsettings.json(开发环境:appsettings.Development.json) 中 配置选项
        services.Configure<AlipayOptions>(Configuration.GetSection("Alipay"));
        services.Configure<WeChatPayOptions>(Configuration.GetSection("WeChatPay"));

dev分支版本【支付宝当面付-扫码支付】是只支持公钥证书签名方式了吗

我看代码验证签名的参数,都验证了公钥证书、商户证书和根证书,代码位置如下
Essensoft.AspNetCore.Payment.Alipay.AlipayClient类中的方法

public async Task<T> CertificateExecuteAsync<T>(IAlipayRequest<T> request, AlipayOptions options, string accessToken, string appAuthToken) where T : AlipayResponse
       {
           if (options == null)
           {
               throw new ArgumentNullException(nameof(options));
           }

           if (string.IsNullOrEmpty(options.AppId))
           {
               throw new ArgumentNullException(nameof(options.AppId));
           }

           if (string.IsNullOrEmpty(options.SignType))
           {
               throw new ArgumentNullException(nameof(options.SignType));
           }

           if (string.IsNullOrEmpty(options.AppPrivateKey))
           {
               throw new ArgumentNullException(nameof(options.AppPrivateKey));
           }

           if (string.IsNullOrEmpty(options.AppCert))
           {
               throw new ArgumentNullException(nameof(options.AppCert));
           }

           if (string.IsNullOrEmpty(options.AlipayPublicCert))
           {
               throw new ArgumentNullException(nameof(options.AlipayPublicCert));
           }

           if (string.IsNullOrEmpty(options.RootCert))
           {
               throw new ArgumentNullException(nameof(options.RootCert));
           }

           if (string.IsNullOrEmpty(options.ServerUrl))
           {
               throw new ArgumentNullException(nameof(options.ServerUrl));
           }

PayPal

请问是否考虑支持一下 PayPal 呢

Support Visa pay?

Hey!

I am looking for a solution for Visa pay on .NET Core.

Do you have any plan for this?

Some files may using the wrong encoding format

Repro steps:

  1. Clone the project
  2. Open with Visual Studio 2019 Enterprise (English edition) on Windows 10 (English edition)
  3. Open: Startup.cs under 3.0 demo
  4. Read the code: Some text is unreadable.

image

I guess it was because those files are using GBK encoding but my Visual Studio opened it with UTF-8.

I suggest switching all files with Chinese to use UTF-8 encoding to improve reading experience.

Question: 请问对于微信子商户支付,除了要在Options参数中额外提供SubAppId和SubMchId应当如何使用呢?

Question: 请问对于微信子商户支付,除了要在Options参数中额外提供SubAppId和SubMchId应当如何使用呢?

现在我的使用方法是:

https://github.com/essensoft/payment/blob/015d4a58814c2ac5212a361bbc384d0afb80f841/samples/WebApplicationSample/Controllers/WeChatPayController.cs#L165

对于这里的Value,额外给其赋值子商户Appid和商户Id。看起来似乎没问题。但是这样是正确的使用方法吗?

App端的开发人员说,他们收到的签名是错误的。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.