Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Enable Recurring Payments in Vantage with simple code edits

  1. #1
    Forum Member martinkoss's Avatar
    Join Date
    Jul 2011
    Location
    United Kingdom
    Posts
    116
    Thanks
    25
    Thanked 22 Times in 13 Posts

    Enable Recurring Payments in Vantage with simple code edits

    OK. This is NOT an official fix or solution but it works. I had to find a way to get recurring payments working without holding my breath for months and months for a 'maybe'! Once I found where the code was, this took me an hour to do. So, my question, if a numpty like me can do this, why is it taking 'AppThemes' so long to implement it officially?

    PayPal-Code-Edits.jpg

    None of this is done through the dashboard, I'm not that clever!

    The only file being edited is
    themes > vantage > includes > payments > gateways > paypal > paypal-form.php

    Look at the image to see the lines I changed to send recurring payment info to PayPal (in my example, I also included a free period).

    (Line numbers are approximate)

    Line 31:
    Code:
    'cmd' => '_xclick',
    change to
    Code:
    'cmd' => '_xclick-subscriptions',
    To add a free trial period or a reduced price period, you'll need something like this:

    Code:
    // Trial Period (free for 3 months)
    $fields['a1'] = '0';
    $fields['p1'] = '3';
    $fields['t1'] = 'M';
    Look for this line (about 47)
    Code:
    $fields['amount'] = $order->get_total();
    and change the field name to a3, like this
    Code:
    $fields['a3'] = $order->get_total();
    a3 is the field name PayPal uses as the regular payment for each period in the recurring billing.

    Underneath that a3 line, add 2 more lines that tell PayPal how many periods per payment and what a period is, in this case the number of periods per payment is '1' and the period is 1 'Y'ear.
    Code:
    $fields['p3'] = '1';
    $fields['t3'] = 'Y';
    Finally, we have to enable the recurring payment and tell PayPal to try again if payment fails the first time (all standard PayPal stuff) and that is done with these two fields.

    Code:
    // enable recurring payments
    $fields['src'] = '1';
    $fields['sra'] = '1';
    The first line 'src' is required else the recurring payments will NOT be enabled.
    The second line 'sra' is optional, that tells PayPal to try again if the payment fails for any reason.

    DISCLAIMER: This is NOT an official Vantage fix. It was coded by myself to accommodate my client's directory requirements. It works for us.

    Hope it works for you... All contributions gladly received!!!

    Martin

  2. The Following User Says Thank You to martinkoss For This Useful Post:

    annonse (March 12th, 2014)

  3. #2
    red20me's Avatar
    Join Date
    Jul 2013
    Location
    United Kingdom
    Posts
    473
    Thanks
    1
    Thanked 104 Times in 93 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #3
    Forum Member martinkoss's Avatar
    Join Date
    Jul 2011
    Location
    United Kingdom
    Posts
    116
    Thanks
    25
    Thanked 22 Times in 13 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  5. The Following 2 Users Say Thank You to martinkoss For This Useful Post:

    annonse (March 12th, 2014), lduke (November 13th, 2013)

  6. #4
    luxor's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    599
    Thanks
    8
    Thanked 141 Times in 74 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  7. #5
    Junior Member lduke's Avatar
    Join Date
    Jul 2010
    Location
    United States
    Posts
    31
    Thanks
    1
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  8. #6
    Forum Member martinkoss's Avatar
    Join Date
    Jul 2011
    Location
    United Kingdom
    Posts
    116
    Thanks
    25
    Thanked 22 Times in 13 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  9. The Following User Says Thank You to martinkoss For This Useful Post:

    annonse (March 12th, 2014)

  10. #7
    Forum Member martinkoss's Avatar
    Join Date
    Jul 2011
    Location
    United Kingdom
    Posts
    116
    Thanks
    25
    Thanked 22 Times in 13 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  11. The Following User Says Thank You to martinkoss For This Useful Post:

    annonse (March 12th, 2014)

  12. #8
    luxor's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    599
    Thanks
    8
    Thanked 141 Times in 74 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  13. #9
    Rookie wentforgold's Avatar
    Join Date
    Nov 2013
    Location
    Australia
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  14. #10
    Amateur adzonline's Avatar
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    15
    Thanks
    1
    Thanked 1 Time in 1 Post
    You must be an AppThemes customer and logged in to view this response. Join today!

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Need Recurring Payments for Vantage and option to receive payment via check
    By ndoilconnect in forum Vantage General Discussion (Legacy)
    Replies: 78
    Last Post: December 20th, 2015, 12:46 PM
  2. Recurring payments on Vantage
    By woury13 in forum Help Using Vantage (Legacy)
    Replies: 2
    Last Post: October 29th, 2013, 06:06 AM
  3. Dimitris Why can't we get date for Vantage recurring payments?
    By jbshort in forum Help Using Vantage (Legacy)
    Replies: 5
    Last Post: September 17th, 2013, 10:11 AM