Announcement

Collapse
No announcement yet.

Question about Payment Status Codes

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Question about Payment Status Codes

    I was wondering if there are any other statuses associated with the {payment_status} merge tag besides 'Approved' and 'Failed'?

    The reason I ask is it appears that Gravity Forms has updated their code they use to populate the Payment Details field, which checks an array of payment status codes in order to populate the Payment Details field on the 'Entry' page. Gravity Forms did not include 'Approved' or 'Failed' as part of that array, so the Payment Details box was showing up empty, and we had to construct an array of the C&P status codes for Gravity Forms to check in order to get the Payment Details box populated.

    If there are more status codes besides 'Approved' and 'Failed' could you please provide them so we can build the array we need properly? Thank you

  • #2
    Good day @PatODay

    Would you please submit a support ticket at http://help.clickandpledge.com with FTP and admin login details as well as the website URL so we can review your entire configuration. Include the link to this post in the ticket for reference.

    Please let us know when you have submitted the ticket. Do not post the requested information in this forum as this is a public forum.
    Regards,
    Click & Pledge Support Department

    On Salesforce? Help us by rating our app: Click & Pledge Donor Management on AppExchange

    Join us @ the educational webinars: https://clickandpledge.com/webinars/
    Live Support available Join between 3:00 - 3:30 p.m. ET Monday - Thursday: https://clickandpledge.com/webinars/
    Are you on Salesforce? Join us at the Power of Us Hub: https://powerofus.force.com/0F980000000CjpC

    Comment


    • #3
      CnP.Support.AM I'm not going to submit a support ticket or provide FTP access as I don't think this issue requires that since it's an issue that came up when updating the Gravity Forms plugin and not the Click & Pledge plugin. I just need to know if there are any more payment status codes that Click & Pledge uses aside from 'Approved' and 'Failed'.

      The array of payment statuses Gravity Forms is checking by default is:

      Code:
      $payment_statuses = array(
                              'Authorized' => esc_html__( 'Authorized', 'gravityforms' ),
                              'Paid'       => esc_html__( 'Paid', 'gravityforms' ),
                              'Processing' => esc_html__( 'Processing', 'gravityforms' ),
                              'Failed'     => esc_html__( 'Failed', 'gravityforms' ),
                              'Active'     => esc_html__( 'Active', 'gravityforms' ),
                              'Cancelled'  => esc_html__( 'Cancelled', 'gravityforms' ),
                              'Pending'    => esc_html__( 'Pending', 'gravityforms' ),
                              'Refunded'   => esc_html__( 'Refunded', 'gravityforms' ),
                              'Voided'     => esc_html__( 'Voided', 'gravityforms' ),
                      );
      As you can see 'Approved' is not one of the statuses they are currently checking for, so when a payment is submitted through Gravity Forms and processed by Click & Pledge if the payment status is 'Approved' the 'Payment Details' meta box on the form entry page is blank because 'Approved' did not match any of the statuses in the array. We can add 'Approved' to the array using:

      Code:
      add_filter( 'gform_payment_statuses', 'add_new_status', 10, 1 );
      function add_new_status( $payment_statuses ){
          $payment_statuses['Approved'] = 'Approved';
          return $payment_statuses;
      }
      So I just need to know what other status codes Click & Pledge would use for payment status so we can add those to the add_new_status function to ensure that the payment details are populated on the entry pages no matter what the payment status is.

      Comment


      • #4
        Well, the reason we have asked you to share the details because we are passing the value to the payment status in Payment Details as Approved otherwise Failed. Please see:

        Click image for larger version

Name:	payment status.jpg
Views:	12
Size:	21.4 KB
ID:	49393

        One of our developers wants to review your instance to see why you are not receiving the status.
        Regards,
        Click & Pledge Support Department

        On Salesforce? Help us by rating our app: Click & Pledge Donor Management on AppExchange

        Join us @ the educational webinars: https://clickandpledge.com/webinars/
        Live Support available Join between 3:00 - 3:30 p.m. ET Monday - Thursday: https://clickandpledge.com/webinars/
        Are you on Salesforce? Join us at the Power of Us Hub: https://powerofus.force.com/0F980000000CjpC

        Comment


        • #5
          Originally posted by CnP.Support.AM View Post
          because we are passing the value to the payment status in Payment Details as Approved otherwise Failed.
          And there is the problem. Gravity Forms no longer recognizes "Approved" as a valid status. Thus, when you pass the value of "Approved" back to Gravity Forms, they in turn return blank since "Approved" is not in their list of supported payment statuses.

          Please see line 5101 of common.php of the Gravity Forms codebase: get_entry_payment_statuses(). That method returns an array of supported entry payment statuses. "Approved" is not one of them. Thus, in order for us to show "Approved" that C&P sets, we have to use this custom code:

          // custom payment statuses
          // ensures click & pledge payment details show on the entry screen in gravity forms
          add_filter( 'gform_payment_statuses', 'add_new_status', 10, 1 );
          function add_new_status( $payment_statuses ){
          $payment_statuses['Approved'] = 'Approved';
          return $payment_statuses;
          }

          The reason PatODay was asking for what other statuses you set, is since we now have to keep track of your custom statuses we prefer to get a comprehensive list up front, thus enabling us to not break our code yet again due to your lack of documentation / lack of compliance with Gravity Forms updates.

          Comment

          Working...
          X