README.md in pesapal-1.2.0 vs README.md in pesapal-1.2.1

- old
+ new

@@ -14,11 +14,11 @@ directly, I'd rather you submit [issues (and even requests) here][6]. This way, other people get to share in the conversation that would have been private and out of their reach. The gem should be [up on RubyGems.org][7], it's [accompanying RubyDoc reference -here][13] and [all the releases here][12]. +here][13], the [CHANGELOG here][21] and [all the releases here][12]. If you are [feeling generous and want to contribute, feel free][9]. _Ps: No 3rd party oAuth library dependencies, it handles all the oAuth flows on it's own so your app is one dependency less._ @@ -66,14 +66,16 @@ pesapal = Pesapal::Merchant.new(:development) ``` ####Option 1#### -In the case, the configuration has already been loaded (at application start by -initializer) from a YAML file located at `"#{Rails.root}/config/pesapal.yml"` by -default. This is the recommended method. +In the above case, the configuration has already been loaded (at application +start by initializer) from a YAML file located at +`"#{Rails.root}/config/pesapal.yml"` by default. +This is the recommended method. + ####Option 2#### It's also possible to set the configuration details from a YAML file at the location of your choice upon initialization as shown in the example below. This option overrides the default YAML config (explained above) and will be loaded @@ -122,20 +124,26 @@ callback_url: 'http://1.2.3.4:3000/pesapal/callback' consumer_key: '<YOUR_CONSUMER_KEY>' consumer_secret: '<YOUR_CONSUMER_SECRET>' ``` +_Ps: Immediately after initializing the Pesapal object, some people might find +it peculiar that the `pesapal.config` is an empty hash i.e. `{}`. Don't worry. +If you have set up the `pesapal.yml` correctly, any attempt to run any of the +methods will eventually populate this hash with the values that were loaded by +the initializer (see option #1 above, stated as the default)._ + ### Posting An Order ### Once you've finalized the configuration, set up the order details in a hash as shown in the example below ... all keys **MUST** be present. If there's one that you wish to ignore just leave it with a blank string but make sure it's included e.g. the phonenumber. ```ruby -#set order details +#set order details pesapal.order_details = { :amount => 1000, :description => 'this is the transaction description', :type => 'MERCHANT', :reference => 808-707-606, :first_name => 'Swaleh', @@ -199,11 +207,11 @@ ``` The result is a hash that looks something like this ... ``` -{ +{ :method => "<PAYMENT_METHOD>", :status => "<PAYMENT_STATUS>", :merchant_reference => "<MERCHANT_REFERENCE>", :transaction_tracking_id => "<TRANSACTION_ID>" } @@ -224,11 +232,11 @@ Using the status you can customise any actions (e.g. database inserts and updates) and finally, it's upto you to send the `:response` back to pesapal. The hard part is done for you. ``` -{ +{ :status => "<PAYMENT_STATUS>", :response => "<IPN_RESPONSE>" } ``` @@ -287,5 +295,6 @@ [16]: http://kingori.co/articles/2013/09/modus-operandi/ [17]: https://github.com/itsmrwave/pesapal-rubygem/pulls [18]: http://developer.pesapal.com/how-to-integrate/step-by-step [19]: https://github.com/itsmrwave/pesapal-rubygem/graphs/contributors [20]: http://guides.rubyonrails.org/ +[21]: https://github.com/itsmrwave/pesapal-rubygem/blob/master/CHANGELOG.md#changelog