You are here

function ucRecurringPaypalWPSTestCase::paypal_message 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.test \ucRecurringPaypalWPSTestCase::paypal_message()

Mock return values from paypal

1 call to ucRecurringPaypalWPSTestCase::paypal_message()
ucRecurringPaypalWPSTestCase::testRecurringPaypal in modules/uc_recurring_hosted/uc_recurring_hosted.test
Place an order with the Paypal WPS gateway.

File

modules/uc_recurring_hosted/uc_recurring_hosted.test, line 122
UC Recurring paypal simpletest

Class

ucRecurringPaypalWPSTestCase
Test payment gateway api fuctions in uc_recurring.

Code

function paypal_message($msg_type, $order_id, $amount = 0) {
  $subscr_id = 'S-36L13190CF840735L';
  $lastname = 'lastname';
  $firstname = 'firstname';
  $payer_email = 'email@example.com';
  $order_title = 'Order ' . $order_id;
  $site_email = 'site@example.com';
  $messages = array(
    'subscr_signup' => array(
      'txn_type' => 'subscr_signup',
      'subscr_id' => $subscr_id,
      'last_name' => $lastname,
      'residence_country' => 'AU',
      'mc_currency' => 'USD',
      'item_name' => $order_title,
      'business' => $site_email,
      'amount1' => '20.00',
      'amount3' => '50.00',
      'recurring' => '1',
      'verify_sign' => 'AD64hcmiT1x99QnLF9FyFJZ8tiTHAkx9HelO6oUjwyK4tjmKRIrCWgjd',
      'payer_status' => 'unverified',
      'payer_email' => $payer_email,
      'first_name' => $firstname,
      'receiver_email' => $site_email,
      'payer_id' => '76VZLCDJFJF34',
      'invoice' => $order_id . '-QKO',
      'reattempt' => '1',
      'subscr_date' => '06:04:49 Aug 31, 2009 PDT',
      'charset' => 'windows-1252',
      'notify_version' => '2.8',
      'period1' => '7 D',
      'mc_amount1' => '20.00',
      'period3' => '1 M',
      'mc_amount3' => '50.00',
    ),
    'subscr_payment' => array(
      'transaction_subject' => '',
      'payment_date' => '04:23:25 Aug 30, 2009 PDT',
      'txn_type' => 'subscr_payment',
      'subscr_id' => $subscr_id,
      'last_name' => $lastname,
      'residence_country' => 'AU',
      'item_name' => $order_title,
      'payment_gross' => sprintf("%0.2f", $amount),
      'mc_currency' => 'USD',
      'business' => $site_email,
      'payment_type' => 'instant',
      'protection_eligibility' => 'Ineligible',
      'verify_sign' => 'ADcTLhZXAOjhiy0C89yIcZ88CzBWADhlrLg1DyMqv-xDus-qyJrrmsvo',
      'payer_status' => 'unverified',
      'payer_email' => $payer_email,
      'txn_id' => '58H79324DK124573U',
      'receiver_email' => $site_email,
      'first_name' => $firstname,
      'invoice' => $order_id . '-EPK',
      'payer_id' => '6XGCGCPH8W534',
      'receiver_id' => 'GWA2A76YCPXVQ',
      'payment_status' => 'Completed',
      'payment_fee' => '2.63',
      'mc_fee' => '2.63',
      'mc_gross' => sprintf("%0.2f", $amount),
      'charset' => 'windows-1252',
      'notify_version' => '2.8',
    ),
    'subscr_failed' => array(
      'txn_type' => 'subscr_failed',
      'subscr_id' => $subscr_id,
      'last_name' => $lastname,
      'residence_country' => 'AU',
      'item_name' => $order_title,
      'payment_gross' => '50.00',
      'mc_currency' => 'USD',
      'business' => $site_email,
      'verify_sign' => 'Ac1LtbexNvR-7fVEm2Hr8nwAP9nwASZ078vAUAidKZpOaZ8.lZAgmMk4',
      'payer_status' => 'verified',
      'payer_email' => $payer_email,
      'first_name' => $firstname,
      'receiver_email' => $site_email,
      'payer_id' => 'WAKK3E8Z9J3E',
      'invoice' => $order_id . '-BDK',
      'retry_at' => '06:21:12 Sep 02, 2009 PDT',
      'payer_business_name' => 'Business',
      'mc_gross' => '50.00',
      'charset' => 'windows-1252',
      'notify_version' => '2.8',
    ),
    'subscr_cancel' => array(
      'txn_type' => 'subscr_cancel',
      'subscr_id' => $subscr_id,
      'last_name' => $lastname,
      'residence_country' => 'AU',
      'mc_currency' => 'USD',
      'item_name' => $order_title,
      'amount1' => '20.00',
      'business' => $site_email,
      'amount3' => '50.00',
      'recurring' => '1',
      'verify_sign' => 'AFcWxV21C7fd0v3bYYYRCpSSRl31ARFS9PJtnu4RIGItZ5.Ob4xzwvYZ',
      'payer_status' => 'verified',
      'payer_email' => $payer_email,
      'first_name' => $firstname,
      'receiver_email' => $site_email,
      'payer_id' => 'WAKK3E8Z9J3EE',
      'invoice' => $order_id . '-BDK',
      'reattempt' => '1',
      'payer_business_name' => 'Business',
      'subscr_date' => '11:50:37 Sep 02, 2009 PDT',
      'charset' => 'windows-1252',
      'notify_version' => '2.8',
      'period1' => '7 D',
      'mc_amount1' => '20.00',
      'period3' => '1 M',
      'mc_amount3' => '50.00',
    ),
    'subscr_eot' => array(
      'txn_type' => 'subscr_eot',
      'subscr_id' => $subscr_id,
      'last_name' => $lastname,
      'residence_country' => 'AU',
      'item_name' => $order_title,
      'mc_currency' => 'USD',
      'business' => $site_email,
      'verify_sign' => 'AdQt9JQnh.MOM7Fe6O8DQY7ve6g3ATrYHEG3jPMHBdHlDnTBZeEEQKDR',
      'payer_status' => 'verified',
      'payer_email' => $payer_email,
      'first_name' => $firstname,
      'receiver_email' => $site_email,
      'payer_id' => 'SJKZMSLWS4J54',
      'invoice' => $order_id . '-MSX',
      'charset' => 'windows-1252',
      'notify_version' => '2.8',
    ),
  );
  return $messages[$msg_type];
}