Here is my scenario:
Now the problem:
What I have tried:
Questions:
Thank you for your time.
I'll do my best to explain the situation:
Result:
The SSL connection could not be established, see inner exception
digging deeper into the inner exception I get:
System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception
digging deeper into the inner exception again I get:
Interiop+AndroidCrypto+SslException: Exception of type Interiop+AndroidCrypto+SslException was thrown
and this happens at System.Net.Security.SslStream<ForceAuthenticationAsync>
Why does it work on some android versions and not on others? Does it have something to do with the genereated self signed certificates? How can I make it work? Thank you for your time
Thank you for the links. The thing is, I need the app to work. Curiously enough, on an android 10 device it doesn't work also. Is it possible to deploy abp to azure with openiddict without the need to have self signed certificates? I believe all this is because of these certificates. Because as it is, basically the MAUI app is useless...\
I have noticed something in the output:
java.lang.IllegalStateException: Handshake has already been started at com.android.org.conscrypt.OenSSLEngineImpl.beginHandshakeInternal(OpenSSLEndingeImpl.hava:335)
Later edit: From preliminary testing, it seems that upgrading Visual Studio to the new version, which probably updated also .net 7 fixes the problem. Will do further testing in the following days.
If you're creating a bug/problem report, please include followings:
Hello,
Either documentation is missing something or there's a bug or I'm not seeing something obvious. Here are the steps:
add a new project using the latest abp 7.0.3 with Public web site
either by using abp suite or by running abp add-module Volo.Payment
add the payment module.
this will add various packages and dependencies based on project
I want to use this on Public site with Stripe (but it also doesn't work on Web) so because of this I add the packages in the project file
<PackageReference Include="Volo.Payment.Admin.Web" Version="7.0.3" />
<PackageReference Include="Volo.Payment.Stripe.Web" Version="7.0.3" />
<PackageReference Include="Volo.Payment.Web" Version="7.0.3" />
and on WebPublicModule.cs
[DependsOn(typeof(AbpPaymentWebModule))]
[DependsOn(typeof(AbpPaymentStripeWebModule))]
[DependsOn(typeof(AbpPaymentAdminWebModule))]
also add url configs
Configure<PaymentWebOptions>(options =>
{
options.RootUrl = configuration["App:SelfUrl"];
options.CallbackUrl = configuration["App:SelfUrl"] + "/Paid";
});
PaymentOptions
appsettings.json
add{
"App": {...},
"Redis": {...},
"ConnectionStrings": {...},
"AuthServer": {...},
"Payment": {
"Stripe": {
"PublishableKey": "publishable_key",
"SecretKey": "secret_key",
"PaymentMethodTypes": [ "card" ]
}
}
}
public async Task<IActionResult> OnGetAsync()
{
var paymentRequest = await paymentRequestAppService.CreateAsync(new PaymentRequestCreateDto()
{
Currency = "USD",
Products = new List<PaymentRequestProductCreateDto>()
{
new PaymentRequestProductCreateDto
{
Code = "Product_code",
Name = "Product name",
Count =1,
UnitPrice = 20,
TotalPrice = 20
}
}
});
return LocalRedirectPreserveMethod("/Payment/GatewaySelection?paymentRequestId=" + paymentRequest.Id);
}
Now the effects:
Request starting HTTP/2 GET https://localhost:44374/Payment/GatewaySelection?paymentRequestId=a246857e-af5f-012d-0eee-3a09ec82cd86 - -
[11:41:08 DBG] Added 0 entity changes to the current audit log
[11:41:08 DBG] Added 0 entity changes to the current audit log
[11:41:08 DBG] Added 0 entity changes to the current audit log
[11:41:08 INF] Executing endpoint '/Payment/GatewaySelection'
[11:41:08 INF] Route matched with {page = "/Payment/GatewaySelection", action = "", controller = "", area = ""}. Executing page /Payment/GatewaySelection
[11:41:08 INF] Skipping the execution of current filter as its not the most effective filter implementing the policy Microsoft.AspNetCore.Mvc.ViewFeatures.IAntiforgeryPolicy
[11:41:08 INF] Executing handler method Volo.Payment.Pages.Payment.GatewaySelectionModel.OnGet - ModelState is Valid
[11:41:08 INF] Executed handler method OnGet, returned result Microsoft.AspNetCore.Mvc.BadRequestResult.
[11:41:08 INF] Executing StatusCodeResult, setting HTTP status code 400
[11:41:08 INF] Executed page /Payment/GatewaySelection in 2.4219ms
[11:41:08 INF] Executed endpoint '/Payment/GatewaySelection'
[11:41:08 INF] Request finished HTTP/2 GET https://localhost:44374/Payment/GatewaySelection?paymentRequestId=a246857e-af5f-012d-0eee-3a09ec82cd86 - - - 400 0 - 47.9921ms
I've tried a bunch of configs and all that I could see in docs and around support answered questions. Basically the gateways pages are not available. Seems like it's missing some configuration? What could cause that BadRequestResult in GatewaySelectionModel.OnGet?
Please advise. Thank you.
Any updates?
@enisn thank you for your answer. If I do it in the Post indeed is does not throw the same error. However, now it says:
ApplicationException: No payment gateway configured!
Volo.Payment.Pages.Payment.GatewaySelectionModel.OnPostAsync()
In the docs it says:
PaymentOptions is used to store list of payment gateways. You don't have to configure this manually for existing payment gateways. You can, however, add a new gateway like below;
also
Instead of configuring options in your module class, you can configure it in your appsettings.json file like below;
What's missing from my configuration? You can see above that in appsettings.json
there's an entry for Payment
containing only Stripe
because that's the only thing I want to use. Also the PublicWebModule has [DependsOn(typeof(AbpPaymentStripeWebModule))]
and [DependsOn(typeof(AbpPaymentWebModule))]
I've had some commented out DependsOn
in Domain project from my trials and errors and because of that, even with the appsettings.json configured it wasn't working. Now I can perform a stripe test payment and return back to callback URL.
However, one last small bit that I am missing
Looking at the docs, it says that
Volo.Payment.PaymentRequestCompleted (PaymentRequestCompletedEto): Published when a payment is completed.
My desire is to update something in the database when the event is handled. Here is some sample code
public class MyTestEventHandler : IDistributedEventHandler<PaymentRequestCompletedEto>, ITransientDependency
{
private readonly IMyTestRepository myTestRepository;
public PaymentRequestCompletedEventHandler(IMyTestRepository myTestRepository;)
{
this.myTestRepository = myTestRepository;
}
public async Task HandleEventAsync(PaymentRequestCompletedEto eventData)
{
Guid id = Guid.Parse(eventData.Products[0].Code); //the Code is entity Id
var entity = await myTestRepository.GetAsync(id);
//here at fetching data from the repository it throws error
}
}
My repository is injected fine. the Id received exists in the database, however it throws error.
The error I get is: Message: A task was cancelled Source: Microsoft.EntityFrameworkCore.Relational InnerException: null
Digging a bit deeper into debug console I can see: An error occured using the connection to database 'MyProj' on server 'MyLocalServer'
A task was cancelled. at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)...
Feels like there's no context for the event handler. How can I property handle the ETO while having access to the database?
@enisn any idea what to try?
@enisn any solution for my issue?
I have two questions that I'd like some clarification.
When using the default template (not tiered) but with a public web site, how can I disable Redis? What is the impact of not having Redis for small projects in this case?
As stated here on abp support and in the link provided https://documentation.openiddict.com/configuration/encryption-and-signing-credentials.html the requirement for production is to generate and register certificates. While the certificates can be pretty easily added on Azure, what happens when the apps are hosted on IIS? There it says that it recommends to store the certificate on the machine's store however, not all hosting services provide this kind of access or option to do this. Is there a simpler way to have the openIdDict working without these certificates? Previously when using IdentityServer things were simpler.