Custom Payment Plugin - Registrations Pending

  • Adam Becker
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 1 month ago #94360 by Adam Becker
We are finalizing a payment plugin for Events Booking using Beanstream. Everything is working out except that all the registrations are still marked as pending in the data, so they don't show up in registration list.

I am not able to locate where a registration would be changed from published=0 to published=1 in the code. The returned value from our payment gateway is trnApproved=1 for approved payments.

I also need to know how to record the transaction id in the order. Right now I think Events Booking is generating a random 6 letter code. The returned value from our payment gateway is trnId for the approval/transaction id.

Many thanks for your assistance.

Adam

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #94382 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom Payment Plugin - Registrations Pending
Hello Adam

With your payment plugin, is customers being redirected to payment gateway for processing payment, if so, read documentation at github.com/joomdonation/os_eb_redirect to understand how it should work

Basically, after payment completed, you should redirect users to yoursitedomain.com/index.php?option=com_..._payment_plugin_name (of course, you need to pass other parameters if available)

Then on your payment plugin code, you will implement the method verifyPayment which validate the payment, make sure it is valid, then call $this->onPaymentSuccess($row, $transactionId); to complete the process (sending emails, update published = 1, store transaction id...)

Look at os_paypal.php payment plugin and you will see how the code is implemented

Tuan

Please Log in or Create an account to join the conversation.

  • Adam Becker
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 1 month ago - 9 years 1 month ago #94801 by Adam Becker
Replied by Adam Becker on topic Custom Payment Plugin - Registrations Pending
Hi,

I am still struggling with this. I am sure what I am missing is really small in stupid :-). Orders register payment, but does not record the transaction ID, and does not change from "Pending".

Here is my return URL on success:
[site]/index.php?option=com_eventbooking&view=complete&Itemid=900&trnApproved=1&trnId=10100618&messageId=1&messageText=Approved&authCode=TEST&responseType=T&trnAmount=56.50&trnDate=2%2F24%2F2017+11%3A55%3A39+AM&trnOrderNumber=64&trnLanguage=eng&trnCustomerName=Adam+Becker&trnEmailAddress=abecker%40beckerassociates%2Eca&trnPhoneNumber=&avsProcessed=0&avsId=U&avsResult=0&avsAddrMatch=0&avsPostalMatch=0&avsMessage=Address+information+is+unavailable%2E&cvdId=2&cardType=VI&trnType=P&paymentMethod=CC&ref1=64&ref2=&ref3=&ref4=&ref5=

Here is my verifyPayment code:
if ($this->validate()) {

$id = $this->notificationData;
$transactionId = $this->notificationData;
$row = JTable::getInstance('EventBooking', 'Registrant');
$row->load($id);

if (!$row->id) {

return false;

}

if ($row->published) {

return false;

}

$this->onPaymentSuccess($row, $transactionId);
}
Last edit: 9 years 1 month ago by Adam Becker.

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #94812 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom Payment Plugin - Registrations Pending
Please zip your payment plugin code here. I will try to look at it to see what's wrong and guide you to correct it

Tuan

Please Log in or Create an account to join the conversation.

  • Adam Becker
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 1 month ago #94817 by Adam Becker
Replied by Adam Becker on topic Custom Payment Plugin - Registrations Pending
Attached is the code as I have it.

For the life of me, I can't find where the function onPaymentSuccess is in any of the EB code. I found a reference to it in EShop, but not in EB. I suspect it is in shared code some where else on site; don't know if this is the issue.

Many thanks for looking at this for me. I am having the same problem with Membership Pro, and I am hoping that whatever the solution is, it will also be applicable to your other component.

Best,

Adam

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #94822 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom Payment Plugin - Registrations Pending
Hello Adam

I found something with the code and tried to fix it. Please try this new plugin, then check it to see whether it works

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • Adam Becker
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 1 month ago #94829 by Adam Becker
Replied by Adam Becker on topic Custom Payment Plugin - Registrations Pending
Hi Tuan,

No change - registration does not show in backend because it is still pending, and the transaction id is not being saved :-(

Was there any thing I needed to do with the code you sent back other than upload to components/com_eventbooking/payments ?

Adam

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #94843 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom Payment Plugin - Registrations Pending
Did you unzip the package before uploading? Maybe you can send me the URL of the page you are redirected back to after payment completed so that I can take a look? I added some debug message to that code, too

Tuan

Please Log in or Create an account to join the conversation.

  • Adam Becker
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 1 month ago #94855 by Adam Becker
Replied by Adam Becker on topic Custom Payment Plugin - Registrations Pending
Yes, I unzipped it, and uploaded the files to: /components/com_eventbooking/payments

Here is URL on return. I did see that you put some debug coding in the php file. None of this is showing on the site:
64.140.126.242/~staojoom/index.php?optio...2=&ref3=&ref4=&ref5=

Again, thank for your assistance.

Adam

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #94888 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom Payment Plugin - Registrations Pending

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc