Sha256: 79335ea5d47b907865ade720ddb303a98603712b559f676dbbc74e6fa47cb4b5
Contents?: true
Size: 942 Bytes
Versions: 39
Compression:
Stored size: 942 Bytes
Contents
module Paypal module Payment class Request::Item < Base attr_optional :name, :description, :amount, :number, :quantity, :category, :url 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}_NUMBER#{index}" => self.number, :"L_PAYMENTREQUEST_#{parent_index}_QTY#{index}" => self.quantity, :"L_PAYMENTREQUEST_#{parent_index}_ITEMCATEGORY#{index}" => self.category, :"L_PAYMENTREQUEST_#{parent_index}_ITEMURL#{index}" => self.url }.delete_if do |k, v| v.blank? end end end end end
Version data entries
39 entries across 39 versions & 4 rubygems