class Paypal::Masspay::Recipient

Constants

RECIPIENT_EMAIL_MAX_LENGTH
RECIPIENT_NOTE_MAX_LENGTH
RECIPIENT_UNIQUE_ID_MAX_LENGTH

Public Class Methods

new(args = {}) click to toggle source
# File lib/paypal/masspay/recipient.rb, line 7
def initialize(args = {})
  @recipient_email = Paypal::Masspay::LengthValidator.validate(args[:recipient_email], RECIPIENT_EMAIL_MAX_LENGTH, :recipient_email)
  @note            = Paypal::Masspay::LengthValidator.validate(args[:note], RECIPIENT_NOTE_MAX_LENGTH, :note)
  @unique_id       = Paypal::Masspay::LengthValidator.validate(args[:unique_id], RECIPIENT_UNIQUE_ID_MAX_LENGTH, :unique_id)
  @amount          = args[:amount]
end

Public Instance Methods

get_params(index) click to toggle source
# File lib/paypal/masspay/recipient.rb, line 14
def get_params(index)
  {
    "L_EMAIL#{index}"    => @recipient_email,
    "L_AMT#{index}"      => @amount,
    "L_NOTE#{index}"     => @note,
    "L_UNIQUEID#{index}" => @unique_id
  }
end