PayPal

bespokeappstt

Hubstaff freelancer
Last edited:
The form plugin. The subscription one is more of a boilerplate for people to build custom subscription systems from.

-- hugh
 
Okay great. So I need some help integrating this as it's the first time. So I have my form already working, as a matter of fact I have several forms that all require paypal payment but I'll do the teething process with one and hopefully this will give me the experience to deal with the rest. So the form of choice is the Trade Submission form found here
http://www.caribbeanskills.com/index.php/2016-02-19-17-39-02/trade-skills

The payment for submission is a per year fee and there is only one fee, $16 US. There are no several packages or different fees for this form. I am not sure how this works. I may need to add PayPal as one of the payment methods and when you select it you fill out the form and when you hit submit the Fabrik form data is submitted and then you are taken to paypal interface to enter your card info or pay via paypal account. Is this how it works? How do I integrate this standard per year fee into paypal and integrate the whole thing into my existing form?
Naturally there must be somewhere in the configuration to enter your email address etc. so paypal knows the account to deposit. Am I going good so far? There is no shipping, taxes or anything of the sort here. This is a straight payment.
 
Last edited:
The PayPal plugin is not simple, but the tooltips and the wiki should tell you most of what you need to know.

The plugin redirects the user to the standard PayPal payment page (on PayPal's site). The user then logs in to PayPal independently, it doesn't use any email or credentials supplied through the Fabrik form. When they pay, the PayPal IPN mechanism fires off a call back to your site, providing you with details of the transaction, which the Fabrik plugin responds to, and updates the forms data accordingly with things lie the txn-id, status, etc.

As you are just using a simple fixed cost, you don't need to worry about any complexities with evaluating that. Just put 16 in the price box.

The important part is the IPN fields. It's fairly essential you provide (hidden) fields for the ones marked "Optional but STRONGLY advised", and definitely at least txn-id, status, and payment. Those will be filled out by the plugin after payment is processed. Without those, you have no record of the transaction.

I also suggest getting yourself a PayPal sandbox, so you can test without hitting your real merchant account.

https://developer.paypal.com/developer/accounts/

... which then lets you set up test merchant and customer accounts, and the Fabrik plugin lets you select the sandbox to test with rather than the live site.

As you have multiple payment methods, you will also need to provide a "Condition" which only returns true if PayPal is the selected method. Which in your case would be something like ...

Code:
return '{advertise_your_trade_or_ser___payment_method_paid_via_raw}' == 'xx';

... where xx is the value you assign to the new PayPal option.

-- hugh
 
I am finishing the setup for my Paypal account. For my business setup I naturally chose the option that say, "Work with an e-commerce solution that's already integrated with Paypal." They are asking for my third party username. What do I put here?
 
Okay I've setup my sandbox accounts, buyer and facilitator. I have looked at the IPN tab and require some advice before I proceed. So I'll list the IPN's and state my opinions and you'll let me know what's what. Here I go:
IPN Custom element - (the element whose data will be updated when the transaction is finished)..I don't understand this? In my case would this be the 'Payment Method' that the person selected?(http://www.caribbeanskills.com/index.php/2016-02-19-17-39-02/trade-skills)

IPN Custom Value - Do I need this? I understand the use of a Placeholder instead of the element but the fee in this case if fixed, 16 USD. Do I need this?

IPN Txn-Id Element - I understand this and I need it.

IPN Payment Element - Again I have only 1 value being charged, 16 USD, do I need this?

IPN Status Element - I understand this and I need it.

IPN Address Element - Don't see why but I'll create a field element for this

IPN Subscriber ID Element - I understand this and I need it.

IPN Php File - I have no idea what this is or if I need it.

Now for the other tabs. I believe I don't need to mess with the Shipping and Subscription tabs. This is a one time fee that will last for a year. The person pays 16USD to advertise on the site for a year. I have two elements that deal with this. When the person signs up and submits I get an email and verify if payment was made. If it was I set the 'Approved' element to 'approved' By default it sets to 'Not Approved' when the form is submitted, only when it's set to 'approved' will the information display on the site. The next element I have is a date element 'expiry_date' which is manually set to a year from the signup date so that we know when someone's time is up and naturally re-set the 'Approved' element to 'not approved' so the info does not show.

Having said all that, I have a critical question. Assuming I don't need to mess with the 'Shipping' and 'Subscription' tabs, can Fabrikar detect if a payment was good and if it was automatically set the 'Approved' element to 'approved' so the person's info shows without manual intervention? Because of the other payment methods, Wire Transfer and Bank Deposit the approval process has to be manual and payment has to be verified via online banking first. If the Paypal option can be automatic then that would be less checking and great. Hope this wasn't to long winded.
 
I did my first Paypal test and nothing happened. It did not even re-direct to Paypal. Do I have to remove the "redirect" plugin? The form simply worked as it usually does. The dropdown menu option that supposed to trigger Paypal is
Paypal (Testing Only) and the value is 12, so in the condition I have
return '{advertise_your_trade_or_ser___payment_method_paid_via}' == '12';

The only IPN's I have not configured is 'Payment Element', 'Subscriber ID Element' and 'PHP File Element'. I didn't do Payment cause it's a flat fee which specified in the 'Price', I did not specify the 'Subscriber' element cause it's not a subscription and I don't know the use or purpose of the PHP File. I am lost as it didn't even re-direct to Paypal.

Under Payment I am using the real email but under Test I am using the sandbox email. Where do I start?
 
Okay I've setup my sandbox accounts, buyer and facilitator. I have looked at the IPN tab and require some advice before I proceed. So I'll list the IPN's and state my opinions and you'll let me know what's what. Here I go:
IPN Custom element - (the element whose data will be updated when the transaction is finished)..I don't understand this? In my case would this be the 'Payment Method' that the person selected?(http://www.caribbeanskills.com/index.php/2016-02-19-17-39-02/trade-skills)

IPN Custom Value - Do I need this? I understand the use of a Placeholder instead of the element but the fee in this case if fixed, 16 USD. Do I need this?

No, you don't need it. This simply allows you to provide some custom data which will get "reflected" back from PayPal in the IPN response. Only needed if you are doing your own custom handling.

IPN Txn-Id Element - I understand this and I need it.

IPN Payment Element - Again I have only 1 value being charged, 16 USD, do I need this?

Yes, I would use the Payment element, to prevent anyone spoofing a payment with a $1.

IPN Status Element - I understand this and I need it.

IPN Address Element - Don't see why but I'll create a field element for this

Address isn't strictly necessary, but doesn't hurt to have it on file.

IPN Subscriber ID Element - I understand this and I need it.

Don't think you need this, as you aren't doing "subscriptions" in the PayPal sense.

IPN Php File - I have no idea what this is or if I need it.

Nope, you don't need it. Allows you to execute custom code for various PayPal responses. For example, if someone reverses a payment in PayPal, you can add some custom code to handle removing their access to your system.

Well, you may need it, see next section ...

Now for the other tabs. I believe I don't need to mess with the Shipping and Subscription tabs. This is a one time fee that will last for a year. The person pays 16USD to advertise on the site for a year. I have two elements that deal with this. When the person signs up and submits I get an email and verify if payment was made. If it was I set the 'Approved' element to 'approved' By default it sets to 'Not Approved' when the form is submitted, only when it's set to 'approved' will the information display on the site. The next element I have is a date element 'expiry_date' which is manually set to a year from the signup date so that we know when someone's time is up and naturally re-set the 'Approved' element to 'not approved' so the info does not show.

Having said all that, I have a critical question. Assuming I don't need to mess with the 'Shipping' and 'Subscription' tabs, can Fabrikar detect if a payment was good and if it was automatically set the 'Approved' element to 'approved' so the person's info shows without manual intervention? Because of the other payment methods, Wire Transfer and Bank Deposit the approval process has to be manual and payment has to be verified via online banking first. If the Paypal option can be automatic then that would be less checking and great. Hope this wasn't to long winded.

That's what the 'status' element is for, it shows (I think) "Completed" when the PayPal transaction is complete. If you need to set the value of another element when that happens, you'd need to add a custom IPN handler (as mentioned above). So you would need a payment_status_Completed() IPN handler which set your separate 'Approved' element to 'approved'.

If you look in ./plugins/fabrik_form/paypal/scripts/signup_ipn.php, you'll see an example of a payment_status_Complete() handler which enables a user in J! when the payment completes. It would be easy to modify that to update the 'Approved' field in your form's table.

But lets get the basics working first.

-- hugh
 
I've created a sandbox account, do I still need to use the 'Test' tab?

Yes, you need to set "Test Mode" to Yes (that's what tells us to redirect to the sandbox site rather than the live site), and set the "Seller email" to the email you created as the merchant user in the sandbox. Which usually defaults to your regular email with -facilitator appended to the name part.

-- hugh
 
I did my first Paypal test and nothing happened. It did not even re-direct to Paypal. Do I have to remove the "redirect" plugin? The form simply worked as it usually does. The dropdown menu option that supposed to trigger Paypal is
Paypal (Testing Only) and the value is 12, so in the condition I have
return '{advertise_your_trade_or_ser___payment_method_paid_via}' == '12';

The only IPN's I have not configured is 'Payment Element', 'Subscriber ID Element' and 'PHP File Element'. I didn't do Payment cause it's a flat fee which specified in the 'Price', I did not specify the 'Subscriber' element cause it's not a subscription and I don't know the use or purpose of the PHP File. I am lost as it didn't even re-direct to Paypal.

Under Payment I am using the real email but under Test I am using the sandbox email. Where do I start?

I would start by removing the condition, and seeing if it redirects.

-- hugh
 
When you say the condition do you mean the:

return '{advertise_your_trade_or_ser___payment_method_paid_via}' == '12';

If I remove that how would Fabrik know it's time to use Paypal? I thought this condition is absolutely necessary to let Fabrik know that the Papal option has been chosen from the dropdown?

After you did mention it
As you have multiple payment methods, you will also need to provide a "Condition" which only returns true if PayPal is the selected method. Which in your case would be something like ...

This makes perfect sense to me, so when you say remove the condition what are you referring to?
 
Last edited:
I meant just remove it to test, and see if the redirect to PayPal happens. See if it's the condition preventing the plugin running.

Sent from my HTC One using Tapatalk
 
I assume your previous test meant that once there is no condition then the page re-directs to Paypal no matter what option was chosen from the dropdown. Am I correct in my thinking? If so then something is really wrong, as the page does not re-direct even when there is no condition.
 
Seems to be working, at least on the backend. I tweaked your Condition a little, also added a condition on the Redirect, so it doesn't try and redirect if method == 12.

You can define the 'after payment" redirect in PayPal plugin.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top