Class: EZPaypal::Cart::RecurringProfile
- Inherits:
-
HashWithIndifferentAccess
- Object
- HashWithIndifferentAccess
- EZPaypal::Cart::RecurringProfile
- Defined in:
- lib/core/data.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(profile) ⇒ RecurringProfile
constructor
Setup profile.
Constructor Details
#initialize(profile) ⇒ RecurringProfile
Setup profile
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/core/data.rb', line 190 def initialize(profile) item = profile = { "TOKEN" => item["token"], "EMAIL" => item["email"], "CURRENCYCODE" => item["currency"] || "USD", "FAILEDINITAMTACTION" => "CancelOnFailure", #ContinueOnFailure / CancelOnFailure # Display details "L_PAYMENTREQUEST_0_ITEMCATEGORY0" => item["category"] || "Physical", "L_PAYMENTREQUEST_0_NAME0" => item["item_code"] || "", "L_PAYMENTREQUEST_0_AMT0" => item["unit_price"] || "0", "L_PAYMENTREQUEST_0_QTY0" => item["quantity"] || "0", # Profile details "DESC" => item["item_code"] || "", "AMT" => item["amount"] || "0", "QTY" => item["quantity"] || "0", "INITAMT" => item["initial_amount"] || "0", # Recurring details "PROFILESTARTDATE" => item["start_date"] || Time.now, "BILLINGFREQUENCY" => item["frequency"] || "1", "BILLINGPERIOD" => item["period"] || "Month", "TOTALBILLINGCYCLES" => item["cycles"] || "0" } self.merge!() end |
Class Method Details
.ConvertFromCheckoutDetails(checkout_details) ⇒ Object
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/core/data.rb', line 221 def self.ConvertFromCheckoutDetails (checkout_details) profile = { "token" => checkout_details["TOKEN"], "email" => checkout_details["EMAIL"], "item_code" => checkout_details["L_PAYMENTREQUEST_0_NAME0"], "unit_price" => checkout_details["L_PAYMENTREQUEST_0_AMT0"], "quantity" => checkout_details["L_PAYMENTREQUEST_0_QTY0"], "amount" => checkout_details["PAYMENTREQUEST_0_AMT"], "start_date" => Time.now, "period" => "Month", "frequency" => "1" } profile = self.new(profile) end |