SUM repeat group element to pay with stripe

wuschel_lux

Member
Hi out there,
I am trying to build a basic shop to sell a few articles.
Running latest Joomla and Fabrik, but I had to use git version to be able to run stripe form plugin.

Short, I have 3 fields in a repeat group:
- article (databasejoin)
- quantity
- price, calc field article price * qty

shop.png


Now I would like to calculate an overall total (all calc elements in the repeat group) to be able to chare this amount with stripe.

I read a lot of articles here in the forum where was indicated that with code like:
$sum = 0;
$sum += array_sum($data['shop_article_price_raw']);
it would be possible to do, on the other hand it was written, not possible with a calc element. So I am a bit confused. For me the code dos not work.

Does anyone have a suggestion for me. Thanks
 
Since ... (at least Fabrik3.9.2) there's a "total" element.
If you are running a GitHub version you can install it via "Extensions/Discover".
Not yet in WIKI, see the element's tooltips for setup.
 
Hi again,
now stripe is not working anymore with the new "total" field.
Get always following error (stripe error log).
{

"error": {

"message": "Invalid source object: must be a dictionary or a non-empty string. See API docs at https://stripe.com/docs'",

"param": "source",

"type": "invalid_request_error"

}

}
In the stripe form plugin I use following settings under the tabs:
TAB Price -> select an element -> "total" field selected in dropdown
TAB Item -> Or select an element -> "order id" field selected in dropdown

Strange is also that the amount in the stripe test mode text is not updated even if the total amount is > 0 :

THE STRIPE PROCESSING IS IN TEST MODE. For test CC numbers, see this page.
Purchase for 0,00 €.
When you submit this form, you will be prompted to enter your payment details in a popup form for the Stripe secure payment processing system. Once entered, the form will submit, and your payment will be processed. This site does not store your CC details.
 
I don't have stripe.
Is it working with fix Cost/Purchase Item in the settings (i.e. is the stripe connection working at all)?

Is it working if you use simple field elements with a value/Item you type?

Change only one by one.
 
yes when just adding a fix price in the 'Cost' field and for example test in the 'Purchase item' field I get the stripe dialog and it's working fine.
Only when I try to add dynamically values from fields within the form, stripe plugin is not running.

Additionally I got a popup that there is an update for Stripe Checkout (Apple Pay, Google Pay, ... integration).
 
So for testing set a fix Purchase item and try if it's doing with element placeholder for Cost, i.e. set Cost to eval and do
return '{your-full-total-element}'; //(full element name = your-table___your-element)
instead of selecting an element.
upload_2021-2-11_8-37-30.png
 
sorry, no that doesn't solve the issue.
I replaced also the total element with a standard field where no calculation is done, also without success.
 
I just tested (not with stripe but in the code):
Setting a fix Cost
or setting Cost without Eval to
'{test___testfeld1}'
or setting Cost with Eval to
return '{test___testfeld1}';
or selecting testfeld1 in the element selection
is all returning the same amount.

So if it's doing with a fix Cost on your site I can't see why it won't do with a standard field
What are your exact Cost settings/options?
 
I use actually following settings:

TAB Payment
-> Currency Code = EUR
-> Currency Multiplier = 100

TAB Price
-> Cost = return '{my_table___pay_total}';
-> Eval = Yes
-> Eval to Element = No
-> Select an element = Please select

TAB item
-> Purchase item = test
-> Eval = No
-> Eval to Element = No
-> Or select an element = Please select
 
As I said I can't test with stripe but I can't see any difference in collecting the amount no matter which method is used. I tried with a simple field element and also with a total element.

Are you sure there's no typo in your placeholder (exact full element name, no spaces, no unprintable characters...)?
 
yes I am sure, copy paste from the elements list.
And yes I share your opinion, but I see that for me it's not working.

How can we proceed, could an access help you, or some logs, ... what ever I will try to give all the support from my side that I can
 
Hi
Sorry to rain on your parade but the Stripe plugin offered by fabrik is out of date as it is not SCA compliant (please correct me if I'm wrong)
Stripe have moved to Stripe checkout about 2 years ago now which as far as I know still doesnt work with Fabrik.
Stripe best practices
It would be awesome if Fabrik developed a plugin for Stripe Checkout.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top