Project

General

Profile

Troubleshooting PayPal and CiviCRM » History » Version 1

Jon Goldberg, 03/20/2019 08:16 PM

1 1 Jon Goldberg
{{last_updated_at}} by {{last_updated_by}}
2 1 Jon Goldberg
3 1 Jon Goldberg
{{>toc}}
4 1 Jon Goldberg
5 1 Jon Goldberg
# Troubleshooting PayPal and CiviCRM
6 1 Jon Goldberg
7 1 Jon Goldberg
PayPal is very difficult to navigate, and very difficult to handle certain tasks that come up time and again, particularly around recurring payments. I'm documenting them here for future reference.
8 1 Jon Goldberg
General CiviCRM documentation
9 1 Jon Goldberg
10 1 Jon Goldberg
http://wiki.civicrm.org/confluence/display/CRMDOC/PayPal+Website+Payments+Standard+and+Recurring+Contributions
11 1 Jon Goldberg
http://wiki.civicrm.org/confluence/display/CRMDOC/PayPal+Website+Payments+Pro+and+Express+Configuration
12 1 Jon Goldberg
### Setting a URL for IPN callbacks
13 1 Jon Goldberg
14 1 Jon Goldberg
Go here: https://www.paypal.com/us/cgi-bin/?cmd=_profile-ipn-notify
15 1 Jon Goldberg
16 1 Jon Goldberg
### Resending an IPN
17 1 Jon Goldberg
18 1 Jon Goldberg
Do this from the IPN History page: https://www.paypal.com/us/cgi-bin/webscr?cmd=_display-ipns-history. Note the only way to find this page is from the "Setting the IPN callback" link above.
19 1 Jon Goldberg
20 1 Jon Goldberg
### Modifying an IPN to reflect an updated CiviCRM contact ID, etc.
21 1 Jon Goldberg
22 1 Jon Goldberg
This is my raw documentation for the most complicated version of this. In this case, a user had a recurring membership/contribution, but a database restore eliminated all references in CiviCRM to it. However, the recurring payment profile still existed in PayPal.
23 1 Jon Goldberg
24 1 Jon Goldberg
I built a new recurring contribution from scratch. I compared an existing recurring contribution: 
25 1 Jon Goldberg
```sql
26 1 Jon Goldberg
select * from civicrm_contribution_recur WHERE id = 700;
27 1 Jon Goldberg
```
28 1 Jon Goldberg
to the values from an IPN that corresponded to Carolyn:
29 1 Jon Goldberg
```sql
30 1 Jon Goldberg
select * from civicrm_system_log WHERE id = 223;
31 1 Jon Goldberg
```
32 1 Jon Goldberg
33 1 Jon Goldberg
This is the SQL to create the recurring contribution.
34 1 Jon Goldberg
35 1 Jon Goldberg
```sql
36 1 Jon Goldberg
INSERT into civicrm_contribution_recur (contact_id, amount, frequency_unit, frequency_interval, start_date, processor_id, trxn_id, invoice_id, contribution_status_id, cycle_day, auto_renew, currency, payment_processor_id, is_email_receipt, financial_type_id, payment_instrument_id) VALUES (90779, 12.50, 'month', 1, '2015-06-19 13:00:00', 'I-JAMLNHRXDD21', 'I-JAMLNHRXDD21', '14e0fcc045a7aa421a1b5c6c86d87e97', 5, 1, 1, 'USD', 3, 1, 7, 1);
37 1 Jon Goldberg
```
38 1 Jon Goldberg
39 1 Jon Goldberg
Then you need a fake initial contribution, which I built by hand as well:
40 1 Jon Goldberg
41 1 Jon Goldberg
```sql
42 1 Jon Goldberg
INSERT INTO civicrm_contribution (contact_id, financial_type_id, contribution_page_id, payment_instrument_id, receive_date, total_amount, fee_amount, net_amount, trxn_id, invoice_id, currency, source, contribution_recur_id, contribution_status_id) VALUES (90779, 7, 3, 1, '2015-06-29 13:00:00', 12.50, .44, 12.06, 'zzzyyyxxx', 'xxxyyyzzz', 'USD', 'Created by Jon', 975, 1);
43 1 Jon Goldberg
```
44 1 Jon Goldberg
45 1 Jon Goldberg
#### In PayPal
46 1 Jon Goldberg
* My Account > Profile
47 1 Jon Goldberg
* Recurring Payments Dashboard (https://www.paypal.com/us/cgi-bin/webscr?cmd=_merchant-hub)
48 1 Jon Goldberg
* Scrolled back to the creation date and clicked on Carolyn's name
49 1 Jon Goldberg
* Clicked "Modify".
50 1 Jon Goldberg
* The profile reference has a bogus maximum field length, so I right-clicked, selected "Inspect Element", and manually changed the "maxlength" value so I could edit it.
51 1 Jon Goldberg
52 1 Jon Goldberg
I changed the URL values:
53 1 Jon Goldberg
54 1 Jon Goldberg
    i = invoice id (don't change - set contribution_recur_id to match)
55 1 Jon Goldberg
    m = component (keep as "contribute")
56 1 Jon Goldberg
    c = contact id (change if necessary)
57 1 Jon Goldberg
    r = recurring contribution id (change)
58 1 Jon Goldberg
    b = initial contribution ID (change)
59 1 Jon Goldberg
    p = participant_id OR contribution_page_id (keep)
60 1 Jon Goldberg
    Press Continue, then Submit
61 1 Jon Goldberg
62 1 Jon Goldberg
Finally, I created a new membership through the UI (46913) and edited THAT manually to have updated end date. I also created a membership_payment record.
Go to top