payfast 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3cf7c91d5a3d8983594082c4f5d6e1e7839bb0cdf854a13690656f6a03090c92
4
- data.tar.gz: 9c349a4f2635aea5e9e27e933db69af130d042e0e1a72ac4d1b109d9638e73cf
3
+ metadata.gz: 7881858525522efec041474ecc6b4ee78bb427e75cc22fc2137638491c17f687
4
+ data.tar.gz: 2f391494ef6d8758c149ebed0b2cf955e2554abf5edde05bcb6774d6f8fbf4f2
5
5
  SHA512:
6
- metadata.gz: 9c9142b1ca87dcc581e69d17dde7c0b54936da0d62f382f8d65fbc66ba38707f4d53fefb96da850aecb232219f7d2ed224cc4fab5bd89f8c3024fe2e4c4bb916
7
- data.tar.gz: 2f8e3f20457989abcc522d4fcbda3d0935cc88f749630db51e34b84a5295b998cd241a6bbff189a57022330eab65589eca36ab5df03a099bb979e1a2e5513d78
6
+ metadata.gz: bd69900dbb2bef5c308bbd3e6358008aed5462b7003340211f4d3fcc3471976f2f9ac0ad7de7e01588d9c12473053d545fe7924c8390f13df9c5f49616c260fb
7
+ data.tar.gz: 0bed2c849e943af30df1e9812e7e712464976a05fae61613559a043e384bfe943c861d62fcb2fe062211e3192e5927e606f50fd9b37fe9f0ab23f4b34c0a6a6c
data/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  Payfast is a Ruby gem that simplifies the process of integrating the PayFast payment gateway into your Ruby on Rails application. It provides a generator that helps scaffold the necessary configuration, routes, models, and controllers required to integrate PayFast seamlessly.
4
4
 
5
+ ## Demo
6
+ ![Peek 2023-08-24 12-15](https://github.com/mactunechy/payfast/assets/37017264/270cf0ab-d453-43ca-9a9a-8b8195dc6b8f)
7
+
8
+
5
9
  ## Installation
6
10
 
7
11
  Add this line to your application's Gemfile:
@@ -9,12 +13,6 @@ Add this line to your application's Gemfile:
9
13
  ```bash
10
14
  bundle add payfast
11
15
  ```
12
- Or install it yourseld as:
13
-
14
-
15
- ```bash
16
- gem install payfast
17
- ```
18
16
 
19
17
  ## Usage
20
18
 
@@ -1,17 +1,16 @@
1
- require "net/http"
2
- require "uri"
1
+ require 'net/http'
2
+ require 'uri'
3
3
 
4
4
  module Payfast
5
+ # Encaspulates the utils for makeing payfast payments using their onsite feature
5
6
  class OnsitePayments
6
7
  def self.generate_signature(payload)
7
8
  passphrase = Rails.application.config_for(:payfast).passphrase
8
9
 
9
- if passphrase
10
- payload[:passphrase] = passphrase
11
- end
10
+ payload[:passphrase] = passphrase if passphrase
12
11
 
13
12
  url_encoded = data_to_string(payload)
14
- create_hash(url_encoded, "md5")
13
+ create_hash(url_encoded, 'md5')
15
14
  end
16
15
 
17
16
  def self.requestPayment(payload)
@@ -20,7 +19,7 @@ module Payfast
20
19
  merchant_key: Rails.application.config_for(:payfast).merchant_key,
21
20
  return_url: Rails.application.config_for(:payfast).return_url,
22
21
  cancel_url: Rails.application.config_for(:payfast).cancel_url,
23
- notify_url: Rails.application.config_for(:payfast).notify_url,
22
+ notify_url: Rails.application.config_for(:payfast).notify_url
24
23
  }.merge(payload)
25
24
 
26
25
  puts payload_with_config
@@ -35,7 +34,7 @@ module Payfast
35
34
 
36
35
  uri = URI.parse(base_url)
37
36
  http = Net::HTTP.new(uri.host, uri.port)
38
- http.use_ssl = true if uri.scheme == "https"
37
+ http.use_ssl = true if uri.scheme == 'https'
39
38
 
40
39
  request = Net::HTTP::Post.new(uri.path)
41
40
  request.body = pf_param_string
@@ -45,12 +44,10 @@ module Payfast
45
44
  JSON.parse(response.body)
46
45
  rescue StandardError => e
47
46
  puts "Error: #{e.message}"
48
- return false
47
+ false
49
48
  end
50
49
  end
51
50
 
52
- private
53
-
54
51
  def self.data_to_string(payload)
55
52
  URI.encode_www_form(payload)
56
53
  end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Payfast
4
+ VERSION = '1.0.7'
5
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: payfast
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dellan Muchengapadare
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-24 00:00:00.000000000 Z
11
+ date: 2024-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -55,14 +55,14 @@ dependencies:
55
55
  description: "# Payfast\n\nPayfast is a Ruby gem that simplifies the process of integrating
56
56
  the PayFast payment gateway into your Ruby on Rails application. It provides a generator
57
57
  that helps scaffold the necessary configuration, routes, models, and controllers
58
- required to integrate PayFast seamlessly.\n\n## Installation\n\nAdd this line to
59
- your application's Gemfile:\n\n```bash\n bundle add payfast\n```\nOr install
60
- it yourseld as:\n\n\n```bash\n gem install payfast\n```\n\n## Usage\n\n```bash\n
61
- \ rails generate payfast:install\n```\n\n## This generator will perform the following
62
- actions:\n\n insert config/routes.rb\n create app/controllers/carts_controller.rb\n
63
- \ create app/views/carts/index.html.erb\n create app/views/carts/make_payment.html.erb\n
64
- \ create app/helpers/carts_helper.rb\n create db/migrate/20230824105530_create_carts.rb\n
65
- \ create config/payfast.yml\n create app/models/cart.rb\n insert app/views/layouts/application.html.erb\n
58
+ required to integrate PayFast seamlessly.\n\n## Demo \n![Peek 2023-08-24 12-15](https://github.com/mactunechy/payfast/assets/37017264/270cf0ab-d453-43ca-9a9a-8b8195dc6b8f)\n\n\n##
59
+ Installation\n\nAdd this line to your application's Gemfile:\n\n```bash\n bundle
60
+ add payfast\n```\n\n## Usage\n\n```bash\n rails generate payfast:install\n```\n\n##
61
+ This generator will perform the following actions:\n\n insert config/routes.rb\n
62
+ \ create app/controllers/carts_controller.rb\n create app/views/carts/index.html.erb\n
63
+ \ create app/views/carts/make_payment.html.erb\n create app/helpers/carts_helper.rb\n
64
+ \ create db/migrate/20230824105530_create_carts.rb\n create config/payfast.yml\n
65
+ \ create app/models/cart.rb\n insert app/views/layouts/application.html.erb\n
66
66
  \ insert config/environments/development.rb\n\n\n\n## Additional configuration\n\nSetup
67
67
  payfast credentials for your environment\n\n rails EDITOR=\"code --wait\" bin/rails
68
68
  credentials:edit\n \n This will allow you to securely edit and store your credentials.
@@ -119,11 +119,12 @@ files:
119
119
  - lib/generators/payfast/templates/model.rb
120
120
  - lib/generators/payfast/templates/routes.rb
121
121
  - lib/payfast/onsite_payments.rb
122
- homepage: https://github.com/mactunechy/payfast-gem
122
+ - lib/payfast/version.rb
123
+ homepage: https://github.com/mactunechy/payfast
123
124
  licenses:
124
125
  - MIT
125
126
  metadata: {}
126
- post_install_message:
127
+ post_install_message:
127
128
  rdoc_options: []
128
129
  require_paths:
129
130
  - lib
@@ -131,15 +132,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
131
132
  requirements:
132
133
  - - ">="
133
134
  - !ruby/object:Gem::Version
134
- version: '0'
135
+ version: 2.7.0
135
136
  required_rubygems_version: !ruby/object:Gem::Requirement
136
137
  requirements:
137
138
  - - ">="
138
139
  - !ruby/object:Gem::Version
139
140
  version: '0'
140
141
  requirements: []
141
- rubygems_version: 3.3.26
142
- signing_key:
142
+ rubygems_version: 3.3.27
143
+ signing_key:
143
144
  specification_version: 4
144
145
  summary: A light weight gem to setup payfast payment gateway
145
146
  test_files: []