PayPal » History » Version 1
Jon Goldberg, 02/12/2016 05:30 PM
1 | 1 | Jon Goldberg | h1. PayPal |
---|---|---|---|
2 | |||
3 | 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. |
||
4 | |||
5 | |||
6 | h3. Resending an IPN |
||
7 | |||
8 | h3. Modifying an IPN to reflect an updated CiviCRM contact ID, etc. |
||
9 | |||
10 | 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. |
||
11 | |||
12 | I built a new recurring contribution from scratch. I compared an existing recurring contribution[1] and then used the values from an IPN that corresponded to Carolyn[2] |
||
13 | [1] select * from civicrm_contribution_recur WHERE id = 700; |
||
14 | [2] select * from civicrm_system_log WHERE id = 223; |
||
15 | |||
16 | * This is the SQL to create the recurring contribution. |
||
17 | 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) |
||
18 | 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); |
||
19 | |||
20 | * Then you need a fake initial contribution, which I built by hand as well: |
||
21 | 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) |
||
22 | VALUES (90779, 7, 3, 1, '2015-06-29 13:00:00', 12.50, .44, 12.06, 'zzzyyyxxx', 'xxxyyyzzz', 'USD', 'Created by Jon', 975, 1); |
||
23 | |||
24 | |||
25 | PayPal: |
||
26 | My Account > Profile |
||
27 | Recurring Payments Dashboard (https://www.paypal.com/us/cgi-bin/webscr?cmd=_merchant-hub) |
||
28 | Scrolled back to the creation date and clicked on Carolyn's name |
||
29 | Clicked "Modify". |
||
30 | 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. |
||
31 | * I changed the URL values: |
||
32 | i = invoice id (don't change - set contribution_recur_id to match) |
||
33 | m = component (keep as "contribute") |
||
34 | c = contact id (change if necessary) |
||
35 | r = recurring contribution id (change) |
||
36 | b = initial contribution ID (change) |
||
37 | p = participant_id OR contribution_page_id (keep) |
||
38 | * Press Continue, then Submit |
||
39 | |||
40 | 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. |