What workflow for PayPal payment with registration and file upload?

railer

Member
I'm working on an Art Gallery site, trying to set up a method for Artists to create a site account, pay a small submission fee, and then upload 3 images for consideration for a juried art exhibition.

I could use some advice regarding the least obtrusive workflow.

Here's what I thought I would do:

1. Artist creates a site account via a Fabrik form with the JUser plugin to bind it to the Joomla User table.
2. Confirmation email is sent to the user, containing a link directing him/her to...
3. ...a Payment form to pay the submission fee via PayPal. User is redirected from PayPal to...
4. ...an Art Submission form with fields for contact info, with a repeating group containing art work details, i.e., Title, Year (of creation), Dimensions, Media used. This group includes a File Upload element as the last element in the group.

All forms have a Google noCaptcha element.

Questions:

A. Is this the best workflow, or can you recommend a way to make it less cumbersome, but still secure against spam submissions? Can it be done in one step? I'm concerned that if it is cumbersome, artists will stop midway.

B. I know I can set the JUser plugin to bypass the confirmation email and automatically login the user. Is that something you recommend?

C. I've never used the PayPal plugin before so I'm not sure where in the process above it should be placed? How is it usually used? I saw the wiki page about it, but it looks like it is a form plugin, so I assume that one needs to first create a form with the necessary billing info fields and then map them in the plugin's parameters. Can the plugin be used with a more complex form, i.e., my Art Submission form? Or is it best kept separate so that the act of paying keeps people from uploading without paying?

A second workflow might be:

1. User makes the PayPal payment, then is redirected to a form which takes their contact info details and allows them to upload their art files. I guess this one would bypass the confirmation email.

Your thoughts?

Thanks!
 
Last edited:
The PayPal plugin is indeed a form submission plugin. You map elements on your form to the various settings (price, description, IPN variables that get fiulled in on successful payment, etc). When the user submits the form, usually having selected the item (and maybe quantity), after the regular form processing has happened (so the row has been written to the table) the plugin redirects to PayPal. Once payment is confirmed there, it redirects bvack to whatever you configured in the plugin (usually a "thanks" page). At some point in the future (anything from seconds to hours) PayPal will make the IPN callback to your site, which triggers more processing in the plugin, writing out the IPN details (status, txn id, amount charged, PayPal customer email, any custom values you specified, etc).

Technically I guess it's possible to do a PayPal transaction in conjunction with a juser plugin when they register the account. You might experiment with that.

NOTE that the PayPal plugin is not entirely trivial. You need a sandbox account with PayPal to test it with. And we can't really provide any Community support for it.

You might want to take a look at the Stripe plugin, which I'm focusing more of my time on these days, which allows for credit card payments. Depending on your audience, this may be less of a hurdle than requiring them to have PayPal accounts.

-- hugh
 
Thanks Hugh!

Do you think the first process described above is a good one, or too cumbersome to have essentially 3 steps to go through? I really wanted your ideas as to alternative processes.

I will definitely try combining the registration and payment into one step. In this case, the "product" being purchased is a set fee so no quantity and really no selection to be made. I see in the Paypal Plugin that under the Price tab there is a Cost field. I thought I'd just enter the fee amount there, instead of having some kind of element with the pricing in there. Will that work?

So if I combine the registration with payment, I figure I'll put some text on the form that says, "Click "Register" to send your registration. You will be directed to Paypal to make your ($xx) submission fee payment. Once payment is received, you'll be directed to a form page where you may upload your art images." Does that sound okay?

Ideally, it would be good if the payment part could take place before the user is registered in Joomla. Then I could conceivably disable the email confirmation and log in the user automatically after payment is made, redirecting them to the file upload form. Would it be possible to add some kind of code in a form plugin to make it happen in that order?

Yes, I do have some Paypal Sandbox accounts for testing, but I often just put a $0.01 amount as the price and make the purchase when testing. Unless things have changed in the last year, PayPal also offers a text link on their payment page allowing users without Paypal accounts to pay by credit card. You may be aware that many, many merchants here in the US are using Square (and Square Up) for payments.
 
Last edited:
The juser plugin runs first, it has to run before storing the form row. The PayPal plugin runs after.

I think enabling auto login in juser, and redirecting from PayPal back to an upload form would work. Just be aware that because of the nature of PayPal IPN method, you (probably) won't know if their payment has been successful when they arrive back after the redirect from PayPal.

Hugh

Sent from my HTC6545LVW using Tapatalk
 
Thanks Hugh.
The form seems to work fine in sandbox test mode.

Here is the revised process:

1. User completes a custom registration form with the Joomla user fields. I've made the Block, User Group, and other Joomla system files hidden with values I need for this type of user. The main difference is that I have Firstname and Lastname fields, and a hidden Fullname field, which maps to the User Fabrik plugin Name value. (I've also got street address info fields). Upon submit, user is redirected to the Paypal payment page.

2. After payment is complete the user is redirected to a the second Art Submission form and an alert message is displayed which says "Record added/updated.)

In the Art Submission form, I have a Name field. I would like the field to pre-populate with the user's full name. I put a default value of {$my->name} in the forms "Name" field, but doesn't seem to work. It's just showing the following:

$name = '{artacct_users___artacct_first_name}'.' '.'{artacct_users___artacct_last_name}';return $name;

The latter part being the code in my "full name" hidden field to concatenate the firstname and lastname fields.

And note that if I look at Joomla's Control Panel at Logged in users, I see the two fabric placeholders instead of a user's name.

What code should I use to get the new user properly logged in and have their first name and last name displayed in the form?
 
Hi Hugh ? It wasn't but it is now. I also see where my mistake above was. I had put the default code in the wrong form element (there are two forms with similar fields happening.)

So that being resolved, now the question is how to get the value from that field to display in the Name field on the second form.
I noticed that there are two parameters in the menu item's Fabrik Form Options called Row id and Key Name which might be able to do this. Any tips on what to enter in those fields? I tried -1 in Row Id, which caused it to display my name in the field.
 
A user element set to display the name should do it.

Does the second form need to only have one row per user (like a "profile") or can users submit multiple times?

-- hugh
 
Hi Hugh -- They submit only once from the second form. It is set to allow them to upload up to 3 images for the submit. I can't test it now. The PayPal sandbox was working up until yesterday, but it suddenly stopped and is now giving the following message:

"Sorry, We're not able to complete your purchase. Please return to the Merchant and select another way to pay."

Since it was working fine, I am having their techs look into it. If you think it might be my setup, please let me know. (Like I said, it was working fine.)
 
Last edited:
I'm about 97.682% sure that's not a Fabrik issue. That usually means there's an issue with the funding source for the transaction, or you have otherwise fallen afoul of their "bad actor" algorithm.

Try something like topping up your account from the Chase bank, or add another funding source.

-- hugh
 
Re the form.

If you only want the person to have one of those forms, then yes, the rowid=-1/usekey trick is what you need. That tell;s Fabrik to use their user ID as the row ID, instead of the usual PK element, and you also tell use what element to use as the key, which would typically be a 'user' element.

That way, if all access to the form uses that method, either with those options set on a menu item, or adding &rowid=-1&usekey=user_id (or whatever the short name of your element is) to a URL (like the return from PayPal), we'll always either load "their" row, or create their row if they don't have one. And set the user element to display whatever you need (name, username, whatever), and set the access on it so they can't change it.

-- hugh
 
I'm about 97.682% sure that's not a Fabrik issue. That usually means there's an issue with the funding source for the transaction, or you have otherwise fallen afoul of their "bad actor" algorithm.

Try something like topping up your account from the Chase bank, or add another funding source.

-- hugh

Thanks Hugh ? Totally a PayPal sandbox problem. They were able to replicate the issue, and I've seen notices come in from test transactions they made, but no official update from them.
I switched the payment price to $0.01 cents and made a successful live payment, so the forms work. But the user's name value is still not populating the Name field in the form when coming back from PayPal. I'll read through your last note above about "rowid=-1/usekey trick" and make sure I underestand it so I can use the correct element. Thanks.
 
OK.

Unfrotunately I've gone as far as I can with free support (well, further, really, I typically don't provide this kind of support in Community, I'll just respond to bug reports). If you need more help with this, you'll need a sub.

-- hugh
 
Thanks Hugh, I appreciate the feedback. I'm in the middle of a cashflow crunch at the moment. But when I've cleared that hurdle I'll upgrade my sub again if I haven't already stumbled my way to a solution. Still haven't gotten the value to display. I want to display the user's fullname which was input in the first form, in the second form upon redirect. I assume the values are sent. I tried both setting the values in the menu item's Fabrik Form Options tab, and then I tried adding it onto the return URL in the PayPal Plugin. Neither worked, so far. Don't know which is the proper method. For the URL, I added the code above on the end of the Fabrik Form URL, changing the element part. I'll keep trying and will be sure to post the solution in detail here.
 
Last edited:
Well, if you create the user and autologin before the redirect to PayPal, they should be logged in when they get back? So a user element should work?

And putting it in the return URL should work, like &form2___name={form1___name}

-- hugh
 
Thanks Hugh -- still having problems with Name field in the second form. When the user is redirected from PayPal, the Name field is now a dropdown displaying all current users in the Fabrik table.

I'm not expecting a response from you, but I'll check the thread just in case. I'll keep working on it. It's probably the sort of scenario where I need step-by-step pointers, i.e., for this element, put this here, do this there.

If you care to indulge further, here is what I'm working with:

REGISTRATION FORM: It has the JUser plugin and the PayPal plugin configured.

Users are being created and automatically enabled and logged in.

The specific elements for this issue are:
First Name > artacct_users___artacct_first_name
Last Name > artacct_users___artacct_first_name
Fullname > artacct_users___artacct_full_name

The full name element is a calc element with the following in the More/Calculation text area:

$name = '{artacct_users___artacct_first_name}'.' '.'{artacct_users___artacct_last_name}';
return $name;

That is what is being added to the Joomla User profile for Name because it is the field mapped to the Name field in the JUser Fields tab.

In the PayPal plugin, the return URL to the Art Submission Form in the After Payment tab is:

http://www.mywebsite.com/index.php?..._fullname={artacct_users___artacct_full_name}

------

ART SUBMISSION FORM:

In this form the first field is the Name field, which has this element, which currently is a user element:
artsubmission_smallworks2017___artsub_fullname

Options/User Data is set to Name.

As I mentioned above, it is showing me a dropdown menu.
 
Last edited:
Thanks Hugh. I thought I replied to this last week, but maybe I didn't hit the "Post" button.
The ACL fixed the Name field dropdown menu issue! Awesome.

Btw, I just paid for a Pro subscription, but it looks like PayPal is still transferring the funds from my bank account since the pro forum still says I "have insufficient privileges to post to this forum".

Anyway, I'm still having the following problems with this form pertaining to the file upload file, so I'm replying here. If you need to move the thread to the Pro forum, please feel free.

I have a repeating group setup with the following field elements:
- Title
- Year of Creation
- Dimensions
- Media
- File Upload -- Restricted to 1 file, .jpg format. Upload set to Ajax.

This repeating group can only be repeated 3 times, max, 1 time minimum. Since each file must have a set of related information I have to include the file upload element in the group.

The goal is to offer artists the chance to upload up to 3 image files for this exhibition and each image file will have its own information.

If I only upload 1 file, it seems to work fine. It creates a new directory using the Name value and uploads the file to it. Also creates a thumbnail in a specified directory.

Problems:

1. If I click the Plus sign icon to add another group, it show the new group, but the "Add Group" Tool tip displays continuously and hides the Minus sign icon (Delete Group).

2. Click Add Files in the second group adds the same file as in the first group. It doesn't upload a second version of the file. I suppose it could be overwriting the first file, but I think I have that turned off.

3. I want the list view in the admin area to display a thumbnail of the art which will link to the full size image, but the thumbnail is not displaying.
 
Last edited:
Yes, it is. I forget what info you have in the system.
I wasn't sure when I'd hear back from you, so I enlisted the help of another developer who is currently working on this file upload problem. He thinks it might be due to a db structure problem, ie., no file upload image URL field, or something to that effect.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top