Module: Shoppe::Paypal::PaymentExtensions

Defined in:
lib/shoppe/paypal/payment_extensions.rb

Instance Method Summary collapse

Instance Method Details

#paypal_paymentObject

Get the PayPal payment information from the API



6
7
8
9
10
# File 'lib/shoppe/paypal/payment_extensions.rb', line 6

def paypal_payment
  return false unless self.method == "PayPal"

  @paypal_payment ||= PayPal::SDK::REST::Payment.find(self.reference)
end

#transaction_urlObject

The PayPal transaction URL



13
14
15
16
17
18
19
# File 'lib/shoppe/paypal/payment_extensions.rb', line 13

def transaction_url
  if Rails.env.production?
    "https://history.paypal.com/uk/cgi-bin/webscr?cmd=_history-details-from-hub&id=#{reference}"
  else
    "https://www.sandbox.paypal.com/uk/cgi-bin/webscr?cmd=_history-details-from-hub&id=#{reference}"
  end
end