I'm trying to create and Idempotency Key for each associated request. I have a lot of functions which modify the base Idempotency Key like so:
public async Task<PaymentMethod> CreatePaymentMethodAsync(string customerId, string paymentMethodId, string idemBase)
{
//...
var requestOptions = this.GetDefaultOptions(idemBase, nameof(StripeConnectService.CreatePaymentMethodAsync));
}
public async Task<PaymentIntent> CapturePaymentIntentAsync(string paymentIntentId, long? amountInCents,
string idemBase)
{
//...
var requestOptions = this.GetDefaultOptions(idemBase, nameof(StripeConnectService.CapturePaymentIntentAsync));
}
I would prefer not having to explictly pass the function name using the name of operator, it is prone to copy and paste errors and would prefer a simpler way, preferably one that doesn't use reflection.