Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verifyPayment Failure #2

Open
endlichstudios opened this issue Dec 18, 2017 · 2 comments
Open

verifyPayment Failure #2

endlichstudios opened this issue Dec 18, 2017 · 2 comments

Comments

@endlichstudios
Copy link

When the verifyPayment function runs, it successfully ends with:
$this->onPaymentSuccess($row, $transactionId);

In the prcoessPayment function, I can grab the $Itemid by using:
$Itemid = JFactory::getApplication()->input->getInt('Itemid', 0);
Example: $Itemid = 1673

  1. Is this correct?

I'm able to pass this ID back to the verifyPayment by using the url:
option=com_eventbooking&task=payment_confirm&payment_method=gwname&TransactionId=ZTACHCG0&Itemid=(ItemID From processPayment)
Example:
option=com_eventbooking&task=payment_confirm&payment_method=gwname&TransactionId=ZTACHCG0&Itemid=1673

When I load the ItemID loaded from the processPayment in the verifyPayment, $row is returned blank. I'm using this code and it will not load the data:
$id = $this->notificationData['Itemid'];
$row = JTable::getInstance('EventBooking', 'Registrant');
$row->load($id);

  1. How should $row loaded if this is incorrect? Am I loading the Itemid incorrectly from the processPayment?
@joomdonation
Copy link
Owner

$Itemid is id of the active menu item, it is not id of the registration record, so if you want to have id properly passed:

  1. Pass it in the URL:

option=com_eventbooking&task=payment_confirm&payment_method=gwname&id=ID_OF_RECORD&Itemid=1673

ID_OR_RECORD can be accessed via $row->id

  1. In the code of verifyPayment method, you can get id by calling

$id = JFactory::getApplication()->input->getInt('id', 0);
$row->load($id);

That should work well

@endlichstudios
Copy link
Author

That works perfectly. After the verifyPayment function returns true, I'm left at a blank screen. Is there a confirmation page? I also noticed that if I go back to the even booking list, I still have the item in my cart. Is that supposed to be cleared out after the Payment was verified? How is that done?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants