<?xml version="1.0" encoding="UTF-8"?>
<ticket>
  <assigned-user-id type="integer" nil="true"></assigned-user-id>
  <attachments-count type="integer">3</attachments-count>
  <closed type="boolean">false</closed>
  <created-at type="datetime">2010-01-02T09:55:02-05:00</created-at>
  <creator-id type="integer">4642</creator-id>
  <milestone-due-on type="datetime" nil="true"></milestone-due-on>
  <milestone-id type="integer" nil="true"></milestone-id>
  <number type="integer">17</number>
  <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
  <priority type="integer">14471</priority>
  <project-id type="integer">11599</project-id>
  <raw-data type="binary" nil="true" encoding="base64"></raw-data>
  <state>new</state>
  <tag>patch paypal recurring</tag>
  <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
  <updated-at type="datetime">2010-01-02T09:55:02-05:00</updated-at>
  <user-id type="integer">32315</user-id>
  <user-name>pjammer</user-name>
  <creator-name>Cody Fauser</creator-name>
  <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
  <original-body>Reported by jxtps435, Apr 23, 2008
Any chance of adding the PayPal recurring payments profile gateway posted on the URL below? 

http://snippets.dzone.com/posts/show/5292

(or merging it with the existing  paypal express gateway)

Thanks!

# simple extension to ActiveMerchant for basic support of recurring payments with Express Checkout API
# 
# NOTE: set pem_file when loading
module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    class PaypalExpressRecurringGateway &lt; Gateway
      include PaypalCommonAPI

      LIVE_REDIRECT_URL = 'https://www.paypal.com/cgibin/webscr?cmd=_customer-billing-agreement&amp;token='
      TEST_REDIRECT_URL = 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_customer-billing-agreement&amp;token='

      def redirect_url
        test? ? TEST_REDIRECT_URL : LIVE_REDIRECT_URL
      end

      def redirect_url_for(token)
        &quot;#{redirect_url}#{token}&quot;
      end

      def setup_agreement(description, return_url, cancel_url)
        commit 'SetCustomerBillingAgreement', build_setup_request(description, return_url, cancel_url)
      end

      def create_profile(token, description, period, cycles, amount)
        commit 'CreateRecurringPaymentsProfile', build_create_profile_request(token, description, period, cycles, amount)
      end

      def get_profile_details(profile_id)
        commit 'GetRecurringPaymentsProfileDetails', build_get_profile_details_request(profile_id)
      end

    private
      def build_setup_request(description, return_url, cancel_url)
        xml = Builder::XmlMarkup.new :indent =&gt; 2
        xml.tag! 'SetCustomerBillingAgreementReq', 'xmlns' =&gt; PAYPAL_NAMESPACE do
          xml.tag! 'SetCustomerBillingAgreementRequest', 'xmlns:n2' =&gt; EBAY_NAMESPACE do
            xml.tag! 'n2:Version', 50
            xml.tag! 'n2:SetCustomerBillingAgreementRequestDetails' do
              xml.tag! 'n2:BillingAgreementDetails' do
                xml.tag! 'n2:BillingType', 'RecurringPayments'
                xml.tag! 'n2:BillingAgreementDescription', description
              end
              xml.tag! 'n2:ReturnURL', return_url
              xml.tag! 'n2:CancelURL', cancel_url
            end
          end
        end
        xml.target!
      end

      def build_create_profile_request(token, description, period, cycles, money)
        xml = Builder::XmlMarkup.new :indent =&gt; 2
        xml.tag! 'CreateRecurringPaymentsProfileReq', 'xmlns' =&gt; PAYPAL_NAMESPACE do
          xml.tag! 'CreateRecurringPaymentsProfileRequest', 'xmlns:n2' =&gt; EBAY_NAMESPACE do
            xml.tag! 'n2:Version', 50
            xml.tag! 'n2:CreateRecurringPaymentsProfileRequestDetails' do
              xml.tag! 'Token', token
              xml.tag! 'n2:RecurringPaymentsProfileDetails' do
                xml.tag! 'n2:BillingStartDate', Time.now.utc.iso8601
              end
              xml.tag! 'n2:ScheduleDetails' do
                xml.tag! 'n2:Description', description
                xml.tag! 'n2:PaymentPeriod' do
                  xml.tag! 'n2:BillingPeriod', 'Day'
                  xml.tag! 'n2:BillingFrequency', period
                  xml.tag! 'n2:TotalBillingCycles', cycles
                  xml.tag! 'n2:Amount', amount(money), 'currencyID' =&gt; currency(money)
                end
              end
            end
          end
        end

        xml.target!
      end

      def build_get_profile_details_request(profile_id)
        xml = Builder::XmlMarkup.new :indent =&gt; 2
        xml.tag! 'GetRecurringPaymentsProfileDetailsReq', 'xmlns' =&gt; PAYPAL_NAMESPACE do
          xml.tag! 'GetRecurringPaymentsProfileDetailsRequest', 'xmlns:n2' =&gt; EBAY_NAMESPACE do
            xml.tag! 'n2:Version', 50
            xml.tag! 'ProfileID', profile_id
          end
        end

        xml.target!
      end

      def build_response(success, message, response, options = {})
        PaypalExpressResponse.new(success, message, response, options)
      end

    end
  end
end</original-body>
  <latest-body>Reported by jxtps435, Apr 23, 2008
Any chance of adding the PayPal recurring payments profile gateway posted on the URL below? 

http://snippets.dzone.com/posts/show/5292

(or merging it with the existing  paypal express gateway)

Thanks!

# simple extension to ActiveMerchant for basic support of recurring payments with Express Checkout API
# 
# NOTE: set pem_file when loading
module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    class PaypalExpressRecurringGateway &lt; Gateway
      include PaypalCommonAPI

      LIVE_REDIRECT_URL = 'https://www.paypal.com/cgibin/webscr?cmd=_customer-billing-agreement&amp;token='
      TEST_REDIRECT_URL = 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_customer-billing-agreement&amp;token='

      def redirect_url
        test? ? TEST_REDIRECT_URL : LIVE_REDIRECT_URL
      end

      def redirect_url_for(token)
        &quot;#{redirect_url}#{token}&quot;
      end

      def setup_agreement(description, return_url, cancel_url)
        commit 'SetCustomerBillingAgreement', build_setup_request(description, return_url, cancel_url)
      end

      def create_profile(token, description, period, cycles, amount)
        commit 'CreateRecurringPaymentsProfile', build_create_profile_request(token, description, period, cycles, amount)
      end

      def get_profile_details(profile_id)
        commit 'GetRecurringPaymentsProfileDetails', build_get_profile_details_request(profile_id)
      end

    private
      def build_setup_request(description, return_url, cancel_url)
        xml = Builder::XmlMarkup.new :indent =&gt; 2
        xml.tag! 'SetCustomerBillingAgreementReq', 'xmlns' =&gt; PAYPAL_NAMESPACE do
          xml.tag! 'SetCustomerBillingAgreementRequest', 'xmlns:n2' =&gt; EBAY_NAMESPACE do
            xml.tag! 'n2:Version', 50
            xml.tag! 'n2:SetCustomerBillingAgreementRequestDetails' do
              xml.tag! 'n2:BillingAgreementDetails' do
                xml.tag! 'n2:BillingType', 'RecurringPayments'
                xml.tag! 'n2:BillingAgreementDescription', description
              end
              xml.tag! 'n2:ReturnURL', return_url
              xml.tag! 'n2:CancelURL', cancel_url
            end
          end
        end
        xml.target!
      end

      def build_create_profile_request(token, description, period, cycles, money)
        xml = Builder::XmlMarkup.new :indent =&gt; 2
        xml.tag! 'CreateRecurringPaymentsProfileReq', 'xmlns' =&gt; PAYPAL_NAMESPACE do
          xml.tag! 'CreateRecurringPaymentsProfileRequest', 'xmlns:n2' =&gt; EBAY_NAMESPACE do
            xml.tag! 'n2:Version', 50
            xml.tag! 'n2:CreateRecurringPaymentsProfileRequestDetails' do
              xml.tag! 'Token', token
              xml.tag! 'n2:RecurringPaymentsProfileDetails' do
                xml.tag! 'n2:BillingStartDate', Time.now.utc.iso8601
              end
              xml.tag! 'n2:ScheduleDetails' do
                xml.tag! 'n2:Description', description
                xml.tag! 'n2:PaymentPeriod' do
                  xml.tag! 'n2:BillingPeriod', 'Day'
                  xml.tag! 'n2:BillingFrequency', period
                  xml.tag! 'n2:TotalBillingCycles', cycles
                  xml.tag! 'n2:Amount', amount(money), 'currencyID' =&gt; currency(money)
                end
              end
            end
          end
        end

        xml.target!
      end

      def build_get_profile_details_request(profile_id)
        xml = Builder::XmlMarkup.new :indent =&gt; 2
        xml.tag! 'GetRecurringPaymentsProfileDetailsReq', 'xmlns' =&gt; PAYPAL_NAMESPACE do
          xml.tag! 'GetRecurringPaymentsProfileDetailsRequest', 'xmlns:n2' =&gt; EBAY_NAMESPACE do
            xml.tag! 'n2:Version', 50
            xml.tag! 'ProfileID', profile_id
          end
        end

        xml.target!
      end

      def build_response(success, message, response, options = {})
        PaypalExpressResponse.new(success, message, response, options)
      end

    end
  end
end</latest-body>
  <original-body-html>&lt;div&gt;&lt;p&gt;
Reported by jxtps435, Apr 23, 2008
&lt;/p&gt;&lt;p&gt;
Any chance of adding the PayPal recurring payments profile gateway posted on the URL below?
&lt;/p&gt;&lt;p&gt;
&lt;a href=&quot;http://snippets.dzone.com/posts/show/5292&quot;&gt;http://snippets.dzone.com/posts/...&lt;/a&gt;
&lt;/p&gt;&lt;p&gt;
(or merging it with the existing  paypal express gateway)
&lt;/p&gt;&lt;p&gt;
Thanks!
&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;
simple extension to ActiveMerchant for basic support of recurring payments with Express Checkout API
&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;
#
&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;
NOTE: set pem_file when loading
&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;
module ActiveMerchant #:nodoc:
&lt;/p&gt;&lt;p&gt;
module Billing #:nodoc:
&lt;/p&gt;&lt;p&gt;
class PaypalExpressRecurringGateway &amp;lt; Gateway
&lt;/p&gt;&lt;p&gt;
include PaypalCommonAPI
&lt;/p&gt;&lt;p&gt;
LIVE_REDIRECT_URL = 'https://www.paypal.com/cgibin/webscr?cmd=_customer-billing-agreement&amp;token='
&lt;/p&gt;&lt;p&gt;
TEST_REDIRECT_URL = 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_customer-billing-agreement&amp;token='
&lt;/p&gt;&lt;p&gt;
def redirect_url
&lt;/p&gt;&lt;p&gt;
test? ? TEST_REDIRECT_URL : LIVE_REDIRECT_URL
&lt;/p&gt;&lt;p&gt;
end
&lt;/p&gt;&lt;p&gt;
def redirect_url_for(token)
&lt;/p&gt;&lt;p&gt;
&quot;#{redirect_url}#{token}&quot;
&lt;/p&gt;&lt;p&gt;
end
&lt;/p&gt;&lt;p&gt;
def setup_agreement(description, return_url, cancel_url)
&lt;/p&gt;&lt;p&gt;
commit 'SetCustomerBillingAgreement', build_setup_request(description, return_url, cancel_url)
&lt;/p&gt;&lt;p&gt;
end
&lt;/p&gt;&lt;p&gt;
def create_profile(token, description, period, cycles, amount)
&lt;/p&gt;&lt;p&gt;
commit 'CreateRecurringPaymentsProfile', build_create_profile_request(token, description, period, cycles, amount)
&lt;/p&gt;&lt;p&gt;
end
&lt;/p&gt;&lt;p&gt;
def get_profile_details(profile_id)
&lt;/p&gt;&lt;p&gt;
commit 'GetRecurringPaymentsProfileDetails', build_get_profile_details_request(profile_id)
&lt;/p&gt;&lt;p&gt;
end
&lt;/p&gt;&lt;p&gt;
private
&lt;/p&gt;&lt;p&gt;
def build_setup_request(description, return_url, cancel_url)
&lt;/p&gt;&lt;p&gt;
xml = Builder::XmlMarkup.new :indent =&gt; 2
&lt;/p&gt;&lt;p&gt;
xml.tag! 'SetCustomerBillingAgreementReq', 'xmlns' =&gt; PAYPAL_NAMESPACE do
&lt;/p&gt;&lt;p&gt;
xml.tag! 'SetCustomerBillingAgreementRequest', 'xmlns:n2' =&gt; EBAY_NAMESPACE do
&lt;/p&gt;&lt;p&gt;
xml.tag! 'n2:Version', 50
&lt;/p&gt;&lt;p&gt;
xml.tag! 'n2:SetCustomerBillingAgreementRequestDetails' do
&lt;/p&gt;&lt;p&gt;
xml.tag! 'n2:BillingAgreementDetails' do
&lt;/p&gt;&lt;p&gt;
xml.tag! 'n2:BillingType', 'RecurringPayments'
&lt;/p&gt;&lt;p&gt;
xml.tag! 'n2:BillingAgreementDescription', description
&lt;/p&gt;&lt;p&gt;
end
&lt;/p&gt;&lt;p&gt;
xml.tag! 'n2:ReturnURL', return_url
&lt;/p&gt;&lt;p&gt;
xml.tag! 'n2:CancelURL', cancel_url
&lt;/p&gt;&lt;p&gt;
end
&lt;/p&gt;&lt;p&gt;
end
&lt;/p&gt;&lt;p&gt;
end
&lt;/p&gt;&lt;p&gt;
xml.target!
&lt;/p&gt;&lt;p&gt;
end
&lt;/p&gt;&lt;p&gt;
def build_create_profile_request(token, description, period, cycles, money)
&lt;/p&gt;&lt;p&gt;
xml = Builder::XmlMarkup.new :indent =&gt; 2
&lt;/p&gt;&lt;p&gt;
xml.tag! 'CreateRecurringPaymentsProfileReq', 'xmlns' =&gt; PAYPAL_NAMESPACE do
&lt;/p&gt;&lt;p&gt;
xml.tag! 'CreateRecurringPaymentsProfileRequest', 'xmlns:n2' =&gt; EBAY_NAMESPACE do
&lt;/p&gt;&lt;p&gt;
xml.tag! 'n2:Version', 50
&lt;/p&gt;&lt;p&gt;
xml.tag! 'n2:CreateRecurringPaymentsProfileRequestDetails' do
&lt;/p&gt;&lt;p&gt;
xml.tag! 'Token', token
&lt;/p&gt;&lt;p&gt;
xml.tag! 'n2:RecurringPaymentsProfileDetails' do
&lt;/p&gt;&lt;p&gt;
xml.tag! 'n2:BillingStartDate', Time.now.utc.iso8601
&lt;/p&gt;&lt;p&gt;
end
&lt;/p&gt;&lt;p&gt;
xml.tag! 'n2:ScheduleDetails' do
&lt;/p&gt;&lt;p&gt;
xml.tag! 'n2:Description', description
&lt;/p&gt;&lt;p&gt;
xml.tag! 'n2:PaymentPeriod' do
&lt;/p&gt;&lt;p&gt;
xml.tag! 'n2:BillingPeriod', 'Day'
&lt;/p&gt;&lt;p&gt;
xml.tag! 'n2:BillingFrequency', period
&lt;/p&gt;&lt;p&gt;
xml.tag! 'n2:TotalBillingCycles', cycles
&lt;/p&gt;&lt;p&gt;
xml.tag! 'n2:Amount', amount(money), 'currencyID' =&gt; currency(money)
&lt;/p&gt;&lt;p&gt;
end
&lt;/p&gt;&lt;p&gt;
end
&lt;/p&gt;&lt;p&gt;
end
&lt;/p&gt;&lt;p&gt;
end
&lt;/p&gt;&lt;p&gt;
end
&lt;/p&gt;&lt;p&gt;
xml.target!
&lt;/p&gt;&lt;p&gt;
end
&lt;/p&gt;&lt;p&gt;
def build_get_profile_details_request(profile_id)
&lt;/p&gt;&lt;p&gt;
xml = Builder::XmlMarkup.new :indent =&gt; 2
&lt;/p&gt;&lt;p&gt;
xml.tag! 'GetRecurringPaymentsProfileDetailsReq', 'xmlns' =&gt; PAYPAL_NAMESPACE do
&lt;/p&gt;&lt;p&gt;
xml.tag! 'GetRecurringPaymentsProfileDetailsRequest', 'xmlns:n2' =&gt; EBAY_NAMESPACE do
&lt;/p&gt;&lt;p&gt;
xml.tag! 'n2:Version', 50
&lt;/p&gt;&lt;p&gt;
xml.tag! 'ProfileID', profile_id
&lt;/p&gt;&lt;p&gt;
end
&lt;/p&gt;&lt;p&gt;
end
&lt;/p&gt;&lt;p&gt;
xml.target!
&lt;/p&gt;&lt;p&gt;
end
&lt;/p&gt;&lt;p&gt;
def build_response(success, message, response, options = {})
&lt;/p&gt;&lt;p&gt;
PaypalExpressResponse.new(success, message, response, options)
&lt;/p&gt;&lt;p&gt;
end
&lt;/p&gt;&lt;p&gt;
end
&lt;/p&gt;&lt;p&gt;
end
&lt;/p&gt;&lt;p&gt;
end
&lt;/p&gt;&lt;/div&gt;</original-body-html>
  <versions type="array">
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Reported by jxtps435, Apr 23, 2008
Any chance of adding the PayPal recurring payments profile gateway posted on the URL below? 

http://snippets.dzone.com/posts/show/5292

(or merging it with the existing  paypal express gateway)

Thanks!</body>
      <body-html>&lt;div&gt;&lt;p&gt;
Reported by jxtps435, Apr 23, 2008
&lt;/p&gt;&lt;p&gt;
Any chance of adding the PayPal recurring payments profile gateway posted on the URL below?
&lt;/p&gt;&lt;p&gt;
&lt;a href=&quot;http://snippets.dzone.com/posts/show/5292&quot;&gt;http://snippets.dzone.com/posts/...&lt;/a&gt;
&lt;/p&gt;&lt;p&gt;
(or merging it with the existing  paypal express gateway)
&lt;/p&gt;&lt;p&gt;
Thanks!
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-05-22T13:47:10-04:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2008-05-22T13:47:10-04:00</updated-at>
      <user-id type="integer">4642</user-id>
      <user-name>Cody Fauser</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>@@@ Ruby
# simple extension to ActiveMerchant for basic support of recurring payments with Express Checkout API
# 
# NOTE: set pem_file when loading
module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    class PaypalExpressRecurringGateway &lt; Gateway
      include PaypalCommonAPI

      LIVE_REDIRECT_URL = 'https://www.paypal.com/cgibin/webscr?cmd=_customer-billing-agreement&amp;token='
      TEST_REDIRECT_URL = 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_customer-billing-agreement&amp;token='

      def redirect_url
        test? ? TEST_REDIRECT_URL : LIVE_REDIRECT_URL
      end

      def redirect_url_for(token)
        &quot;#{redirect_url}#{token}&quot;
      end

      def setup_agreement(description, return_url, cancel_url)
        commit 'SetCustomerBillingAgreement', build_setup_request(description, return_url, cancel_url)
      end

      def create_profile(token, description, period, cycles, amount)
        commit 'CreateRecurringPaymentsProfile', build_create_profile_request(token, description, period, cycles, amount)
      end

      def get_profile_details(profile_id)
        commit 'GetRecurringPaymentsProfileDetails', build_get_profile_details_request(profile_id)
      end

    private
      def build_setup_request(description, return_url, cancel_url)
        xml = Builder::XmlMarkup.new :indent =&gt; 2
        xml.tag! 'SetCustomerBillingAgreementReq', 'xmlns' =&gt; PAYPAL_NAMESPACE do
          xml.tag! 'SetCustomerBillingAgreementRequest', 'xmlns:n2' =&gt; EBAY_NAMESPACE do
            xml.tag! 'n2:Version', 50
            xml.tag! 'n2:SetCustomerBillingAgreementRequestDetails' do
              xml.tag! 'n2:BillingAgreementDetails' do
                xml.tag! 'n2:BillingType', 'RecurringPayments'
                xml.tag! 'n2:BillingAgreementDescription', description
              end
              xml.tag! 'n2:ReturnURL', return_url
              xml.tag! 'n2:CancelURL', cancel_url
            end
          end
        end
        xml.target!
      end

      def build_create_profile_request(token, description, period, cycles, money)
        xml = Builder::XmlMarkup.new :indent =&gt; 2
        xml.tag! 'CreateRecurringPaymentsProfileReq', 'xmlns' =&gt; PAYPAL_NAMESPACE do
          xml.tag! 'CreateRecurringPaymentsProfileRequest', 'xmlns:n2' =&gt; EBAY_NAMESPACE do
            xml.tag! 'n2:Version', 50
            xml.tag! 'n2:CreateRecurringPaymentsProfileRequestDetails' do
              xml.tag! 'Token', token
              xml.tag! 'n2:RecurringPaymentsProfileDetails' do
                xml.tag! 'n2:BillingStartDate', Time.now.utc.iso8601
              end
              xml.tag! 'n2:ScheduleDetails' do
                xml.tag! 'n2:Description', description
                xml.tag! 'n2:PaymentPeriod' do
                  xml.tag! 'n2:BillingPeriod', 'Day'
                  xml.tag! 'n2:BillingFrequency', period
                  xml.tag! 'n2:TotalBillingCycles', cycles
                  xml.tag! 'n2:Amount', amount(money), 'currencyID' =&gt; currency(money)
                end
              end
            end
          end
        end

        xml.target!
      end

      def build_get_profile_details_request(profile_id)
        xml = Builder::XmlMarkup.new :indent =&gt; 2
        xml.tag! 'GetRecurringPaymentsProfileDetailsReq', 'xmlns' =&gt; PAYPAL_NAMESPACE do
          xml.tag! 'GetRecurringPaymentsProfileDetailsRequest', 'xmlns:n2' =&gt; EBAY_NAMESPACE do
            xml.tag! 'n2:Version', 50
            xml.tag! 'ProfileID', profile_id
          end
        end

        xml.target!
      end

      def build_response(success, message, response, options = {})
        PaypalExpressResponse.new(success, message, response, options)
      end

    end
  end
end
@@@</body>
      <body-html>&lt;div&gt;&lt;pre&gt;&lt;code class=&quot;Ruby&quot;&gt;# simple extension to ActiveMerchant for basic support of recurring payments with Express Checkout API
# 
# NOTE: set pem_file when loading
module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    class PaypalExpressRecurringGateway &amp;lt; Gateway
      include PaypalCommonAPI

      LIVE_REDIRECT_URL = 'https://www.paypal.com/cgibin/webscr?cmd=_customer-billing-agreement&amp;amp;token='
      TEST_REDIRECT_URL = 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_customer-billing-agreement&amp;amp;token='

      def redirect_url
        test? ? TEST_REDIRECT_URL : LIVE_REDIRECT_URL
      end

      def redirect_url_for(token)
        &amp;quot;#{redirect_url}#{token}&amp;quot;
      end

      def setup_agreement(description, return_url, cancel_url)
        commit 'SetCustomerBillingAgreement', build_setup_request(description, return_url, cancel_url)
      end

      def create_profile(token, description, period, cycles, amount)
        commit 'CreateRecurringPaymentsProfile', build_create_profile_request(token, description, period, cycles, amount)
      end

      def get_profile_details(profile_id)
        commit 'GetRecurringPaymentsProfileDetails', build_get_profile_details_request(profile_id)
      end

    private
      def build_setup_request(description, return_url, cancel_url)
        xml = Builder::XmlMarkup.new :indent =&amp;gt; 2
        xml.tag! 'SetCustomerBillingAgreementReq', 'xmlns' =&amp;gt; PAYPAL_NAMESPACE do
          xml.tag! 'SetCustomerBillingAgreementRequest', 'xmlns:n2' =&amp;gt; EBAY_NAMESPACE do
            xml.tag! 'n2:Version', 50
            xml.tag! 'n2:SetCustomerBillingAgreementRequestDetails' do
              xml.tag! 'n2:BillingAgreementDetails' do
                xml.tag! 'n2:BillingType', 'RecurringPayments'
                xml.tag! 'n2:BillingAgreementDescription', description
              end
              xml.tag! 'n2:ReturnURL', return_url
              xml.tag! 'n2:CancelURL', cancel_url
            end
          end
        end
        xml.target!
      end

      def build_create_profile_request(token, description, period, cycles, money)
        xml = Builder::XmlMarkup.new :indent =&amp;gt; 2
        xml.tag! 'CreateRecurringPaymentsProfileReq', 'xmlns' =&amp;gt; PAYPAL_NAMESPACE do
          xml.tag! 'CreateRecurringPaymentsProfileRequest', 'xmlns:n2' =&amp;gt; EBAY_NAMESPACE do
            xml.tag! 'n2:Version', 50
            xml.tag! 'n2:CreateRecurringPaymentsProfileRequestDetails' do
              xml.tag! 'Token', token
              xml.tag! 'n2:RecurringPaymentsProfileDetails' do
                xml.tag! 'n2:BillingStartDate', Time.now.utc.iso8601
              end
              xml.tag! 'n2:ScheduleDetails' do
                xml.tag! 'n2:Description', description
                xml.tag! 'n2:PaymentPeriod' do
                  xml.tag! 'n2:BillingPeriod', 'Day'
                  xml.tag! 'n2:BillingFrequency', period
                  xml.tag! 'n2:TotalBillingCycles', cycles
                  xml.tag! 'n2:Amount', amount(money), 'currencyID' =&amp;gt; currency(money)
                end
              end
            end
          end
        end

        xml.target!
      end

      def build_get_profile_details_request(profile_id)
        xml = Builder::XmlMarkup.new :indent =&amp;gt; 2
        xml.tag! 'GetRecurringPaymentsProfileDetailsReq', 'xmlns' =&amp;gt; PAYPAL_NAMESPACE do
          xml.tag! 'GetRecurringPaymentsProfileDetailsRequest', 'xmlns:n2' =&amp;gt; EBAY_NAMESPACE do
            xml.tag! 'n2:Version', 50
            xml.tag! 'ProfileID', profile_id
          end
        end

        xml.target!
      end

      def build_response(success, message, response, options = {})
        PaypalExpressResponse.new(success, message, response, options)
      end

    end
  end
end&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-05-22T13:46:52-04:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2008-05-22T13:46:52-04:00</updated-at>
      <user-id type="integer">4642</user-id>
      <user-name>Cody Fauser</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Any word on this being integrated? If not is there any more detailed information on using this extension?</body>
      <body-html>&lt;div&gt;&lt;p&gt;Any word on this being integrated? If not is there any more detailed information on using this extension?&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-08-24T23:56:44-04:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- 
:tag: 
</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2008-08-24T23:56:44-04:00</updated-at>
      <user-id type="integer">25908</user-id>
      <user-name>esparkman</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">82</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Hi there,

I thought I would add to this and write a quick version of this that uses the PayPal NVP API. I am about to write a quick usage guide on my blog though it may not be up for a day or so (it's still a draft) but I have included the url in the comment.

Esparkman, to get this working before implmentation, take either my NVP code below or the SOAP one above, create a .rb within your ActiveMerchant installation, and copy and paste the contents in. If you installed AM as a plugin, this will likely be &lt;your project&gt;/vendor/plugins/active_merchant/billing/gateways/&lt;your .rb class i.e. paypal_express_recurring_nv.rb&gt;

# simple extension to ActiveMerchant for basic support of recurring payments with Express Checkout API
# 
# See http://http://clockobj.co.uk/2008/09/07/ruby-on-rails-paypal-express-recurring-payments-using-active-merchant/
# for details on getting started with this gateway
# 
#
module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    class PaypalExpressRecurringNvGateway &lt; Gateway
      include PaypalNvCommonAPI
      
      LIVE_REDIRECT_URL = 'https://www.paypal.com/cgibin/webscr?cmd=_customer-billing-agreement&amp;token='
      TEST_REDIRECT_URL = 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_customer-billing-agreement&amp;token='
      
      def redirect_url
        test? ? TEST_REDIRECT_URL : LIVE_REDIRECT_URL
      end

      def redirect_url_for(token)
          &quot;#{redirect_url}#{token}&quot;
      end
      
      def setup_agreement(description, options = {})
        requires!(options, :return_url, :cancel_return_url)
        commit 'SetCustomerBillingAgreement', build_setup_agreement(description, options)
      end
      
      def get_agreement(token)
        commit 'GetBillingAgreementCustomerDetails', build_get_agreement(token)
      end
      
      def create_profile(money, token, options = {})
        commit 'CreateRecurringPaymentsProfile', build_create_profile(money, token, options)
      end
      
      def get_profile_details(profile_id)
        commit 'GetRecurringPaymentsProfileDetails', build_get_profile_details(profile_id)
      end
      
      def manage_profile(profile_id, action, options = {})
        commit 'ManageRecurringPaymentsProfileStatus', build_manage_profile(profile_id, action, options)
      end
      
      def update_profile(profile_id, options = {})
        commit 'UpdateRecurringPaymentsProfile', build_update_profile(profile_id, options)
      end
      
      def bill_outstanding(profile_id, money, options = {})
        commit 'BillOutstandingAmount', build_bill_outstanding(profile_id, money, options)
      end
      
      private
      
      def build_setup_agreement(description, options)
        post = {}
        add_pair(post, :billingagreementdescription, description)
        add_pair(post, :returnurl, options[:return_url])
        add_pair(post, :cancelurl, options[:cancel_return_url])
        add_pair(post, :billingtype, &quot;RecurringPayments&quot;)
        add_pair(post, :paymenttype, options[:payment_type]) if options[:payment_type]
        add_pair(post, :localecode, options[:locale]) if options[:locale]
        add_pair(post, :billingagreementcustom, options[:custom_code]) if options[:custom_code]
        post
      end
      
      def build_get_agreement(token)
        post = {}
        add_pair(post, :token, token)
        post
      end
      
      def build_create_profile(money, token, options)
        post = {}
        add_pair(post, :token, token)
        add_amount(post, money, options)
        add_pair(post, :subscribername, options[:subscriber_name]) if options[:subscriber_name]
        add_pair(post, :initamt, options[:initamt]) if options[:initamt]
        add_pair(post, :failedinitamtaction, options[:failedinitamtaction]) if  options[:failedinitamtaction]
        add_pair(post, :profilestartdate, Time.now.utc.iso8601)
        add_pair(post, :billingperiod, options[:billing_period] ? options[:billing_period] : &quot;Month&quot;)
        add_pair(post, :billingfrequency, options[:billing_frequency] ? options[:billing_frequency] : 1)
        add_pair(post, :totalbillingcycles, options[:billing_cycles]) if [:billing_cycles]
        add_pair(post, :profilereference, options[:reference]) if options[:reference]
        add_pair(post, :autobillamt, options[:auto_bill_amt]) if options[:auto_bill_amt]
        add_pair(post, :maxfailedpayments, options[:max_failed_payments]) if options[:max_failed_payments]
        add_pair(post, :shippingamt, amount(options[:shipping_amount]), :allow_blank =&gt; false) if options[:shipping_amount]
        add_pair(post, :taxamt, amount(options[:tax_amount]), :allow_blank =&gt; false) if options[:tax_amount]
        add_shipping_address(post, options[:shipping_address]) if options[:shipping_address]
        post
      end
      
      def build_get_profile_details(profile_id)
        post = {}
        add_pair(post, :profileid, profile_id)
        post
      end
      
      def build_manage_profile(profile_id, action, options)
        post = {}
        add_pair(post, :profileid, profile_id)
        add_pair(post, :action, action)
        add_pair(post, :note, options[:note]) if options[:note]
        post
      end
      
      def build_update_profile(profile_id, options)
        post = {}
        add_pair(post, :profileid, profile_id)
        add_pair(post, :note, options[:note]) if options[:note]
        add_pair(post, :desc, options[:description]) if options[:description]
        add_pair(post, :subscribername, options[:subscriber_name]) if options[:subscriber_name]
        add_pair(post, :profilereference, options[:reference]) if options[:reference]
        add_pair(post, :additionalbillingcycles, options[:additional_billing_cycles]) if options[:additional_billing_cycles]
        add_amount(post, options[:money], options)
        add_pair(post, :shippingamt, amount(options[:shipping_amount]), :allow_blank =&gt; false) if options[:shipping_amount]
        add_pair(post, :autobillamt, options[:auto_bill_amt]) if options[:auto_bill_amt]
        add_pair(post, :maxfailedpayments, options[:max_failed_payments]) if options[:max_failed_payments]
        add_pair(post, :taxamt, amount(options[:tax_amount]), :allow_blank =&gt; false) if options[:tax_amount]
        add_shipping_address(post, options[:shipping_address]) if options[:shipping_address]
        post
      end
      
      def build_bill_outstanding(profile_id, money, options = {})
        post = {}
        add_pair(post, :profileid, profile_id)
        add_amount(post, money, options)
        add_pair(post, :note, options[:note]) if options[:note]
        post
      end
      
      def build_response(success, message, response, options = {})
        PaypalExpressNvResponse.new(success, message, response, options)
      end
      
    end
  end
end</body>
      <body-html>&lt;div&gt;&lt;p&gt;Hi there,&lt;/p&gt;
&lt;p&gt;I thought I would add to this and write a quick version of this
that uses the PayPal NVP API. I am about to write a quick usage
guide on my blog though it may not be up for a day or so (it's
still a draft) but I have included the url in the comment.&lt;/p&gt;
&lt;p&gt;Esparkman, to get this working before implmentation, take either
my NVP code below or the SOAP one above, create a .rb within your
ActiveMerchant installation, and copy and paste the contents in. If
you installed AM as a plugin, this will likely be
/vendor/plugins/active_merchant/billing/gateways/&lt;/p&gt;
&lt;h1&gt;simple extension to ActiveMerchant for basic support of
recurring payments with Express Checkout API&lt;/h1&gt;
&lt;p&gt;#&lt;/p&gt;
&lt;h1&gt;See &lt;a href=&quot;http://http&quot;&gt;http://http&lt;/a&gt;://clockobj.co.uk/2008/09/07/ruby-on-rails-paypal-express-recurring-payments-using-active-merchant/&lt;/h1&gt;
&lt;h1&gt;for details on getting started with this gateway&lt;/h1&gt;
&lt;p&gt;# # module ActiveMerchant #:nodoc: module Billing #:nodoc:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;class PaypalExpressRecurringNvGateway &amp;lt; Gateway
  include PaypalNvCommonAPI

  LIVE_REDIRECT_URL = 'https://www.paypal.com/cgibin/webscr?cmd=_customer-billing-agreement&amp;amp;token='
  TEST_REDIRECT_URL = 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_customer-billing-agreement&amp;amp;token='

  def redirect_url
    test? ? TEST_REDIRECT_URL : LIVE_REDIRECT_URL
  end

  def redirect_url_for(token)
      &quot;#{redirect_url}#{token}&quot;
  end

  def setup_agreement(description, options = {})
    requires!(options, :return_url, :cancel_return_url)
    commit 'SetCustomerBillingAgreement', build_setup_agreement(description, options)
  end

  def get_agreement(token)
    commit 'GetBillingAgreementCustomerDetails', build_get_agreement(token)
  end

  def create_profile(money, token, options = {})
    commit 'CreateRecurringPaymentsProfile', build_create_profile(money, token, options)
  end

  def get_profile_details(profile_id)
    commit 'GetRecurringPaymentsProfileDetails', build_get_profile_details(profile_id)
  end

  def manage_profile(profile_id, action, options = {})
    commit 'ManageRecurringPaymentsProfileStatus', build_manage_profile(profile_id, action, options)
  end

  def update_profile(profile_id, options = {})
    commit 'UpdateRecurringPaymentsProfile', build_update_profile(profile_id, options)
  end

  def bill_outstanding(profile_id, money, options = {})
    commit 'BillOutstandingAmount', build_bill_outstanding(profile_id, money, options)
  end

  private

  def build_setup_agreement(description, options)
    post = {}
    add_pair(post, :billingagreementdescription, description)
    add_pair(post, :returnurl, options[:return_url])
    add_pair(post, :cancelurl, options[:cancel_return_url])
    add_pair(post, :billingtype, &quot;RecurringPayments&quot;)
    add_pair(post, :paymenttype, options[:payment_type]) if options[:payment_type]
    add_pair(post, :localecode, options[:locale]) if options[:locale]
    add_pair(post, :billingagreementcustom, options[:custom_code]) if options[:custom_code]
    post
  end

  def build_get_agreement(token)
    post = {}
    add_pair(post, :token, token)
    post
  end

  def build_create_profile(money, token, options)
    post = {}
    add_pair(post, :token, token)
    add_amount(post, money, options)
    add_pair(post, :subscribername, options[:subscriber_name]) if options[:subscriber_name]
    add_pair(post, :initamt, options[:initamt]) if options[:initamt]
    add_pair(post, :failedinitamtaction, options[:failedinitamtaction]) if  options[:failedinitamtaction]
    add_pair(post, :profilestartdate, Time.now.utc.iso8601)
    add_pair(post, :billingperiod, options[:billing_period] ? options[:billing_period] : &quot;Month&quot;)
    add_pair(post, :billingfrequency, options[:billing_frequency] ? options[:billing_frequency] : 1)
    add_pair(post, :totalbillingcycles, options[:billing_cycles]) if [:billing_cycles]
    add_pair(post, :profilereference, options[:reference]) if options[:reference]
    add_pair(post, :autobillamt, options[:auto_bill_amt]) if options[:auto_bill_amt]
    add_pair(post, :maxfailedpayments, options[:max_failed_payments]) if options[:max_failed_payments]
    add_pair(post, :shippingamt, amount(options[:shipping_amount]), :allow_blank =&amp;gt; false) if options[:shipping_amount]
    add_pair(post, :taxamt, amount(options[:tax_amount]), :allow_blank =&amp;gt; false) if options[:tax_amount]
    add_shipping_address(post, options[:shipping_address]) if options[:shipping_address]
    post
  end

  def build_get_profile_details(profile_id)
    post = {}
    add_pair(post, :profileid, profile_id)
    post
  end

  def build_manage_profile(profile_id, action, options)
    post = {}
    add_pair(post, :profileid, profile_id)
    add_pair(post, :action, action)
    add_pair(post, :note, options[:note]) if options[:note]
    post
  end

  def build_update_profile(profile_id, options)
    post = {}
    add_pair(post, :profileid, profile_id)
    add_pair(post, :note, options[:note]) if options[:note]
    add_pair(post, :desc, options[:description]) if options[:description]
    add_pair(post, :subscribername, options[:subscriber_name]) if options[:subscriber_name]
    add_pair(post, :profilereference, options[:reference]) if options[:reference]
    add_pair(post, :additionalbillingcycles, options[:additional_billing_cycles]) if options[:additional_billing_cycles]
    add_amount(post, options[:money], options)
    add_pair(post, :shippingamt, amount(options[:shipping_amount]), :allow_blank =&amp;gt; false) if options[:shipping_amount]
    add_pair(post, :autobillamt, options[:auto_bill_amt]) if options[:auto_bill_amt]
    add_pair(post, :maxfailedpayments, options[:max_failed_payments]) if options[:max_failed_payments]
    add_pair(post, :taxamt, amount(options[:tax_amount]), :allow_blank =&amp;gt; false) if options[:tax_amount]
    add_shipping_address(post, options[:shipping_address]) if options[:shipping_address]
    post
  end

  def build_bill_outstanding(profile_id, money, options = {})
    post = {}
    add_pair(post, :profileid, profile_id)
    add_amount(post, money, options)
    add_pair(post, :note, options[:note]) if options[:note]
    post
  end

  def build_response(success, message, response, options = {})
    PaypalExpressNvResponse.new(success, message, response, options)
  end

end
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;end end&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-09-07T17:00:39-04:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- 
:assigned_user: 
</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2008-09-07T17:00:47-04:00</updated-at>
      <user-id type="integer">31315</user-id>
      <user-name>Jon</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name>Cody Fauser</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">82</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>What is the status of this ticket?  I would love to see it added to the AM plugin/gem.</body>
      <body-html>&lt;div&gt;&lt;p&gt;What is the status of this ticket? I would love to see it added
to the AM plugin/gem.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-11-16T20:08:46-05:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2008-11-16T20:08:50-05:00</updated-at>
      <user-id type="integer">32315</user-id>
      <user-name>pjammer</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name>Cody Fauser</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">82</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Very nice work guys, I implemented a full billing system on top of this patch for a side project of mine ( web2png.com ). 

Obviously this patch doesn't fit perfectly into AM because the flow of the class is necessarily different from other reoccuring billing systems so it doesn't fit into the &quot;universal translator&quot; aspect of AM. I think that it should be integrated anyways though because it's such a commonly required feature and jon did an excellent job of documenting it. 

Jon: Could you contribute the tutorial you wrote as a (slightly less verbose) documentation block for the top of the class?</body>
      <body-html>&lt;div&gt;&lt;p&gt;Very nice work guys, I implemented a full billing system on top
of this patch for a side project of mine ( web2png.com ).&lt;/p&gt;
&lt;p&gt;Obviously this patch doesn't fit perfectly into AM because the
flow of the class is necessarily different from other reoccuring
billing systems so it doesn't fit into the &quot;universal translator&quot;
aspect of AM. I think that it should be integrated anyways though
because it's such a commonly required feature and jon did an
excellent job of documenting it.&lt;/p&gt;
&lt;p&gt;Jon: Could you contribute the tutorial you wrote as a (slightly
less verbose) documentation block for the top of the class?&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-11-29T18:46:54-05:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2008-11-29T18:46:59-05:00</updated-at>
      <user-id type="integer">80</user-id>
      <user-name>Tobias L&#252;tke</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name>Cody Fauser</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">82</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>I'll do this shortly. Should I do this as a patch? I'll look into how I do that.

Regards,

Jon</body>
      <body-html>&lt;div&gt;&lt;p&gt;I'll do this shortly. Should I do this as a patch? I'll look
into how I do that.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Jon&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-12-01T12:21:18-05:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2008-12-01T12:21:21-05:00</updated-at>
      <user-id type="integer">31315</user-id>
      <user-name>Jon</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name>Cody Fauser</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">82</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Hi Cody,

Sorry for the delay in getting this to you. I have attached the patch for this and added the documentation to the header as requested. However, when I checked out the latest code via git I have noticed that the PayPal NVP classes have been removed from the repository. I am not sure this will still work as I was including functionality from PaypalNvCommonAPI.

I would have thought the NVP PayPal classes would have taken precedence over the SOAP ones?

Regards,

Jon</body>
      <body-html>&lt;div&gt;&lt;p&gt;Hi Cody,&lt;/p&gt;
&lt;p&gt;Sorry for the delay in getting this to you. I have attached the
patch for this and added the documentation to the header as
requested. However, when I checked out the latest code via git I
have noticed that the PayPal NVP classes have been removed from the
repository. I am not sure this will still work as I was including
functionality from PaypalNvCommonAPI.&lt;/p&gt;
&lt;p&gt;I would have thought the NVP PayPal classes would have taken
precedence over the SOAP ones?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Jon&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-23T14:32:07-05:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2009-01-23T14:32:11-05:00</updated-at>
      <user-id type="integer">31315</user-id>
      <user-name>Jon</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name>Cody Fauser</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">82</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Jon,

We were planning on switching everything to NVP, but the SOAP
implementation is in use by a few thousand customers and is processing
millions of dollars worth of transactions. Since the SOAP code was
already complete and battle tested we decided it was too risky, and
not worth the effort to switch. I agree the NVP API is nicer, but it
should be pretty easy to port the NVP recurring code to the
PaypalGateway.</body>
      <body-html>&lt;div&gt;&lt;p&gt;Jon,&lt;/p&gt;
&lt;p&gt;We were planning on switching everything to NVP, but the SOAP
implementation is in use by a few thousand customers and is
processing millions of dollars worth of transactions. Since the
SOAP code was already complete and battle tested we decided it was
too risky, and not worth the effort to switch. I agree the NVP API
is nicer, but it should be pretty easy to port the NVP recurring
code to the PaypalGateway.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-23T18:51:25-05:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2009-01-23T18:51:25-05:00</updated-at>
      <user-id type="integer">82</user-id>
      <user-name>Cody Fauser</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name>Cody Fauser</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">82</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Hi Cody,

I had no end of trouble with the SOAP API and this functionality, I originally tried to write it using the SOAP API and PayPal kept returning error codes.
I am not sure I will have time to rewrite this using SOAP whilst trying to overcome issues with PayPal's API. I may be able to make this class standalone, rather than dependent on the deprecated PaypalNvCommonAPI as a temporary solution. I know there are a lot of people who would like to make use of PayPal Express Recurring Payments.
Regards,
Jon</body>
      <body-html>&lt;div&gt;&lt;p&gt;Hi Cody,&lt;/p&gt;
&lt;p&gt;I had no end of trouble with the SOAP API and this
functionality, I originally tried to write it using the SOAP API
and PayPal kept returning error codes. I am not sure I will have
time to rewrite this using SOAP whilst trying to overcome issues
with PayPal's API. I may be able to make this class standalone,
rather than dependent on the deprecated PaypalNvCommonAPI as a
temporary solution. I know there are a lot of people who would like
to make use of PayPal Express Recurring Payments. Regards, Jon&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-23T19:07:27-05:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2009-01-23T19:07:30-05:00</updated-at>
      <user-id type="integer">31315</user-id>
      <user-name>Jon</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name>Cody Fauser</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">82</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>@Cody,

Just to let you know I have decided to re-write the class so that it uses the SOAP API. I have managed to overcome some of the issues through help from the PayPal forums. I will post up the new diff shortly.

Jon</body>
      <body-html>&lt;div&gt;&lt;p&gt;@Cody,&lt;/p&gt;
&lt;p&gt;Just to let you know I have decided to re-write the class so
that it uses the SOAP API. I have managed to overcome some of the
issues through help from the PayPal forums. I will post up the new
diff shortly.&lt;/p&gt;
&lt;p&gt;Jon&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-29T09:54:08-05:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2009-01-29T09:54:13-05:00</updated-at>
      <user-id type="integer">31315</user-id>
      <user-name>Jon</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name>Cody Fauser</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">82</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>I also had to do recurring payment with PayPal and ActiveMerchant, so I just wrote one up last night.  It is based on Cody's code above and http://obondar.com/2008/7/3/paypal-express-recurring-payments/  It is working with SetCustomerBillingAgreement.  It creates the recurring payment schedule and I can also cancel it.

As you can see in the comments, I tried to use SetExpressCheckout but I couldn't get it to work.  The problem is PayPal doesn't redirect back to my return_url.  It just shows a blank page with a session hash in the url.  I tried with API_VERSION=50/52/54 but in vain.  Any clues?</body>
      <body-html>&lt;div&gt;&lt;p&gt;I also had to do recurring payment with PayPal and
ActiveMerchant, so I just wrote one up last night. It is based on
Cody's code above and &lt;a href=&quot;http://obondar.com/2008/7/3/paypal-express-recurring-payments/&quot;&gt;http://obondar.com/2008/7/3/payp...&lt;/a&gt;
It is working with SetCustomerBillingAgreement. It creates the
recurring payment schedule and I can also cancel it.&lt;/p&gt;
&lt;p&gt;As you can see in the comments, I tried to use
SetExpressCheckout but I couldn't get it to work. The problem is
PayPal doesn't redirect back to my return_url. It just shows a
blank page with a session hash in the url. I tried with
API_VERSION=50/52/54 but in vain. Any clues?&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-30T07:48:07-05:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2009-01-30T07:48:12-05:00</updated-at>
      <user-id type="integer">17774</user-id>
      <user-name>Raymond Law</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name>Cody Fauser</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">82</assigned-user-id>
      <attachments-count type="integer">2</attachments-count>
      <body>Raymond,

It looks like we are duplicating effort. I have nearly completed my version. Maybe we should combine our efforts, I have fully implemented the API in mine for example the ability to set up trial periods etc. I just have some cleaning up to do and adding in the documentation header as requested by Tobias before submitting the .diff I will send over for your comments if you like.

I have spoken to several people in the forums and everyone is in agreement there that you are unable to use SetExpressCheckout (even though the documentation tell you to do so) for recurring billing when there is no initial payment. A bug has been raised with the PayPal Merchant Services Team. So you are correct to use SetCustomerBillingAgreement.</body>
      <body-html>&lt;div&gt;&lt;p&gt;Raymond,&lt;/p&gt;
&lt;p&gt;It looks like we are duplicating effort. I have nearly completed
my version. Maybe we should combine our efforts, I have fully
implemented the API in mine for example the ability to set up trial
periods etc. I just have some cleaning up to do and adding in the
documentation header as requested by Tobias before submitting the
.diff I will send over for your comments if you like.&lt;/p&gt;
&lt;p&gt;I have spoken to several people in the forums and everyone is in
agreement there that you are unable to use SetExpressCheckout (even
though the documentation tell you to do so) for recurring billing
when there is no initial payment. A bug has been raised with the
PayPal Merchant Services Team. So you are correct to use
SetCustomerBillingAgreement.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-30T08:00:22-05:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2009-01-30T08:00:24-05:00</updated-at>
      <user-id type="integer">31315</user-id>
      <user-name>Jon</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name>Cody Fauser</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">82</assigned-user-id>
      <attachments-count type="integer">2</attachments-count>
      <body>Jon,

Definitely.  I needed something to work quick last night.  I wasted so much time to try to get SetExpressCheckout to work, LOL.  I like your NVP code above as well, but unfortunately, ActiveMerchant has decided to remove that aspect.  Good work!</body>
      <body-html>&lt;div&gt;&lt;p&gt;Jon,&lt;/p&gt;
&lt;p&gt;Definitely. I needed something to work quick last night. I
wasted so much time to try to get SetExpressCheckout to work, LOL.
I like your NVP code above as well, but unfortunately,
ActiveMerchant has decided to remove that aspect. Good work!&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-30T08:08:38-05:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2009-01-30T08:08:42-05:00</updated-at>
      <user-id type="integer">17774</user-id>
      <user-name>Raymond Law</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name>Cody Fauser</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">2</attachments-count>
      <body>Jon,

Any progress on your work? I could really use this feature in a project I'm about to wrap up. 

Anything I can do to help?</body>
      <body-html>&lt;div&gt;&lt;p&gt;Jon,&lt;/p&gt;
&lt;p&gt;Any progress on your work? I could really use this feature in a
project I'm about to wrap up.&lt;/p&gt;
&lt;p&gt;Anything I can do to help?&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-02-09T13:28:38-05:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- 
:assigned_user: 82
</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2009-02-09T13:28:39-05:00</updated-at>
      <user-id type="integer">8339</user-id>
      <user-name>kristopherwilson (at gmail)</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name nil="true"></assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">2</attachments-count>
      <body>Also curious about an update and am willing to help.</body>
      <body-html>&lt;div&gt;&lt;p&gt;Also curious about an update and am willing to help.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-02-18T10:55:27-05:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2009-02-18T10:55:31-05:00</updated-at>
      <user-id type="integer">19316</user-id>
      <user-name>Jeff</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name nil="true"></assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">2</attachments-count>
      <body>Have you tried the paypal_express_recurring.rb file I attached above?</body>
      <body-html>&lt;div&gt;&lt;p&gt;Have you tried the paypal_express_recurring.rb file I attached
above?&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-02-18T14:09:11-05:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2009-02-18T14:09:12-05:00</updated-at>
      <user-id type="integer">17774</user-id>
      <user-name>Raymond Law</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name nil="true"></assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">2</attachments-count>
      <body>Hi Raymond.  Yes, I am trying the file you attached above.  So far, seems to be going great.

The reason I ask for an update is it sounds like you and Jon are each working on a solution separately.

I should be good to go, though.  I'll post any issues or suggestions as I run across them.</body>
      <body-html>&lt;div&gt;&lt;p&gt;Hi Raymond. Yes, I am trying the file you attached above. So
far, seems to be going great.&lt;/p&gt;
&lt;p&gt;The reason I ask for an update is it sounds like you and Jon are
each working on a solution separately.&lt;/p&gt;
&lt;p&gt;I should be good to go, though. I'll post any issues or
suggestions as I run across them.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-02-18T14:30:29-05:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2009-02-18T14:30:30-05:00</updated-at>
      <user-id type="integer">19316</user-id>
      <user-name>Jeff</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name nil="true"></assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">2</attachments-count>
      <body>Jon mentioned he was adding more features to the script but I haven't heard back from him since.  I am able to get it to work with the file I uploaded in development mode.  But when I go into production, PayPal seems to expect a different SOAP structure...</body>
      <body-html>&lt;div&gt;&lt;p&gt;Jon mentioned he was adding more features to the script but I
haven't heard back from him since. I am able to get it to work with
the file I uploaded in development mode. But when I go into
production, PayPal seems to expect a different SOAP
structure...&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-02-18T14:34:52-05:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2009-02-18T14:34:58-05:00</updated-at>
      <user-id type="integer">17774</user-id>
      <user-name>Raymond Law</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name nil="true"></assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">2</attachments-count>
      <body>I just found a typo in my uploaded file as I copied from Cody's snippet above without reading.  Here is the corrected file attached.  This works for me in both development (PayPal sandbox) and production (real PayPal).</body>
      <body-html>&lt;div&gt;&lt;p&gt;I just found a typo in my uploaded file as I copied from Cody's
snippet above without reading. Here is the corrected file attached.
This works for me in both development (PayPal sandbox) and
production (real PayPal).&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-02-20T00:10:01-05:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- 
:tag: patch
</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch paypal recurring</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2009-02-20T00:10:06-05:00</updated-at>
      <user-id type="integer">17774</user-id>
      <user-name>Raymond Law</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name nil="true"></assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">3</attachments-count>
      <body>I threw this on github: http://github.com/jjolma/active_merchant_with_paypal_recurring/tree/master

Hopefully this will help us avoid duplicating work.  Let me know if you want access.</body>
      <body-html>&lt;div&gt;&lt;p&gt;I threw this on github: &lt;a href=&quot;http://github.com/jjolma/active_merchant_with_paypal_recurring/tree/master&quot;&gt;
http://github.com/jjolma/active_...&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hopefully this will help us avoid duplicating work. Let me know
if you want access.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-02-20T10:21:51-05:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch paypal recurring</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2009-02-20T10:21:55-05:00</updated-at>
      <user-id type="integer">19316</user-id>
      <user-name>Jeff</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name nil="true"></assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">3</attachments-count>
      <body>I just wrote up a &lt;a href=&quot;http://rayvinly.com/articles/2009/02/20/paypal-recurring-billing-with-activemerchant-in-ruby-on-rails/&quot;&gt;blog post&lt;/a&gt; to show how to use this.</body>
      <body-html>&lt;div&gt;&lt;p&gt;I just wrote up a &lt;a href=&quot;http://rayvinly.com/articles/2009/02/20/paypal-recurring-billing-with-activemerchant-in-ruby-on-rails/&quot;&gt;
blog post&lt;/a&gt; to show how to use this.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-02-20T14:47:13-05:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch paypal recurring</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2009-02-20T14:47:17-05:00</updated-at>
      <user-id type="integer">17774</user-id>
      <user-name>Raymond Law</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name nil="true"></assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">3</attachments-count>
      <body>Just updated the extension in the &lt;a hret=&quot;http://rayvinly.com/articles/2009/02/20/paypal-recurring-billing-with-activemerchant-in-ruby-on-rails/&quot;&gt;blog post&lt;/a&gt; to include a credit_card hash to allow recurring payment with a credit card.</body>
      <body-html>&lt;div&gt;&lt;p&gt;Just updated the extension in the &lt;a&gt;
blog post&lt;/a&gt; to include a credit_card hash to allow recurring
payment with a credit card.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-02-24T14:23:35-05:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch paypal recurring</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2009-02-24T14:23:38-05:00</updated-at>
      <user-id type="integer">17774</user-id>
      <user-name>Raymond Law</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name nil="true"></assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">3</attachments-count>
      <body>Are there plans to merge Raymond's fork with the mainline code?

http://github.com/rayvinly/active_merchant/tree/master

James</body>
      <body-html>&lt;div&gt;&lt;p&gt;Are there plans to merge Raymond's fork with the mainline
code?&lt;/p&gt;
&lt;p&gt;&lt;a href=
&quot;http://github.com/rayvinly/active_merchant/tree/master&quot;&gt;http://github.com/rayvinly/active_merchant/tree/master&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;James&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-06-12T18:52:53-04:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch paypal recurring</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2009-06-12T18:52:53-04:00</updated-at>
      <user-id type="integer">56351</user-id>
      <user-name>James Ponder</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name nil="true"></assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">3</attachments-count>
      <body>Hey all,

I've enhanced this somewhat further on github.

http://github.com/sentientmonkey/active_merchant/tree/master

Some of the other missing options have been added (like tax amounts), and I've moved to using the standard credit card object rather than a hash.  Any idea if this can be integrated back into main branch?</body>
      <body-html>&lt;div&gt;&lt;p&gt;Hey all,&lt;/p&gt;
&lt;p&gt;I've enhanced this somewhat further on github.&lt;/p&gt;
&lt;p&gt;&lt;a href=
&quot;http://github.com/sentientmonkey/active_merchant/tree/master&quot;&gt;http://github.com/sentientmonkey/active_merchant/tree/master&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Some of the other missing options have been added (like tax
amounts), and I've moved to using the standard credit card object
rather than a hash. Any idea if this can be integrated back into
main branch?&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-08-19T13:12:20-04:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch paypal recurring</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2009-08-19T13:12:25-04:00</updated-at>
      <user-id type="integer">11354</user-id>
      <user-name>Scott Windsor</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name nil="true"></assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">3</attachments-count>
      <body>I too have taken what was started above by raymond and Jon, and have updated it to work in today's environment but with Website Payments Pro.  I'm using it in the wild and it's great.

However, I had to pull out some 'private' methods from Paypal.rb and slap them in Paypal Common (just what i chose to do) and made it work so that you can use reference payments as well.

All that to say, please let me know if i should put through a pull request or not. IF github says it will apply cleanly, does that mean you'll take it?  I know your stance has been that this feature is SO different then regular AM flow, but i think it's so important and warrants being added today.

It's cool if it doesn't match what you want, as i'll fork it later and do something with it, if that is what it should be... but why have two projects rocking?

Thoughts?</body>
      <body-html>&lt;div&gt;&lt;p&gt;I too have taken what was started above by raymond and Jon, and
have updated it to work in today's environment but with Website
Payments Pro. I'm using it in the wild and it's great.&lt;/p&gt;
&lt;p&gt;However, I had to pull out some 'private' methods from Paypal.rb
and slap them in Paypal Common (just what i chose to do) and made
it work so that you can use reference payments as well.&lt;/p&gt;
&lt;p&gt;All that to say, please let me know if i should put through a
pull request or not. IF github says it will apply cleanly, does
that mean you'll take it? I know your stance has been that this
feature is SO different then regular AM flow, but i think it's so
important and warrants being added today.&lt;/p&gt;
&lt;p&gt;It's cool if it doesn't match what you want, as i'll fork it
later and do something with it, if that is what it should be... but
why have two projects rocking?&lt;/p&gt;
&lt;p&gt;Thoughts?&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-12-07T22:53:15-05:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch paypal recurring</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2009-12-07T22:53:17-05:00</updated-at>
      <user-id type="integer">32315</user-id>
      <user-name>pjammer</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name nil="true"></assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">3</attachments-count>
      <body>no edit...dammit.  that should say to work with  Website Payments Pro and Express....</body>
      <body-html>&lt;div&gt;&lt;p&gt;no edit...dammit. that should say to work with Website Payments
Pro and Express....&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-12-07T22:53:57-05:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag>patch paypal recurring</tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2009-12-07T22:54:01-05:00</updated-at>
      <user-id type="integer">32315</user-id>
      <user-name>pjammer</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name nil="true"></assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">3</attachments-count>
      <body>Thanks that you performed the fantastic release connected with this post. Though, to find the really good &lt;a  href=&quot;http://www.bestwritingservice.com&quot;&gt;essay writing&lt;/a&gt; service, all students suppose have information about &lt;a href=&quot;http://bestwritingservice.com/essay-buy.html&quot;&gt;essay buy&lt;/a&gt;.</body>
      <body-html>&lt;div&gt;&lt;p&gt;Thanks that you performed the fantastic release connected with
this post. Though, to find the really good &lt;a href=
&quot;http://www.bestwritingservice.com&quot;&gt;essay writing&lt;/a&gt; service, all
students suppose have information about &lt;a href=
&quot;http://bestwritingservice.com/essay-buy.html&quot;&gt;essay buy&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2010-01-01T13:19:16-05:00</created-at>
      <creator-id type="integer">4642</creator-id>
      <diffable-attributes type="yaml">--- 
:tag: patch paypal recurring
</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">17</number>
      <permalink>patch-creating-paypal-recurring-payments-profile-with-activemerchant</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11599</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>[PATCH] Creating PayPal recurring payments profile with activemerchant</title>
      <updated-at type="datetime">2010-01-02T09:55:02-05:00</updated-at>
      <user-id type="integer">81176</user-id>
      <user-name>BCJessica</user-name>
      <creator-name>Cody Fauser</creator-name>
      <url>http://jadedpixel.lighthouseapp.com/projects/11599/tickets/17</url>
      <assigned-user-name nil="true"></assigned-user-name>
    </version>
  </versions>
  <attachments type="array">
    <attachment type="Attachment">
      <code>50eba0155a8719fa046f8f345c8f66184e74c983</code>
      <content-type>text/plain</content-type>
      <created-at type="datetime">2009-01-23T14:32:07-05:00</created-at>
      <filename>paypal_express_recurring.diff</filename>
      <height type="integer" nil="true"></height>
      <id type="integer">81247</id>
      <size type="integer">9350</size>
      <uploader-id type="integer">31315</uploader-id>
      <width type="integer" nil="true"></width>
      <url>http://jadedpixel.lighthouseapp.com/attachments/81247/paypal_express_recurring.diff</url>
    </attachment>
    <attachment type="Attachment">
      <code>87436623402900c71d1da5713b25d65f91310494</code>
      <content-type>application/octet-stream</content-type>
      <created-at type="datetime">2009-01-30T07:48:07-05:00</created-at>
      <filename>paypal_express_recurring.rb</filename>
      <height type="integer" nil="true"></height>
      <id type="integer">83243</id>
      <size type="integer">10533</size>
      <uploader-id type="integer">17774</uploader-id>
      <width type="integer" nil="true"></width>
      <url>http://jadedpixel.lighthouseapp.com/attachments/83243/paypal_express_recurring.rb</url>
    </attachment>
    <attachment type="Attachment">
      <code>3dc243778363be0194bbf94927dbf250d4b5ac17</code>
      <content-type>application/octet-stream</content-type>
      <created-at type="datetime">2009-02-20T00:10:01-05:00</created-at>
      <filename>paypal_express_recurring.rb</filename>
      <height type="integer" nil="true"></height>
      <id type="integer">91003</id>
      <size type="integer">10534</size>
      <uploader-id type="integer">17774</uploader-id>
      <width type="integer" nil="true"></width>
      <url>http://jadedpixel.lighthouseapp.com/attachments/91003/paypal_express_recurring.rb</url>
    </attachment>
  </attachments>
</ticket>
