paymob_ruby 0.1.1 → 0.1.2

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: 568a679887032b299bbf4111d8591f0bdc0a04914afc873ad6032c67ffa06d72
4
- data.tar.gz: e22125d83676040a2efc5b4c72ae00ed3108177201500b051d0b0e9123bd608c
3
+ metadata.gz: 750c9f04ad4dbc611da0fb7ddbd90b2a92487fe7721d996ce52a0bfa564817b0
4
+ data.tar.gz: 184bf8bed0172cfde51e056c043e73530fd43b760e2fd2693bd5e405f93ad7b4
5
5
  SHA512:
6
- metadata.gz: dd04ecd384ee403c933e1d954c895cb164b43f6704a693284a161230d0a4effc3592b28dbbc380a3d88d26ebfbc436e4af637d27bf4f027d795e9799a61d82fd
7
- data.tar.gz: 5ece42acdb5b91d10cb9da1bae86de4adf104d178200cce7916fe87448e6f25aeff4fe0bc88365d93691cf4c56459812bf88bb690f0978e3f654456c3593fe4e
6
+ metadata.gz: aab1bfc777adc31cfbd2f25c18d9d0951f165fde6756de153ed392a89be0570e0749db475f4a464de3ff69b7766333c8ee369325b3c8b90b1d1d73e7c065e4b1
7
+ data.tar.gz: 71602fa03c0ef3253b1f71126e48f2933ce18d3503d6a8026272d6013fb647341de2649ee3b58887abe291626fdd3c3f3f1a93850510d5958341c57c9088d493
data/README.md CHANGED
@@ -18,12 +18,55 @@ Next, you need to run the generator:
18
18
 
19
19
  ## Usage
20
20
 
21
+ ### Configuration
22
+
23
+ Configure the gem with your configuration
24
+
21
25
  ```ruby
22
26
  PaymobRuby.configure do |config|
23
27
  config.api_key = "api_key"
24
28
  end
25
29
  ```
26
30
 
31
+ :bulb: You can get your API_KEY from Settings -> Account info -> API Key in your Paymob portal.
32
+
33
+ For reference on the internals & specifics of Paymob, please head to their official documentation [here](https://docs.paymob.com/)
34
+
35
+ Any API call will return an object with following methods:
36
+
37
+ ```ruby
38
+ result = PaymobRuby.doSomething
39
+ result.success?
40
+ result.failure?
41
+ result.payload
42
+ result.error
43
+ ```
44
+
45
+ ## Creating a payment:
46
+
47
+ ### Using iframe:
48
+
49
+ ```ruby
50
+ user = { first_name: "John", last_name: "Doe", email: "johndoe@test.com", phone_number: "012xxxxxxxxx" }
51
+ result = PaymobRuby::PayCard.call(user:, amount: 10, integration_id: 12345678, iframe_id: 123)
52
+ ```
53
+
54
+ ### Using motto:
55
+
56
+ ```ruby
57
+ user = { first_name: "John", last_name: "Doe", email: "johndoe@test.com", phone_number: "012xxxxxxxxx" }
58
+ result = PaymobRuby::PayToken.call(user:, amount: 10, integration_id: 12345678, token: "abc123")
59
+ ```
60
+
61
+ ## Errors:
62
+ Errors could be one of the following:
63
+
64
+ ```ruby
65
+ AuthenticationError
66
+ InvalidRequestError (With `param` attribute)
67
+ APIError
68
+ ```
69
+
27
70
  ## Contributing
28
71
 
29
72
  Bug reports and pull requests are welcome.
@@ -61,18 +61,4 @@ module PaymobRuby
61
61
  @sig_header = sig_header
62
62
  end
63
63
  end
64
-
65
- module OAuth
66
- # OAuthError is raised when the OAuth API returns an error.
67
- class OAuthError < PaymobError
68
- def initialize(description, http_status: nil, http_body: nil)
69
- super(description, http_status:, http_body:)
70
- end
71
- end
72
-
73
- # InvalidRequestError is raised when a code, refresh token, or grant type
74
- # parameter is not provided, but was required.
75
- class InvalidRequestError < OAuthError
76
- end
77
- end
78
64
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PaymobRuby
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
data/lib/paymob_ruby.rb CHANGED
@@ -9,11 +9,11 @@ require_relative "paymob_ruby/version"
9
9
  require "paymob_ruby/errors"
10
10
 
11
11
  # API operations
12
- require "paymob_ruby/actions/application_service"
13
- require "paymob_ruby/actions/login"
14
- require "paymob_ruby/actions/payment_token"
15
- require "paymob_ruby/actions/pay_card"
16
- require "paymob_ruby/actions/pay_token"
12
+ require "paymob_ruby/api/application_service"
13
+ require "paymob_ruby/api/login"
14
+ require "paymob_ruby/api/payment_token"
15
+ require "paymob_ruby/api/pay_card"
16
+ require "paymob_ruby/api/pay_token"
17
17
 
18
18
  module PaymobRuby
19
19
  BASE_URI = "https://accept.paymobsolutions.com/api"
Binary file
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paymob_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Kaldas
@@ -46,13 +46,15 @@ files:
46
46
  - lib/generators/paymob_ruby/install_generator.rb
47
47
  - lib/generators/paymob_ruby/templates/paymob.rb
48
48
  - lib/paymob_ruby.rb
49
- - lib/paymob_ruby/actions/application_service.rb
50
- - lib/paymob_ruby/actions/login.rb
51
- - lib/paymob_ruby/actions/pay_card.rb
52
- - lib/paymob_ruby/actions/pay_token.rb
53
- - lib/paymob_ruby/actions/payment_token.rb
49
+ - lib/paymob_ruby/api/application_service.rb
50
+ - lib/paymob_ruby/api/login.rb
51
+ - lib/paymob_ruby/api/pay_card.rb
52
+ - lib/paymob_ruby/api/pay_token.rb
53
+ - lib/paymob_ruby/api/payment_token.rb
54
54
  - lib/paymob_ruby/errors.rb
55
55
  - lib/paymob_ruby/version.rb
56
+ - paymob_ruby-0.1.0.gem
57
+ - paymob_ruby-0.1.1.gem
56
58
  - sig/paymob.rbs
57
59
  homepage: https://github.com/JoeKaldas/paymob
58
60
  licenses:
File without changes
File without changes
File without changes
File without changes