juspay_checkout 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +52 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/juspay_checkout.gemspec +29 -0
- data/lib/generators/.DS_Store +0 -0
- data/lib/generators/juspay_checkout/.DS_Store +0 -0
- data/lib/generators/juspay_checkout/install/.DS_Store +0 -0
- data/lib/generators/juspay_checkout/install/install_generator.rb +16 -0
- data/lib/generators/juspay_checkout/install/templates/juspay.yml +12 -0
- data/lib/juspay_checkout.rb +7 -0
- data/lib/juspay_checkout/card.rb +23 -0
- data/lib/juspay_checkout/customer.rb +41 -0
- data/lib/juspay_checkout/express_checkout.rb +35 -0
- data/lib/juspay_checkout/order.rb +23 -0
- data/lib/juspay_checkout/payment.rb +13 -0
- data/lib/juspay_checkout/signature.rb +24 -0
- data/lib/juspay_checkout/version.rb +3 -0
- data/lib/juspay_checkout/wallet.rb +62 -0
- metadata +109 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 42fdaa3c18daaeb42ccedb65ebf93f9c0efa18d8c2cc1852cb2d53b403be220b
|
4
|
+
data.tar.gz: 431fadfb9c0e85b308cf643b40c7bcc97012748d2208111629690c2904e3492c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f7dd1896f63b4081d42463958edf04dc18e8d3b30b4d85c4ce3b2add00a3371af7f5afbab715e175fed87c6cc344dc290dd9460be15989476613f08d560ab814
|
7
|
+
data.tar.gz: 965a807ec0f97cbced29457ba775323fe4f282b7bd62b1066746705c09bd0c5ab7ec45bc432a5b96b05dc6d931199265e6888951cebcc6ca31dc0b35f9bd0747
|
data/.gitignore
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at sandipkaranjekar@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 sandipkaranjekar
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# JuspayCheckout
|
2
|
+
|
3
|
+
Juspay is aggregator for most of the payment gateways, so I have created the gem to interact with the Juspay APIs (https://www.juspay.in/docs/api/ec/?shell#introduction).
|
4
|
+
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem 'juspay_checkout'
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
bundle
|
18
|
+
```
|
19
|
+
|
20
|
+
Or install it yourself as:
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
gem install juspay_checkout
|
24
|
+
```
|
25
|
+
|
26
|
+
Also you need to run generator to set the files -
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
rails g juspay_checkout:install juspay_checkout
|
30
|
+
```
|
31
|
+
|
32
|
+
## Usage
|
33
|
+
|
34
|
+
TODO: Write usage instructions here
|
35
|
+
|
36
|
+
## Development
|
37
|
+
|
38
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
39
|
+
|
40
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
41
|
+
|
42
|
+
## Contributing
|
43
|
+
|
44
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/juspay_checkout. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
45
|
+
|
46
|
+
## License
|
47
|
+
|
48
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
49
|
+
|
50
|
+
## Code of Conduct
|
51
|
+
|
52
|
+
Everyone interacting in the JuspayCheckout project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/juspay_checkout/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "juspay_checkout"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "juspay_checkout/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "juspay_checkout"
|
8
|
+
spec.version = JuspayCheckout::VERSION
|
9
|
+
spec.authors = ["sandipkaranjekar"]
|
10
|
+
spec.email = ["sandipkaranjekar@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Juspay payment gateway library}
|
13
|
+
spec.description = %q{Library for Express Checkout APIs Juspay.}
|
14
|
+
spec.homepage = "https://github.com/sandipkaranjekar/juspay"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Specify which files should be added to the gem when it is released.
|
18
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
19
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
20
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
21
|
+
end
|
22
|
+
spec.bindir = "exe"
|
23
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
|
+
spec.require_paths = ["lib"]
|
25
|
+
|
26
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
27
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
28
|
+
spec.add_dependency "httparty", "~> 0.13.5"
|
29
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
module JuspayCheckout
|
4
|
+
module Generators
|
5
|
+
class InstallGenerator < Rails::Generators::Base
|
6
|
+
def self.source_root
|
7
|
+
source_root ||= File.join(File.dirname(__FILE__), 'templates/')
|
8
|
+
end
|
9
|
+
|
10
|
+
def copy_validate_api_yml_file
|
11
|
+
copy_file "juspay.yml", "config/juspay.yml"
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module JuspayCheckout
|
2
|
+
class Card < JuspayCheckout::ExpressCheckout
|
3
|
+
class << self
|
4
|
+
|
5
|
+
# DOC - https://www.juspay.in/docs/api/ec/?shell#get-order-status
|
6
|
+
# curl https://api.juspay.in/orders/145678234 \
|
7
|
+
# -u your_api_key:
|
8
|
+
def get_saved(customer_id)
|
9
|
+
JuspayCheckout::ExpressCheckout.request("/cards?customer_id=#{customer_id}", 'get')
|
10
|
+
end
|
11
|
+
|
12
|
+
# DOC - https://www.juspay.in/docs/api/ec/?ruby#create-order
|
13
|
+
def get_info(cardbin)
|
14
|
+
JuspayCheckout::ExpressCheckout.request("/cardbins/#{cardbin}?merchant_id=bewakoof&options.check_atm_pin_auth_support=true", 'get')
|
15
|
+
end
|
16
|
+
|
17
|
+
# DOC - https://www.juspay.in/docs/api/ec/?shell#refund-order
|
18
|
+
def delete(token)
|
19
|
+
JuspayCheckout::ExpressCheckout.request("/card/delete", 'post', {card_token: token})
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module JuspayCheckout
|
2
|
+
class Customer < JuspayCheckout::ExpressCheckout
|
3
|
+
class << self
|
4
|
+
|
5
|
+
# DOC - https://www.juspay.in/docs/api/ec/?shell#get-customer
|
6
|
+
# curl -X GET https://api.juspay.in/customers/customer@gmail.com
|
7
|
+
# -u your_api_key:
|
8
|
+
def get_details(customer_id)
|
9
|
+
JuspayCheckout::ExpressCheckout.request("/customers/#{customer_id}", 'get')
|
10
|
+
end
|
11
|
+
|
12
|
+
# DOC - https://www.juspay.in/docs/api/ec/?shell#create-customer
|
13
|
+
# Example request
|
14
|
+
# curl -X POST https://api.juspay.in/customers
|
15
|
+
# -u your_api_key:
|
16
|
+
# -d "object_reference_id=customer@gmail.com"
|
17
|
+
# -d "mobile_number=9000000001"
|
18
|
+
# -d "email_address=customer@gmail.com"
|
19
|
+
# -d "first_name=Sandip"
|
20
|
+
# -d "last_name=Patil"
|
21
|
+
# -d "mobile_country_code=91"
|
22
|
+
def create(params = {})
|
23
|
+
JuspayCheckout::ExpressCheckout.request('/customers', 'post', params)
|
24
|
+
end
|
25
|
+
|
26
|
+
# DOC - https://www.juspay.in/docs/api/ec/?shell#update-customer
|
27
|
+
# Example request
|
28
|
+
# curl -X POST https://api.juspay.in/customers/cst_om2l6ctlptxwxuzj
|
29
|
+
# -u your_api_key:
|
30
|
+
# -d "mobile_number=9000000002"
|
31
|
+
# -d "email_address=customer@gmail.com"
|
32
|
+
# -d "first_name=Sandip"
|
33
|
+
# -d "last_name=Patil"
|
34
|
+
# -d "mobile_country_code=91"
|
35
|
+
def update(params = {})
|
36
|
+
JuspayCheckout::ExpressCheckout.request("/customers/#{params['customer_id']}", 'post', params.except(:customer_id))
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module JuspayCheckout
|
2
|
+
class ExpressCheckout
|
3
|
+
class << self
|
4
|
+
def request(partial_url, http_method, params = {})
|
5
|
+
begin
|
6
|
+
# base url for juspay
|
7
|
+
if ::Rails.env == 'production'
|
8
|
+
base_url = 'https://api.juspay.in'
|
9
|
+
else
|
10
|
+
base_url = 'https://sandbox.juspay.in'
|
11
|
+
end
|
12
|
+
$juspay_config or credential_config
|
13
|
+
# basic auth info
|
14
|
+
auth = {username: $juspay_config['api_key'], password: ''}
|
15
|
+
|
16
|
+
# header
|
17
|
+
header = {'Accept': 'application/json'}
|
18
|
+
|
19
|
+
if http_method == 'get'
|
20
|
+
response = HTTParty.get(base_url+partial_url, basic_auth: auth, headers: header).to_hash rescue nil
|
21
|
+
elsif http_method == 'post'
|
22
|
+
response = HTTParty.post(base_url+partial_url, body: params, basic_auth: auth, headers: header).to_hash rescue nil
|
23
|
+
end
|
24
|
+
response
|
25
|
+
rescue
|
26
|
+
nil
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def credential_config
|
31
|
+
$juspay_config = ::Rails.application.config_for(:juspay)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module JuspayCheckout
|
2
|
+
class Order < JuspayCheckout::ExpressCheckout
|
3
|
+
class << self
|
4
|
+
|
5
|
+
# DOC - https://www.juspay.in/docs/api/ec/?shell#get-order-status
|
6
|
+
# curl https://api.juspay.in/orders/145678234 \
|
7
|
+
# -u your_api_key:
|
8
|
+
def get_status(order_id)
|
9
|
+
JuspayCheckout::ExpressCheckout.request("/orders/#{order_id}", 'get')
|
10
|
+
end
|
11
|
+
|
12
|
+
# DOC - https://www.juspay.in/docs/api/ec/?ruby#create-order
|
13
|
+
def create(params = {})
|
14
|
+
JuspayCheckout::ExpressCheckout.request("/orders", 'post', params)
|
15
|
+
end
|
16
|
+
|
17
|
+
# DOC - https://www.juspay.in/docs/api/ec/?shell#refund-order
|
18
|
+
def refund(order_id, params = {})
|
19
|
+
JuspayCheckout::ExpressCheckout.request("/orders/#{order_id}/refunds", 'post', params)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module JuspayCheckout
|
2
|
+
class Payment < JuspayCheckout::ExpressCheckout
|
3
|
+
class << self
|
4
|
+
# Gives list of all the payment methods available for your account.
|
5
|
+
# DOC - https://www.juspay.in/docs/api/ec/?shell#payment-methods
|
6
|
+
# curl -X GET https://api.juspay.in/merchants/guest/paymentmethods
|
7
|
+
def get_payment_method
|
8
|
+
JuspayCheckout::ExpressCheckout.request('/merchants/bewakoof/paymentmethods', 'get')
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module JuspayCheckout
|
2
|
+
class Signature
|
3
|
+
class << self
|
4
|
+
# DOC - https://www.juspay.in/docs/advanced/ec/response/index.html
|
5
|
+
# After the redirect, the authenticity should be verified using the signature in the response.
|
6
|
+
# The signature parameter in the return_url gives the HMAC signature computed using the algorithm specified by the signature_algorithm parameter.
|
7
|
+
def is_valid?(params, signature)
|
8
|
+
if params.present?
|
9
|
+
$juspay_config or JuspayCheckout::ExpressCheckout.credential_config
|
10
|
+
params = params.with_indifferent_access
|
11
|
+
parameter = params.except("signature", "signature_algorithm", "format", "controller", "action")
|
12
|
+
encoded_list = []
|
13
|
+
parameter.keys.sort.each { |k| encoded_list << URI.encode(k) + "=" + URI.encode(params[k]) }
|
14
|
+
data = CGI.escape(encoded_list.join("&"))
|
15
|
+
|
16
|
+
hash_string = CGI.escape(Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), $juspay_config['response_key'], data)).strip())
|
17
|
+
|
18
|
+
return signature == hash_string
|
19
|
+
end
|
20
|
+
false
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
module JuspayCheckout
|
2
|
+
class Wallet < JuspayCheckout::ExpressCheckout
|
3
|
+
class << self
|
4
|
+
|
5
|
+
# DOC - https://www.juspay.in/docs/api/ec/?shell#list
|
6
|
+
# curl -X GET https://api.juspay.in/customers/guest_user/wallets
|
7
|
+
# -u your_api_key:
|
8
|
+
def get_list(customer_id)
|
9
|
+
JuspayCheckout::ExpressCheckout.request("/customers/#{customer_id}/wallets", 'get')
|
10
|
+
end
|
11
|
+
|
12
|
+
# DOC - https://www.juspay.in/docs/api/ec/?shell#get
|
13
|
+
# curl -X GET https://api.juspay.in/wallets/$wallet_id
|
14
|
+
# -u your_api_key:
|
15
|
+
def get_details(wallet_id)
|
16
|
+
JuspayCheckout::ExpressCheckout.request("/wallets/#{wallet_id}", 'get')
|
17
|
+
end
|
18
|
+
|
19
|
+
# DOC - https://www.juspay.in/docs/api/ec/?shell#create
|
20
|
+
# curl -X POST https://api.juspay.in/customers/$customer_id/wallets
|
21
|
+
# -u your_api_key:
|
22
|
+
# -d "gateway=MOBIKWIK"
|
23
|
+
# -d "command=authenticate"
|
24
|
+
def create(customer_id, wallet)
|
25
|
+
JuspayCheckout::ExpressCheckout.request("/customers/#{customer_id}/wallets", 'post', {command: "authenticate", gateway: wallet})
|
26
|
+
end
|
27
|
+
|
28
|
+
# DOC - https://www.juspay.in/docs/api/ec/?shell#link
|
29
|
+
# curl -X POST https://api.juspay.in/wallets/$wallet_id
|
30
|
+
# -u your_api_key:
|
31
|
+
# -d "command=link"
|
32
|
+
# -d "otp=345678"
|
33
|
+
def link(wallet_id, otp)
|
34
|
+
JuspayCheckout::ExpressCheckout.request("/wallets/#{wallet_id}", 'post', {command: 'link', otp: otp})
|
35
|
+
end
|
36
|
+
|
37
|
+
# DOC - https://www.juspay.in/docs/api/ec/?shell#delink
|
38
|
+
# curl -X POST https://api.juspay.in/wallets/$wallet_id
|
39
|
+
# -u your_api_key:
|
40
|
+
# -d "command=delink"
|
41
|
+
def delink(wallet_id)
|
42
|
+
JuspayCheckout::ExpressCheckout.request("/wallets/#{wallet_id}", 'post', {command: 'delink'})
|
43
|
+
end
|
44
|
+
|
45
|
+
# DOC - https://www.juspay.in/docs/api/ec/?shell#authenticate
|
46
|
+
# curl -X POST https://api.juspay.in/wallets/$wallet_id \
|
47
|
+
# -u your_api_key: \
|
48
|
+
# -d "command=authenticate"
|
49
|
+
def authenticate(wallet_id)
|
50
|
+
JuspayCheckout::ExpressCheckout.request("/wallets/#{wallet_id}", 'post', {command: "authenticate"})
|
51
|
+
end
|
52
|
+
|
53
|
+
# DOC - https://www.juspay.in/docs/api/ec/?shell#refresh
|
54
|
+
# curl -X POST https://api.juspay.in/wallets/$wallet_id
|
55
|
+
# -u your_api_key:
|
56
|
+
# -d "command=refresh"
|
57
|
+
def refresh(wallet_id)
|
58
|
+
JuspayCheckout::ExpressCheckout.request("/wallets/#{wallet_id}", 'post', {command: 'refresh'})
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
metadata
ADDED
@@ -0,0 +1,109 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: juspay_checkout
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- sandipkaranjekar
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-02-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.16'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.16'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: httparty
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.13.5
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.13.5
|
55
|
+
description: Library for Express Checkout APIs Juspay.
|
56
|
+
email:
|
57
|
+
- sandipkaranjekar@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- CODE_OF_CONDUCT.md
|
64
|
+
- Gemfile
|
65
|
+
- LICENSE.txt
|
66
|
+
- README.md
|
67
|
+
- Rakefile
|
68
|
+
- bin/console
|
69
|
+
- bin/setup
|
70
|
+
- juspay_checkout.gemspec
|
71
|
+
- lib/generators/.DS_Store
|
72
|
+
- lib/generators/juspay_checkout/.DS_Store
|
73
|
+
- lib/generators/juspay_checkout/install/.DS_Store
|
74
|
+
- lib/generators/juspay_checkout/install/install_generator.rb
|
75
|
+
- lib/generators/juspay_checkout/install/templates/juspay.yml
|
76
|
+
- lib/juspay_checkout.rb
|
77
|
+
- lib/juspay_checkout/card.rb
|
78
|
+
- lib/juspay_checkout/customer.rb
|
79
|
+
- lib/juspay_checkout/express_checkout.rb
|
80
|
+
- lib/juspay_checkout/order.rb
|
81
|
+
- lib/juspay_checkout/payment.rb
|
82
|
+
- lib/juspay_checkout/signature.rb
|
83
|
+
- lib/juspay_checkout/version.rb
|
84
|
+
- lib/juspay_checkout/wallet.rb
|
85
|
+
homepage: https://github.com/sandipkaranjekar/juspay
|
86
|
+
licenses:
|
87
|
+
- MIT
|
88
|
+
metadata: {}
|
89
|
+
post_install_message:
|
90
|
+
rdoc_options: []
|
91
|
+
require_paths:
|
92
|
+
- lib
|
93
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
requirements: []
|
104
|
+
rubyforge_project:
|
105
|
+
rubygems_version: 2.7.7
|
106
|
+
signing_key:
|
107
|
+
specification_version: 4
|
108
|
+
summary: Juspay payment gateway library
|
109
|
+
test_files: []
|