Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-5106

PayPal Payments Standard: Add a textarea to allow manual mapping of payments

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.9.0
    • Fix Version/s: 5.11.0-b1
    • Component/s: Gateways
    • Labels:
      None

      Description

      Background

      When people migrate from WHMCS (or another solution) and they have PayPal Subscriptions active, we instruct them to create a redirect to translate those IPN calls to a URL Blesta can use. For example, we tell people to add the following to their .htaccess file:

      Redirect 301 /modules/gateways/callback/paypal.php /callback/gw/1/paypal_payments_standard/

      However, a typical IPN URL that is created by Blesta looks something like this:

      /callback/gw/1/paypal_payments_standard/?client_id=12345

      Note that the client_id is included in the IPN URL. Blesta uses this to match the payment to a particular client based on the internal ID. With these redirected IPN calls, no such client_id is provided.

      In the absense of the client_id being provided, Blesta falls back to trying to match the payer_email to a client's email address. However, if there is no match, the payment cannot be recorded. This is common, because clients often pay with a different PayPal email than they sign up with.

      Proposed Solution

      Update the PayPal Payments Standard gateway to add a textarea field at the bottom, below the "Developer Mode" checkbox. Give it a label of "Payment Mapping (Advanced Use Only)". Add a tooltip that says. "Intended for use with PayPal Subscriptions that were created outside of Blesta. Map payer_email to internal Client ID, 1 per line. For example: email,client-id"

      We should be able to store a lot of these under gateway_meta.value as it's a text field.

      Then, when we receive an IPN call from PayPal, we do the folowing:

      • If the URL contains the client_id, use this as we do currently (no change)
      • If the URL does not contain the client_id, try to match the payer_email in the IPN request to a client-id as provided in the mapping data. If it exists, apply the payment.
      • Finally, if the client_id is not provided in the IPN URL, and there is no mapping data match for the payer_email, try to match on client email as we do currently.

      When saving the mapping data, make sure all payer_emails are unique, display an error if they are not:

      Duplicate emails were found in your mapping data, remove duplicates and try again.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            abdy Abdy Franco
            Reporter:
            admin Paul Phillips
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 2 hours, 45 minutes
              2h 45m

                Agile