WordPress.org

Ready to get started?Download WordPress

Forums

Pronamic iDEAL
[resolved] Sisow callback function is being called twice (8 posts)

  1. miepiemappie
    Member
    Posted 1 year ago #

    The Sisow callback function is being called twice, which has the effect that notification emails are being sent twice. Can this be solved please? Thanks in advance!

    http://wordpress.org/extend/plugins/pronamic-ideal/

  2. Remco Tolsma
    Member
    Plugin Author

    Posted 1 year ago #

    We did some adjustments in the Pronamic iDEAL plugin:
    https://github.com/pronamic/wp-pronamic-ideal/commit/067aa7c5739c0055575b0cfd54c5076297d2a01c

    You replied with the following message:

    I implemented the changes, but it still gives me two notifications :(

    Did you implement the changes yourself or did you just downloaded and installed the development version of our plugin?

    https://github.com/pronamic/wp-pronamic-ideal/archive/master.zip

    The 'fulfill_order' function can now only be called once if the payment status isn't approved already.

    https://github.com/pronamic/wp-pronamic-ideal/blob/master/classes/Pronamic/GravityForms/IDeal/AddOn.php#L216

  3. miepiemappie
    Member
    Posted 1 year ago #

    I implemented the changes myself, so I have set:

    case Pronamic_Gateways_IDealAdvanced_Transaction::STATUS_SUCCESS:
    if ( ! Pronamic_GravityForms_IDeal_Entry::is_payment_approved( $lead ) ) {
    // Only fullfill order if the payment isn't approved aloready
    $lead[Pronamic_GravityForms_GravityForms::LEAD_PROPERTY_PAYMENT_STATUS] = Pronamic_GravityForms_GravityForms::PAYMENT_STATUS_APPROVED;
    
    self::fulfill_order( $lead );
    }
    
    $url = $feed->getUrl( Pronamic_GravityForms_IDeal_Feed::LINK_SUCCESS );
    
    break;

    And I made a new file Entry.php with the code you provided...

    I understand your code and I also don't know why is doesn't work. Could it be a timing issue, what I mean is, that Sisow is calling twice rapidly after eachother, so the payment status has not yet been updated in the DB before the second call is made?

  4. Remco Tolsma
    Member
    Plugin Author

    Posted 1 year ago #

    Maybe you should try to just download and install the development version of the Pronamic iDEAL plugin:

    https://github.com/pronamic/wp-pronamic-ideal/archive/master.zip

    I understand your code and I also don't know why is doesn't work. Could it be a timing issue, what I mean is, that Sisow is calling twice rapidly after eachother, so the payment status has not yet been updated in the DB before the second call is made?

    I can't reproduce the problem, so i'm not sure this is the problem. The Pronamic iDEAL plugin requests the status of the payment self, so i don't think it is an timing issue.

    You do use the latest version of the Gravity Forms plugin?
    Versie: 1.6.12

    You also don't have any custom made code in the active themes or plugins?

  5. miepiemappie
    Member
    Posted 1 year ago #

    I solved the issue, I had my custom script placed in the fulfill_order function and after I placed in the update_status function, I get the notification only once. I don't really inderstand why that is, but it's working now, so that's good.
    Thanks for the help though!

  6. Remco Tolsma
    Member
    Plugin Author

    Posted 1 year ago #

    Did you add an custom script into the Pronamic iDEAL plugin? You should try to avoid that...

  7. miepiemappie
    Member
    Posted 1 year ago #

    I've add a script that automatically creates an invoice in Moneybird...where else could I add that?

  8. Remco Tolsma
    Member
    Plugin Author

    Posted 1 year ago #

    You could hook in to the following action:

    do_action( 'gform_ideal_fulfillment', $entry, $feed );

    https://github.com/pronamic/wp-pronamic-ideal/blob/master/classes/Pronamic/GravityForms/IDeal/AddOn.php#L268

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic