Files
PowderCoatingLogix/src/PowderCoating.Application/Interfaces/IStripeConnectService.cs
T
spouliot fdac0240d1 Fix Stripe receipt_email + online payment surcharge and hardening
Remove receipt_email from PaymentIntent creation so customers can use
any email at Stripe checkout without a stored-email mismatch blocking
payment. Remove now-dead CustomerEmail from PaymentPageViewModel.

Fix surcharge payment input: amount field now represents the total the
customer pays (including fee); JS back-calculates base before sending
to server. Add InvariantCulture to numeric Razor→JS literals to prevent
comma-decimal cultures from truncating surcharge values.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 14:17:57 -04:00

38 lines
1.7 KiB
C#

namespace PowderCoating.Application.Interfaces;
public interface IStripeConnectService
{
/// <summary>Returns the Stripe OAuth URL to begin the Standard Connect onboarding flow.</summary>
string GetOAuthUrl(int companyId, string redirectUri);
/// <summary>Exchanges the OAuth authorization code for a StripeAccountId and saves it to the company.</summary>
Task<(bool Success, string? ErrorMessage)> HandleOAuthCallbackAsync(string code, int companyId);
/// <summary>Deauthorizes the connected account and clears the company's Stripe Connect fields.</summary>
Task<(bool Success, string? ErrorMessage)> DisconnectAsync(int companyId);
/// <summary>
/// Creates a Stripe PaymentIntent on the connected account for the given amount (in dollars).
/// Returns the client secret needed by Stripe.js on the payment page.
/// </summary>
Task<(bool Success, string? ClientSecret, string? PaymentIntentId, string? ErrorMessage)> CreatePaymentIntentAsync(
string connectedAccountId,
decimal invoiceTotal,
decimal surchargeAmount,
string currency,
string invoiceNumber,
int invoiceId);
/// <summary>
/// Creates a Stripe PaymentIntent on the connected account for a quote deposit.
/// Metadata includes type=deposit so the webhook can distinguish it from invoice payments.
/// </summary>
Task<(bool Success, string? ClientSecret, string? PaymentIntentId, string? ErrorMessage)> CreateDepositPaymentIntentAsync(
string connectedAccountId,
decimal depositAmount,
decimal surchargeAmount,
string currency,
string quoteNumber,
int quoteId);
}