PayPal Configuration Problem

PayPal Configuration Problem

by Shriram Joshi -
Number of replies: 30

Hi all


I need desperate help

I had Moodle stack deployed on AWS through Bitnami.

Moodle version is 3.5.

Its published on public IP with Host name configured - 

URL of my moodle site - https://learncomputeronline.in


I used Paypal plugin and configured paypal account and moodle site as expected as per documentation

On Paypal account i have configured the IPN link as below

https://learncomputeronline.in/moodle/enrol/paypal/ipn.php

My Paypal account is in India linked to indian bank and set up all necessary tax details in paypal account. Its 100% complied with necessary configuration.

Everything set right, But when i do payment to any course - Say one course with TYBcom IT keto for trail with USD 0.10 - and try to make payment through credit card option appearing on Paypal 

After filling all valid credit card details...........still screen shown follwing error message.

I have no clue on error for what..............


is it that paypal transaction is still not going through India.

Or is it that my IPN address has some issue which should be differetn if Moodel is installed out of bitnami stack on AWS.


where the problem is??


I have struggled for week on this with no success.


I request someone to try to pay for my course TYBCom IT .......kept just at USD 0.10 for trial.

I don't mind refunding person that much amount.

More important to come out of this issue.


please help.

Attachment Error.jpg
Average of ratings: -
In reply to Shriram Joshi

Re: PayPal Configuration Problem

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Try taking /moodle out of the paypal link...your url is already pointing to the moodle folder...

In reply to Emma Richardson

Re: PayPal Configuration Problem

by Shriram Joshi -

Thanks Emma for prompt revert but I have done that already with no success......

In fact I tried all combinations of URL's

removing moodle

Removing even Enrol

Removind Paypal


Nothing is helping


And no clue - where the error is?


In reply to Shriram Joshi

Re: PayPal Configuration Problem

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Do you have records in the mdl_enrol_paypal table? If not, check your firewall.

If you have records in this table, what are the values of payment_status pending_reason reason_code and payment_type?

In reply to Renaat Debleu

Re: PayPal Configuration Problem

by Shriram Joshi -

Thanks for your revert Renaat,

Will you please elaborate where exactly and how to check these tables.


Sorry to ask but I am not a full tech savvy developer but trying to put things right in framework.

Any clue to solve my problem is welcome.

If you could elaborate so that I can come back to you with findings

As such I am not working under any firewall.


Its normal Quick Heal AV that is installed on machine.


In reply to Shriram Joshi

Re: PayPal Configuration Problem

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Serious problem solving needs access to logs - database - php - ....

Contact your Data Protection Officer to see if you have permission to access this data. Once permissions are granted you can start looking on the internet how to access your database....

In reply to Renaat Debleu

Re: PayPal Configuration Problem

by Shriram Joshi -

I myself has hosted this site on AWS through Bitnami. So myself is admin for this site. So permissions should not be issue. I also has access to server through SSH and for small issues I use Putty to take access. But as long as I completely know command to do anything. Let me check on internet - how to get these logs.

I hope you mean this table in moodle installation only.

I will revert in day - if i get some clue.


In reply to Renaat Debleu

Re: PayPal Configuration Problem

by Shriram Joshi -

Hi Renaat

Can you give me some idea on what port must be open on firewall to get entry in ipn.php file by paypal.

Since my installation of moodle is on AWS through Bitnami, i presume all ports are closed by default.

This might be the reason PayPal payment failure.


Just a guess from my side.


In reply to Renaat Debleu

Re: PayPal Configuration Problem

by Shriram Joshi -

Hi Renaat,


With lot of struggle, I could ultimately reach to mdl_enrol_paypal table.

Bit unfortunately - no entries found in that table. Attaching snap shot


It seems whatever i do in Paypal is not reaching to moodle server at all.

As told earlier, My moodle is hosted on AWS EC2 server. Hosting done though Bitnami hosting.

Is there any specific port setting requirement to be done in server on firewall?


Any help will be of great importance to me.


Shriram


Attachment MDL_ENROL_PAYPAL.jpg
In reply to Shriram Joshi

Re: PayPal Configuration Problem

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Just turn the firewall off and test - that will quickly tell you if it is a firewall issue.  I suspect it is still a setup issue - Paypal set up is extremely finicky.  

In reply to Emma Richardson

Re: PayPal Configuration Problem

by Shriram Joshi -

Hi Emma,

I appreciate you all trying to help me.


I just turn off the firewall on AWS EC2 instance by adding inbound rule to all traffic. Practically disabling firewall.

But no success...............

Already application is set to work on

Port 80 for http

Port 443 for https

and Port 22 for SSH


So just now i added ALL Trafic as additional rule.

Tried complete cycle of paying thorugh PayPal.

But no success.


Really mounting frustration when you have to provide solution to customer without seeing hopes.


Shriram


In reply to Shriram Joshi

Re: PayPal Configuration Problem

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Have you tried paypal support?  Do you still have the /moodle in the url?  That will not work..

The paypal account is either misconfigured or there is something wrong with the account.

In reply to Emma Richardson

Re: PayPal Configuration Problem

by Shriram Joshi -

Hi Emma

Thanks for revert.

I have removed moodle immediately after receving your first reply only.

So my IPN url is not having /moodle.

My PayPal account is confimed with all compliance.

In fact I have tested this by creating paypal button and embedding same in one of my website.

Payment happened successfully in paypal account.

So I am 100% confident in my PayPal account.

Paypal support team also suggeted me to test my accounts health by creating button and usiing it.


So I am still clueless.


In reply to Shriram Joshi

Re: PayPal Configuration Problem

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

And you have gone through every step here (https://docs.moodle.org/35/en/PayPal_enrolment) again and made sure that everything is correct...

In reply to Emma Richardson

Re: PayPal Configuration Problem

by Shriram Joshi -

Yes Emma....

Absolutely line by line........

I request you to check on my site and try to pay for course name ....TYBcom IT....

All course list will be availble ehen you scroll down in site.

You can register to site through google or facebook account with email confirmation or fill up your own details to create login and also agree with site policy for first time login.

TyBCom course fee is kept for just 0.10 USD for making teials till I get success......


But once agin I reconfirm...all steps followed as per your above links documentation. In fact verified 10 times by now and also removed /moodle from IPN link as suggested by you earlier.

In my server which is on AWS E2.....all above mentioned ports are well configured.

Paypal account is in good condition.


Where its going wrong??

In reply to Shriram Joshi

Re: PayPal Configuration Problem

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Testing something we know will fail does not do much.  The error is coming from Paypal so you need to start there - Moodle is obviously sending info to Paypal but Paypal is not able to connect back.  Oh, do you have Selinux enabled on the Moodle server?  Try disabling that...keep the firewall off until you figure it out...

Fire up a MoodleCloud account and test from there - that will tell you if it is Paypal setup or something specific to your server...

In reply to Shriram Joshi

Re: PayPal Configuration Problem

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Ok, so I went ahead tested.  I got the error from Moodle but then it let me in the course.  I wonder if cron is just not running quickly enough or there is a cache issue going on...but good news is that I am in the course.

In reply to Emma Richardson

Re: PayPal Configuration Problem

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Your original error came from Paypal so I guess maybe a problem with the paypal account you used or is it the same account - that might be it.  I got a not fully processed error from Moodle but I refreshed and got right in the course.  

In reply to Emma Richardson

Re: PayPal Configuration Problem

by Shriram Joshi -

Hi Emma,


I really thank you for this great support you provided and spend your dollar for me. Really appreciate your willingness to spend for this trial course.


That's one part of very good news for me that at least something worked right.

Yes I can see your entry in my course as well as your USD 0.1 entry in my PayPal account.

So it implies that my setting and configuration is perfect.

Great!!

Now i doubt if something is not working from India.

You paid in USD and from same country..........So is it something related to restriction in cross country transaction?

But that can not be case as My Paypal account is in India and ultimately your payment landed in my account.

How you done payment actually in detail?? could you explain?

I mean to ask.........

Whether you have used your PayPal account itself to make payment?

Or whether you were using your credit card or debit card option?


Because till this time, I was trying to pay with my credit card option and not through my PayPal account as I anticipate many of my end customers will not have their own PayPal accounts and they will defiantly use credit or debit card option only,


So please specify - How you made payment.

You are the first successful PayPal student in my course.


Shriram



In reply to Shriram Joshi

Re: PayPal Configuration Problem

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

I used my paypal account.

In reply to Emma Richardson

Re: PayPal Configuration Problem

by Shriram Joshi -

Hi Emma

Thanks for confirmation.

I got some clue now - about whats going wrong for me..............

When I used to submit for payment, address bar of browser displays one PayPal error code at the end of URL.........

checkout/genericError?code=UEFZRVJfQ0FOTk9UX1BBWQ%3D%3D


I searched through this error code in google.

Then I found below forum link where all people facing similar error from pay pal for various applications they hosted in which currency was not Indian Rs - INR and all of them were having PayPal account in India and all of them trying to get money form their Indian cusotmers only but in USD.

https://github.com/braintree/braintree-android-drop-in/issues/53


This forum implies that there is regulation or restriction in India..........that PayPal can not receive or process any payment from Indian Customers in any other currency other than INR.

This is the reason............PayPal could process your payment in USD since you were not form India. 

But it ultimately rejected my all payments because I was form India.


Even though PayPal has official started with Indian currencies from 1st March 2018 this year, they still seems to be bounded by this regulation act.

So there seems to be no way if i had account of PayPal in India..............I will not be able to accept payment form Indian Customers.

Unless Moodle provides INR currency in PayPal configuration screen.


There is option that I should Create specific payment button in PayPal to accept Indian payment and include the same in my Moodle's course page. This will resolve my problem of getting payment from Indian customers..............but then it will not register user to course.

in fact there is option in configuring this button to specify INP URL which I can do ............but then I need to know the Specific attribute variables that need to pass to that URL.


Does anyone has idea - which Attribute variables get passed through PayPal IPN notification in normal case..........so that same i can try to configure in my custom PayPal button.


Shriram


In reply to Shriram Joshi

Re: PayPal Configuration Problem

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

You could add the INR code to line 39 of enrol/paypal/lib.php to accept Indian Rupees.

   // See https://www.paypal.com/cgi-bin/webscr?cmd=p/sell/mc/mc_intro-outside,
   // 3-character ISO-4217: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_currency_codes

   $codes = array(
            'AUD', 'BRL', 'CAD', 'CHF', 'CZK', 'DKK', 'EUR', 'GBP', 'HKD', 'HUF', 'ILS', 'JPY',
            'MXN', 'MYR', 'NOK', 'NZD', 'PHP', 'PLN', 'RUB', 'SEK', 'SGD', 'THB', 'TRY', 'TWD', 'USD');


And modify the enrol_page_hook function so Indian users see a INR version.


In reply to Renaat Debleu

Re: PayPal Configuration Problem

by Shriram Joshi -

Dear Renaat........

WOW!!, WOW!!, WOW!!!

It's a Big Big Relief to me today...............................

I could add INR exactly where you specified in file.

Then I changed the default currency in my administration setting of PayPal plugin under enrollments to INR.

Then i changed the Particular Trial Course (TYBcom IT) currency to INR with trail fees of Rs 10.


I logged in to my site with one student account and then tried to pay through PayPal payment option for this trial course.

ALL WENT VERY VERY SMOOTHLY> 

> IT REDIRECTED ME TO PAYPAL ACCOUNT PAGE FO RPAYMENT

> I CHOOSE CREDIT CARD OPTION

> ENTERED CREDIT CARD DETAILS

>ASKED FOR OTP - ENTER SAME

>PAY PAL GIVEN CONFIRMATION PAYMENT SCREEN WITH LINK TO GO BACK TO MERCHANT SITE

>CAME BACK ON MY COURSE SITE WITH DIRECT ACCESS TO COURSE PAGE ITSELF.


FABULOUS!!! AS EXPECTED .................................


It's too good for me since all my courses will be in INR and most of my customers will be in India.

YOU HAVE MADE MY DAY!!!

THANKS A TON!!!!


Only one query - Is it that someone in other country like you peole outside India - evenif they see course fee in Indian Rs ............Still able to pay by clicking on Pay through PayPal button? And i Hope their amount will get deducted in equivalant currenies of their country in their PayPal or Credit/Debit Card and My PayPal accoutn will get credited with Exact INR amount as mentioned on course page.

WIll it be that way only.......I presume it should be.

Because I have not understood your last suggestion on "modify the enrol_page_hook function so Indian users see a INR version" - I could not understood how to modify and what.


But is my above thing is working fine then I may not need to this currency swithover between INR and USD.

But still if you can suggest further - I will definitely will like to give a try.


Thank you once again.....................


Shriram

 


In reply to Shriram Joshi

Re: PayPal Configuration Problem

by Rayson Venture -

You mention in this post that you were able to check out using just a credit card (not using a PayPal account). In my PayPal merchant account I've checked the "PayPal optional" button, but in Moodle users only see the option to pay by credit card. How did you overcome this problem?

In reply to Rayson Venture

Re: PayPal Configuration Problem

by Rayson Venture -

I'm sorry. I made a mistake in my earlier post. I meant to say that users of my Moodle site do not see the option to pay by credit card even though I checked the "Paypal account optional" setting in my merchant account. In your situation, do you see the option to pay by credit card while in Moodle, or do you only see it after the user has been taken to the PayPal site? In my case, I do not see the pay by credit card option anywhere. I've included a couple of screenshots below to demonstrate.


Attachment screenshot_1.png
Attachment screenshot_2.png
In reply to Rayson Venture

Re: PayPal Configuration Problem

by Shriram Joshi -
In reply to Shriram Joshi

Re: PayPal Configuration Problem

by Shriram Joshi -

I suppose, you are missing some setting in PayPal account to allow alternate payment method.

Do check in with PayPal site settings.

It's nothing to do with moodle.


Shriram

In reply to Shriram Joshi

Re: PayPal Configuration Problem

by Shriram Joshi -

Further to my comment above - I got Below confirmation mail from PayPal Technical support team,

"As you rightly mentioned, Indian buyers cannot pay Indian merchants in USD currency. Domestic transactions must be made only in INR currency. We could see that your account is KYC verified and ready to accept domestic payments. In order to resolve the issue, you need to implement a currency switcher in your website which will toggle between INR and USD based on buyer location. If buyer is from India show INR else otherwise."

So PayPal is definatly not supporting Indian customers to apply for my course through PayPal since my own PayPal account is in India.

So only hope of option remains is to get INR currency in Moodle's PayPal Plugin for next version.

Till that time, I will not be able to have online payment in anyway for my courses.

Shriram

In reply to Shriram Joshi

Re: PayPal Configuration Problem

by Shriram Joshi -

I am really thankful to .......

Emma Richardson as well as Renaat Debleu

for your continuous support to me with lot of patience .............

I was so deeply frustrated for not getting to root cause of problem.

Right directions from both of you forced me to learn so many things and i could able to figure out what exactly going wrong.

WIthout your support it could not have been possible.

Last remedial action of adding INR was like a master stroke to sort out everything.

In fact it solved my both problems of having courses with INR and then facility to auto enrolment with payment.

Tons of Thanks to both of you.........I owe you many thing if i could somehow retune in terms of any support of any kind from my side.


Thanks to both of you once again. People like you really dedicate your knowledge and time for welfare of newcomers like us.


Shriram


In reply to Shriram Joshi

Re: PayPal Configuration Problem

by Eswar sfc -

Hi Shriram joshi,


in your site,is students are enrolling to the course,after payment is success..??

I have asked you this question bcz of in my site,i'm receiving the payment of the students,bu it showing the error,Thank you for your payment,but your payment was not successful.!


Thanks,

Arun kumar



In reply to Eswar sfc

Re: PayPal Configuration Problem

by Shriram Joshi -

Yes Arun

Getting successful enrolment.


I suggest you to check IPN url in pay pal setting....

This is the only channel from where payment confirmation reaches moodle to enrol student successfully