theHumbleProgrammer
theHumbleProgrammer

Reputation: 157

Send CUSTOM variable to CreateRecurringPaymentsProfile

I am implementing Recurring Express checkout. The code for creating a profile is working. What I want to do now is pass it a custom value.

We can pass

DoExpressCheckout

and

SetExpressCheckout

using the the following name

PAYMENTREQUEST_n_CUSTOM

I want to do the same for CreateRecurringPaymentsProfile so that I can access it in IPN.

Upvotes: 0

Views: 644

Answers (1)

Drew Angell
Drew Angell

Reputation: 26056

CRPP does not include the custom parameter like other API requests do, however, it does include the PROFILEREFERENCE parameter, which is meant to be treated like an invoice ID. Whatever value you pass here would come back in IPN as rp_invoice_id.

So what you can do is save a local invoice record in your DB that includes any related data you need, and then pass that ID in the profilereference parameter of your CRPP request. Then within your IPN script you pull this value from rp_invoice_id, and then pull any extra details you need about that invoice from your database using that ID value.

Here's a sample of an IPN that includes the rp_invoice_id.

Array
(
    [mc_gross] => 6.45
    [period_type] =>  Regular
    [outstanding_balance] => 0.00
    [next_payment_date] => 02:00:00 Feb 12, 2015 PST
    [protection_eligibility] => Eligible
    [payment_cycle] => Monthly
    [address_status] => confirmed
    [tax] => 0.00
    [payer_id] => Q33PGJHM6K38Q
    [address_street] => 375 HWY 21 n
    [payment_date] => 02:12:06 Jan 12, 2015 PST
    [payment_status] => Completed
    [product_name] => USBSwiper Monthly Subscription
    [charset] => windows-1252
    [rp_invoice_id] => 1935
    [recurring_payment_id] => I-FWEAAAAXPVJ
    [address_zip] => 72616
    [first_name] => Tester
    [mc_fee] => 0.44
    [address_country_code] => US
    [address_name] => KARShop
    [notify_version] => 3.8
    [amount_per_cycle] => 6.45
    [payer_status] => verified
    [currency_code] => USD
    [business] => [email protected]
    [address_country] => United States
    [address_city] => Berryville
    [verify_sign] => AtjWedapewmudDbf6C3S0..Z.7glAyXhJISOoiYcafN1Zb.VrOX7O8VH
    [payer_email] => [email protected]
    [initial_payment_amount] => 0.00
    [profile_status] => Active
    [amount] => 6.45
    [txn_id] => 5G2211475Y5810638
    [payment_type] => instant
    [payer_business_name] => Testers, LLC
    [last_name] => Testerson
    [address_state] => AR
    [receiver_email] => [email protected]
    [payment_fee] => 0.44
    [receiver_id] => M5VRAQYEFCSK6
    [txn_type] => recurring_payment
    [mc_currency] => USD
    [residence_country] => US
    [transaction_subject] => USBSwiper Monthly Subscription
    [payment_gross] => 6.45
    [shipping] => 0.00
    [product_type] => 1
    [time_created] => 14:56:25 Apr 12, 2011 PDT
    [ipn_track_id] => 9318cc3589f1b
)

Upvotes: 2

Related Questions