webpay_interswitch 1.1.2 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c47746c17efa79f3eb14d948bf3ff681138f4974
4
+ data.tar.gz: bce3fd7ece6eb7479f9c508a78474cf65e8f9408
5
+ SHA512:
6
+ metadata.gz: fe515ffeeafcfb679528f6ee956a8fe6ff744effb5a21ee2b011e2c34105da07784a7dbb9bf86cde9d486601fb88015145ee2e5fa65326e0dd3cbcb39b65a0dd
7
+ data.tar.gz: 4436de9c6a0aa6d6b46e3e632603ba1d8c2dc7cad6478d523c1ac43637e3da00800e31afb0d2a82761fbf64b00101854352ee8f358ea5dd775c945057b5866c5
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- #WebpayInterswitch
1
+ # WebpayInterswitch
2
2
 
3
3
 
4
4
  [![Code Climate](https://codeclimate.com/github/vinsol/webpay_interswitch.png)](https://codeclimate.com/github/vinsol/webpay_interswitch)
@@ -30,13 +30,13 @@ It also adds a `webpay_interswitch.yml.example` file which should be considered
30
30
  It comes with a helper method that seamlessly adds a webpay form to your Rails application.
31
31
 
32
32
  ```ruby
33
- <%= form_for_webpay(txn_ref, amount) %>
33
+ <%= form_for_webpay(txn_ref, amount, cust_name, cust_id) %>
34
34
  ```
35
35
 
36
36
  This helper adds a button (Along with all the hidden elements required to make the transaction). You can also configure the text that appears on the button and add any valid html attributes to it like:
37
37
 
38
38
  ```ruby
39
- <%= form_for_webpay(txn_ref, amount, { submit_button_text: 'Make Payment', class: 'btn-class' }) %>
39
+ <%= form_for_webpay(txn_ref, amount, cust_name, cust_id, { submit_button_text: 'Make Payment', class: 'btn-class' }) %>
40
40
  ```
41
41
 
42
42
  txn_ref must be a globally unique number generated by your application. Each request that hits the gateway must have a unique value of txn_ref. To avoid polluting the global space, consider prefixing it with a specific string. E.g. my_app_1, my_app_2 and so on for each transaction.
@@ -3,10 +3,12 @@ module WebpayInterswitch
3
3
 
4
4
  include WebpayInterswitch::Core
5
5
 
6
- def initialize(txn_ref, amount, html_options, optional_parameters)
6
+ def initialize(txn_ref, amount, cust_name, cust_id, html_options, optional_parameters)
7
7
  @txn_ref = txn_ref
8
8
  @amount = amount
9
9
  @html_options = html_options
10
+ @cust_name = cust_name
11
+ @cust_id = cust_id
10
12
  @optional_parameters = optional_parameters
11
13
  sanitize_options
12
14
  end
@@ -45,6 +47,8 @@ module WebpayInterswitch
45
47
  txn_elem_html = generate_input_field('txn_ref', @txn_ref)
46
48
  txn_elem_html += generate_input_field('amount', @amount)
47
49
  txn_elem_html += generate_input_field('hash', sha_hash(string_for_hash_param))
50
+ txn_elem_html += generate_input_field('cust_name', @cust_name)
51
+ txn_elem_html += generate_input_field('cust_id', @cust_id)
48
52
  end
49
53
 
50
54
  def generate_optional_parameter_elements
@@ -7,7 +7,7 @@ module WebpayInterswitch
7
7
 
8
8
  cattr_accessor :product_id, :pay_item_id, :currency, :site_redirect_url, :mac_key, :test
9
9
 
10
- TEST_URL = 'https://stageserv.interswitchng.com/test_paydirect/pay'
10
+ TEST_URL = 'https://sandbox.interswitchng.com/webpay/pay'
11
11
 
12
12
  LIVE_URL = 'https://webpay.interswitchng.com/paydirect/pay'
13
13
 
@@ -52,4 +52,4 @@ module WebpayInterswitch
52
52
  end
53
53
  end
54
54
 
55
- end
55
+ end
@@ -22,7 +22,7 @@ module WebpayInterswitch
22
22
  # response is populated when a transactions search query is sent.
23
23
  attr_accessor :txnref, :resp, :desc, :payRef, :retRef, :cardNum, :amount, :response
24
24
 
25
- TEST_URL = 'https://stageserv.interswitchng.com/test_paydirect/api/v1/gettransaction.json'
25
+ TEST_URL = 'https://sandbox.interswitchng.com/webpay/api/v1/gettransaction.json'
26
26
 
27
27
  LIVE_URL = 'https://webpay.interswitchng.com/paydirect/api/v1/gettransaction.json'
28
28
 
@@ -88,4 +88,4 @@ module WebpayInterswitch
88
88
  end
89
89
 
90
90
  end
91
- end
91
+ end
@@ -1,3 +1,3 @@
1
1
  module WebpayInterswitch
2
- VERSION = '1.1.2'.freeze
2
+ VERSION = '2.0.0'.freeze
3
3
  end
@@ -1,11 +1,10 @@
1
1
  module WebpayInterswitch
2
2
  module ViewHelper
3
3
 
4
- def form_for_webpay(txn_ref, amount, html_options={}, optional_parameters={})
5
- form_builder = WebpayInterswitch::FormBuilder.new(txn_ref, amount, html_options, optional_parameters)
4
+ def form_for_webpay(txn_ref, amount, cust_name, cust_id, html_options={}, optional_parameters={})
5
+ form_builder = WebpayInterswitch::FormBuilder.new(txn_ref, amount, cust_name, cust_id, html_options, optional_parameters)
6
6
  WebpayInterswitch::Gateway.new.validate!
7
7
  form_builder.generate_webpay_form.html_safe if form_builder.valid?
8
8
  end
9
-
10
9
  end
11
10
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webpay_interswitch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
5
- prerelease:
4
+ version: 2.0.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Shubham Gupta
@@ -10,12 +9,11 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2015-08-26 00:00:00.000000000 Z
12
+ date: 2017-11-03 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: rails
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
18
  - - ">="
21
19
  - !ruby/object:Gem::Version
@@ -23,7 +21,6 @@ dependencies:
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
25
  - - ">="
29
26
  - !ruby/object:Gem::Version
@@ -51,28 +48,26 @@ files:
51
48
  homepage: http://vinsol.com
52
49
  licenses:
53
50
  - MIT
51
+ metadata: {}
54
52
  post_install_message:
55
53
  rdoc_options: []
56
54
  require_paths:
57
55
  - lib
58
56
  required_ruby_version: !ruby/object:Gem::Requirement
59
- none: false
60
57
  requirements:
61
58
  - - ">="
62
59
  - !ruby/object:Gem::Version
63
60
  version: '0'
64
61
  required_rubygems_version: !ruby/object:Gem::Requirement
65
- none: false
66
62
  requirements:
67
63
  - - ">="
68
64
  - !ruby/object:Gem::Version
69
65
  version: '0'
70
66
  requirements: []
71
67
  rubyforge_project:
72
- rubygems_version: 1.8.25
68
+ rubygems_version: 2.4.5.1
73
69
  signing_key:
74
- specification_version: 3
70
+ specification_version: 4
75
71
  summary: A simple gem to integrate your Rails app with Webpay Interswitch, a nigerian
76
72
  payment gateway
77
73
  test_files: []
78
- has_rdoc: