Sha256: 18f4cf2c00698e8eb6760c913f4bb11d7d6b778abe88c7af9352fe64a1672750
Contents?: true
Size: 775 Bytes
Versions: 21
Compression:
Stored size: 775 Bytes
Contents
module Paypal module Payment class Request::Item < Base attr_optional :name, :description, :amount, :quantity, :category def initialize(attributes = {}) super @quantity ||= 1 end def to_params(parent_index, index = 0) { :"L_PAYMENTREQUEST_#{parent_index}_NAME#{index}" => self.name, :"L_PAYMENTREQUEST_#{parent_index}_DESC#{index}" => self.description, :"L_PAYMENTREQUEST_#{parent_index}_AMT#{index}" => Util.formatted_amount(self.amount), :"L_PAYMENTREQUEST_#{parent_index}_QTY#{index}" => self.quantity, :"L_PAYMENTREQUEST_#{parent_index}_ITEMCATEGORY#{index}" => self.category }.delete_if do |k, v| v.blank? end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems