Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
System.InvalidOperationException: Sequence contains no matching element
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
at TeaCommerce.PaymentProviders.Inline.BaseStripeProvider.GenerateHtmlForm(Order order, String teaCommerceContinueUrl, String teaCommerceCancelUrl, String teaCommerceCallBackUrl, String teaCommerceCommunicationUrl, IDictionary`2 settings)
at TeaCommerce.Api.Web.PaymentProviders.PaymentMethodExtensions.GeneratePaymentForm(PaymentMethod paymentMethod, Order order, String submitInput)
at TeaCommerce.Api.Web.TeaCommerceHelper.GeneratePaymentForm(Int64 storeId, String submitInput)
at TeaCommerce.Api.Web.FormPostHandler.GeneratePaymentForm(Int64 storeId)
My scenario at the moment (assuming that user has already placed an order and is ready to checkout. There are multiple payment options apart from 'Stripe'):
What I've done so far is:
I'm currently using the example payment form that you've provided - https://github.com/TeaCommerce/Payment-Providers/blob/c859bcfe9830ada3dc52e3f9d4cec0632fd058c8/Source/TeaCommerce.PaymentProviders.UI/Views/StripePaymentForm.cshtml
And I've modified some of the code in that example form to be hardcoded for testing purpose e.g: Request.Form["billingaddressline1"], and the other Request.Form and I've already set up the following settings for Stripe payment provider:
I may be on the wrong track here but when I went onto the "form_url" page directly without clicking on "Checkout" button as mentioned in my scenario above, I was able to fill in the card details - Name, card number, expiry date and cvc. And when i clicked "Submit Payment" button - it only returns the token but does not call ProcessCallback method or finalized the order. Am i missing out something at this point here? Could you please shed some light on this?
Looking at the code for the Stripe payment providers GenerateForm method the only places where the First method is called is when populating the billing fields via the property aliases. https://github.com/TeaCommerce/Payment-Providers/blob/master/Source/TeaCommerce.PaymentProviders/Inline/BaseStripeProvider.cs#L65
My guess then would be that you have a configuration for one of the billing property aliases (which you show above address line 1, city and zip code) but one of those is not actually populated on the order so when the Stripe provider tries to access them, it fails because it doesn't exist.
I'd double check your aliases in the provider settings and make sure these match exactly with the property aliases you are setting on the order when collecting the users billing information and also make sure that for all aliases defined, there must be a property value on the order.
You're right, it is the aliases in the provider settings that caused the issue. I've changed the aliases and it is now working as it link to the Stripe payment form. However after filling up the card detail and submitting the payment, it does not finalized the order or charge the card. Do I need to call a method or something here?
Hmm, as long as it's set to capture in the settings it should work. Have you looked in the log file for any errors?
Yes, the capture is already set to true in the settings and I've looked into the log file but there wasn't any errors at all. On the Stripe's log (in the stripe website), I could see that the status is 200 and the description says "POST /v1/tokens" and that is only returning the token.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted