You are here

function uc_recurring_hosted_paypal_wpp_get_profile in UC Recurring Payments and Subscriptions 7.2

Same name and namespace in other branches
  1. 6.2 modules/uc_recurring_hosted/uc_recurring_hosted.module \uc_recurring_hosted_paypal_wpp_get_profile()

Helper function; Get a recurring payments profile from PayPal.

Parameters

$rfid: The recurring fee ID.

Return value

FALSE on failure, otherwise, the NVP response from PayPal.

1 call to uc_recurring_hosted_paypal_wpp_get_profile()
uc_recurring_hosted_paypal_wpp_suspension_log in modules/uc_recurring_hosted/uc_recurring_hosted.module
Suspends a user's profile due to failed payment.

File

modules/uc_recurring_hosted/uc_recurring_hosted.module, line 973
Provides hosted gateway specific code for recurring payments, specifically Authorize.net ARB and Paypal WPS

Code

function uc_recurring_hosted_paypal_wpp_get_profile($rfid) {
  $fee = uc_recurring_fee_user_load($rfid);
  $subscription = uc_recurring_hosted_subscription_load($fee->rfid);

  // Build an NVP request.
  $nvp_request = array(
    'METHOD' => 'GetRecurringPaymentsProfileDetails',
    'PROFILEID' => $subscription->subscription_id,
  );

  // Post the request, and parse the response.
  $nvp_response = uc_paypal_api_request($nvp_request, variable_get('uc_paypal_wpp_server', 'https://api-3t.sandbox.paypal.com/nvp'), UC_PAYPAL_RECURRING_API);
  if ($nvp_response['ACK'] != 'Success' && $nvp_response['ACK'] != 'SuccessWithWarning') {
    return FALSE;
  }
  return $nvp_response;
}