paygate-ruby 0.1.6 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,81 +1,86 @@
1
- window.Paygate = (function() {
2
- function Paygate() {}
3
-
4
- Paygate.fieldsMap = {
5
- mid: 'mid',
6
- locale: 'langcode',
7
- charset: 'charset',
8
- title: 'goodname',
9
- currency: 'goodcurrency',
10
- amount: 'unitprice',
11
- payMethod: 'paymethod',
12
- customerName: 'receipttoname',
13
- customerEmail: 'receipttoemail',
14
- cardNumber: 'cardnumber',
15
- expiryYear: 'cardexpireyear',
16
- expiryMonth: 'cardexpiremonth',
17
- cvv: 'cardsecretnumber',
18
- cardAuthCode: 'cardauthcode',
19
- responseCode: 'replycode',
20
- responseMessage: 'replyMsg',
21
- tid: 'tid',
22
- profileNo: 'profile_no',
23
- hashResult: 'hashresult'
24
- };
25
-
26
- Paygate.openPayApiForm = function() {
27
- return document.querySelector('form[name=PGIOForm]');
28
- };
29
-
30
- Paygate.openPayApiScreen = function() {
31
- return document.querySelector('#PGIOscreen');
32
- };
33
-
34
- Paygate.openPayApiFields = function() {
35
- var formChildren = Array.from(this.openPayApiForm().children);
36
- return formChildren.filter(function(el) {
37
- return el.tagName === 'INPUT';
38
- });
39
- }
40
-
41
- Paygate.findInputByName = function(name) {
42
- var mappedName = this.fieldsMap[name];
43
- return this.openPayApiFields().filter(function(el) {
44
- return el.name === mappedName;
45
- })[0];
46
- };
47
-
48
- Paygate.cardAuthCode = function() {
49
- return this.findInputByName('cardAuthCode').value;
50
- };
51
-
52
- Paygate.responseCode = function() {
53
- return this.findInputByName('responseCode').value;
54
- };
55
-
56
- Paygate.responseMessage = function() {
57
- return this.findInputByName('responseMessage').value;
58
- };
59
-
60
- Paygate.tid = function() {
61
- return this.findInputByName('tid').value;
62
- };
63
-
64
- Paygate.profileNo = function() {
65
- return this.findInputByName('profileNo').value;
66
- };
67
-
68
- Paygate.hashResult = function() {
69
- return this.findInputByName('hashResult').value;
70
- };
71
-
72
- Paygate.fillInput = function(field, value) {
73
- this.findInputByName(field).value = value;
74
- };
75
-
76
- Paygate.submitForm = function() {
77
- doTransaction(document.PGIOForm);
78
- };
79
-
80
- return Paygate;
81
- })();
1
+ window.Paygate = (function() {
2
+ function Paygate() {}
3
+
4
+ Paygate.fieldsMap = {
5
+ mid: 'mid',
6
+ locale: 'langcode',
7
+ charset: 'charset',
8
+ title: 'goodname',
9
+ currency: 'goodcurrency',
10
+ amount: 'unitprice',
11
+ meta1: 'goodoption1',
12
+ meta2: 'goodoption2',
13
+ meta3: 'goodoption3',
14
+ meta4: 'goodoption4',
15
+ meta5: 'goodoption5',
16
+ payMethod: 'paymethod',
17
+ customerName: 'receipttoname',
18
+ customerEmail: 'receipttoemail',
19
+ cardNumber: 'cardnumber',
20
+ expiryYear: 'cardexpireyear',
21
+ expiryMonth: 'cardexpiremonth',
22
+ cvv: 'cardsecretnumber',
23
+ cardAuthCode: 'cardauthcode',
24
+ responseCode: 'replycode',
25
+ responseMessage: 'replyMsg',
26
+ tid: 'tid',
27
+ profileNo: 'profile_no',
28
+ hashResult: 'hashresult'
29
+ };
30
+
31
+ Paygate.openPayApiForm = function() {
32
+ return document.querySelector('form[name=PGIOForm]');
33
+ };
34
+
35
+ Paygate.openPayApiScreen = function() {
36
+ return document.querySelector('#PGIOscreen');
37
+ };
38
+
39
+ Paygate.openPayApiFields = function() {
40
+ var formChildren = Array.from(this.openPayApiForm().children);
41
+ return formChildren.filter(function(el) {
42
+ return el.tagName === 'INPUT';
43
+ });
44
+ }
45
+
46
+ Paygate.findInputByName = function(name) {
47
+ var mappedName = this.fieldsMap[name];
48
+ return this.openPayApiFields().filter(function(el) {
49
+ return el.name === mappedName;
50
+ })[0];
51
+ };
52
+
53
+ Paygate.cardAuthCode = function() {
54
+ return this.findInputByName('cardAuthCode').value;
55
+ };
56
+
57
+ Paygate.responseCode = function() {
58
+ return this.findInputByName('responseCode').value;
59
+ };
60
+
61
+ Paygate.responseMessage = function() {
62
+ return this.findInputByName('responseMessage').value;
63
+ };
64
+
65
+ Paygate.tid = function() {
66
+ return this.findInputByName('tid').value;
67
+ };
68
+
69
+ Paygate.profileNo = function() {
70
+ return this.findInputByName('profileNo').value;
71
+ };
72
+
73
+ Paygate.hashResult = function() {
74
+ return this.findInputByName('hashResult').value;
75
+ };
76
+
77
+ Paygate.fillInput = function(field, value) {
78
+ this.findInputByName(field).value = value;
79
+ };
80
+
81
+ Paygate.submitForm = function() {
82
+ doTransaction(document.PGIOForm);
83
+ };
84
+
85
+ return Paygate;
86
+ })();
metadata CHANGED
@@ -1,60 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paygate-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - jagdeepsingh
8
- autorequire:
9
- bindir: exe
8
+ autorequire:
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-01 00:00:00.000000000 Z
11
+ date: 2022-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.15'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.15'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
41
- description:
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description:
42
56
  email:
43
57
  - jagdeepsingh.125k@gmail.com
44
58
  executables: []
45
59
  extensions: []
46
60
  extra_rdoc_files: []
47
61
  files:
48
- - ".gitignore"
49
62
  - CHANGELOG.md
50
- - CODE_OF_CONDUCT.md
51
- - Gemfile
52
63
  - LICENSE.txt
53
64
  - README.md
54
65
  - Rakefile
55
- - bin/console
56
- - bin/setup
57
- - data/card_bin_20190201.xlsx
66
+ - data/card_bin_20191001.xlsx
58
67
  - data/config.yml
59
68
  - lib/paygate-ruby.rb
60
69
  - lib/paygate/aes.rb
@@ -66,13 +75,14 @@ files:
66
75
  - lib/paygate/response.rb
67
76
  - lib/paygate/transaction.rb
68
77
  - lib/paygate/version.rb
69
- - paygate-ruby.gemspec
78
+ - spec/integration/paygate_spec.rb
79
+ - spec/spec_helper.rb
70
80
  - vendor/assets/javascripts/paygate.js
71
- homepage:
81
+ homepage:
72
82
  licenses:
73
83
  - MIT
74
84
  metadata: {}
75
- post_install_message:
85
+ post_install_message:
76
86
  rdoc_options: []
77
87
  require_paths:
78
88
  - lib
@@ -87,8 +97,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
97
  - !ruby/object:Gem::Version
88
98
  version: '0'
89
99
  requirements: []
90
- rubygems_version: 3.0.1
91
- signing_key:
100
+ rubygems_version: 3.2.3
101
+ signing_key:
92
102
  specification_version: 4
93
- summary: Ruby wrapper for PayGate payment gateway
94
- test_files: []
103
+ summary: Ruby wrapper for PayGate Korea payment gateway
104
+ test_files:
105
+ - spec/integration/paygate_spec.rb
106
+ - spec/spec_helper.rb
data/.gitignore DELETED
@@ -1,9 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
data/CODE_OF_CONDUCT.md DELETED
@@ -1,74 +0,0 @@
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 jagdeep.singh@vinsol.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 DELETED
@@ -1,4 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in paygate-ruby.gemspec
4
- gemspec
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "paygate"
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 DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
Binary file
data/paygate-ruby.gemspec DELETED
@@ -1,24 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path("../lib", __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "paygate/version"
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "paygate-ruby"
8
- spec.version = Paygate::VERSION
9
- spec.authors = ["jagdeepsingh"]
10
- spec.email = ["jagdeepsingh.125k@gmail.com"]
11
-
12
- spec.summary = 'Ruby wrapper for PayGate payment gateway'
13
- spec.license = "MIT"
14
-
15
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
16
- f.match(%r{^(test|spec|features)/})
17
- end
18
- spec.bindir = "exe"
19
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
- spec.require_paths = ["lib"]
21
-
22
- spec.add_development_dependency "bundler", "~> 1.15"
23
- spec.add_development_dependency "rake", "~> 10.0"
24
- end