module KsExpressPaypal

Declare a constant api_version This is the release version of the developing API used in this gem One of the parameters mandatory for each call No need to pass it from the user's side Keep it here and change it from here

Module is loaded for making requests Initialize the object's constructor first version :=> Version of the API used params :=> To hold the parameters passed by the gem user payment_amount :=> To hold the amount passed by the user payment_action :=> To hold the action of the payment. default it is 'SALE' payment_currency :=> Currency used ex: USD cancel_url :=> URL to which the user is redirected when he/she cancels the payment return_url :=> URL to which the user is redirected upon the successful completion of the payment

Public Class Methods

ks_merchants_details() click to toggle source

Method to take the paypal credentials The credentials must be included in the app Merge the VERSION declared in the KsExpressPaypal module Value of the VERSION is declared as constant

# File lib/koduc_express_paypal.rb, line 30
def self.ks_merchants_details
        begin
                ks_merchants_details = Rails.configuration.paypal_credentials.merge(VERSION: KsExpressPaypal.api_version)
        rescue => exc
                if !exc.message.nil?
                        error =  KsExceptionHandling::KsAPIErrors.new(exc.message)
                        error.ks_error_messages
                end
        end
end