Fabrik PayPal form Sandbox issues

A combination of weird things. For reasons I don't yet understand, your plugin params show up as objects, not arrays, during the IPN handling. Which usually wouldn't be a problem, as we anticipate that and cast them to arrays. But it seems that somewhere between PHP 7.0.8 (that I was running) and 7.0.17 (that you are running), there's a weird "feature" (well, a bug to be honest) that affects casting objects to arrays that breaks our code.

So everywhere we were fetching params like this:

Code:
$ipnStatusField = (array) $params->get('paypal_ipn_status_element', array());
$ipnStatusField = FabrikString::shortColName($ipnStatusField[$renderOrder]);

... wasn't working. After working just fine on every version of PHP and J! for almost a decade. Changing it to ...

Code:
$ipnStatusField = $params->get('paypal_ipn_status_element', array());
$ipnStatusField = FArrayHelper::getValue($ipnStatusField, $renderOrder);
$ipnStatusField = FabrikString::shortColName($ipnStatusField);

The only way I was able to eventually track this down was by upgrading my version of PHP from 7.0.8 to 7.0.17, to run the copy of your site with. The changed code now works in all PHP versions.

I also suspect that the issue with params showing up as objects instead of arrays may well be something to do with some changes in the behavior of json_encode in PHP 7.0.17, very probably stemming fro the same underlying issue causing issues with casting between arrays and objects.

It wound up taking right at 4 hours. So we'll need to bill you for half of that.

-- hugh
 
Ok Hugh... Please tell me how it will be processed... Will you send me an invoice?

Thanks for resolving the issues!
 
Hugh,

I'm trying to use the following code in purchase item, but does not recognize the placeholders!

Code:
$db =JFactory::getDBO();
$num_sess = '{liquidacao_sessoes_fisiot__num_sess_liquidadas}';
$ref = '{liquidacao_sessoes_fisiot__id}';
return 'Pagamento de ' . $num_sess . 'consultas (REF' . $ref .')';

The result is "Pagamento de {liquidacao_sessoes_fisiot__num_sess_liquidadas}consultas (REF{liquidacao_sessoes_fisiot__id}) "

Is this a known issue?
 
Hugh,

Sorry for bothering you again but now I've tried for a new record id and nothing happens no emails and no IPN data.

You can see attached the Fabrik_log for message_type fabrik.paypal.onAfterProcess (It's the only message I have after submit... It's missing fabrik.ipn.start, form.paypal.ipndebug.ipn_query and form.paypal.ipn.Pending)

You can find my Paypal plugin config in http://www.fisiolar.pt/administrator/index.php?option=com_fabrik&view=form&layout=edit&id=15#
You can use your sandbox account for test purposes.

Than you can test using the following record http://www.fisiolar.pt/index.php/pt/financas/liquidar-sessoes/form/15/4965
Just hit "Pagar Agora" in the end of the form"

If needed... use the component "VJ Data Base Tool" and for the table "liquidacao_sessoes_fisiot" and id=4965 you can see the IPN values.

I've made some changes to my form and also updated IPN_custom_value to "
Titular- [first_name] [last_name], ID- [payer_id], Email- [receiver_email], Processado- [payment_date]" but I've then put it again has it was with no luck.

Don't have a clue why this is happening... Please help. Thanks in advance
 

Attachments

  • fabrik_log.txt
    15.3 KB · Views: 38
Last edited:
Hugh,

It seams that it's working... forget my previous post. The problem is that the result does not arrive immediately upon submission!

Is this the normal behavior? I had to wait about 15 minutes to receive the emails and IPN DATA.

Also the state is always like "Pending" is it normal should not be "Completed"?
 
Last edited:
Is this the normal behavior? I had to wait about 15 minutes to receive the emails and IPN DATA.

That's down to PayPal. IPN is a callback. So the buyer gets redirected to PayPal's site, and hits the Pay button. That then goes in PayPal's processing queue, and they call your site back with the URL we give them. When testing with your site here, I was getting callbacks in about 30 to 45 seconds, but it can vary tremendously.

Check your sandbox accounts. I seem to recall during testing I noticed it was a currency exchange payment, so the buyer is in one currency and the seller is another, so it'll be in "Pending" status until the seller accepts the payment manually.

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

Thank you.

Members online

Back
Top