skrill_payments 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [WIP] -> WORK IN PROGRESS
2
+
3
+ Plase wait day or two to next release.
4
+ Next update will be 26.5.2014
5
+
6
+ Thank you very much.
7
+
1
8
  # SkrillPayments
2
9
 
3
10
  TODO: Write a gem description
@@ -16,9 +23,15 @@ Or install it yourself as:
16
23
 
17
24
  $ gem install skrill_payments
18
25
 
26
+ Create config initializer for Skrill Payments.
27
+
28
+ For example, create a file config/initializers/skrill_payments.rb with following content:
29
+
30
+ Rails.configuration.scrill_payments_email = 'michal.macejko1@gmail.com'
31
+ Rails.configuration.scrill_payments_password = '3427342378427834782347832' # MD5
32
+
19
33
  ## Usage
20
34
 
21
- TODO: Write usage instructions here
22
35
 
23
36
  ## Contributing
24
37
 
@@ -1,25 +1,17 @@
1
1
  class Api
2
2
 
3
- #BASE_URL = Rails.application.config.scrill_payments_api_base_url
4
3
  BASE_URL = 'https://www.moneybookers.com/app/pay.pl'
5
4
 
6
- attr_reader :payment
5
+ attr_reader :conection, :payment
7
6
 
8
7
  def initialize
9
8
  @conection = Faraday.new(url: BASE_URL)
10
9
  end
11
10
 
12
11
  def call
13
- response = @conection.get '', params
12
+ response = conection.get '', params
14
13
  data = XmlSimple.xml_in(response.body)
15
14
 
16
- #temp responses because Skrill account is not ready
17
- data = if params[:action] == 'prepare'
18
- XmlSimple.xml_in('<?xmlversion="1.0" encoding="UTF-8"?> <response><sid>5e281d1376d92ba789ca7f0583e045d4</sid> </response>')
19
- else
20
- XmlSimple.xml_in('<?xml version="1.0" encoding="UTF-8"?> <response> <transaction><amount>1.20</amount> <currency>EUR</currency> <id>497029</id><status>2</status> <status_msg>processed</status_msg> </transaction></response>')
21
- end
22
-
23
15
  raise data['error'].inspect if data['error']
24
16
 
25
17
  data
@@ -37,8 +29,8 @@ class Api
37
29
 
38
30
  def default_params
39
31
  {
40
- email: 'michal.macejko1@gmail.com',
41
- password: 'XYZ'
32
+ email: Rails.configuration.scrill_payments_email,
33
+ password: Rails.configuration.scrill_payments_password
42
34
  }
43
35
  end
44
36
 
@@ -1,3 +1,3 @@
1
1
  module SkrillPayments
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skrill_payments
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-24 00:00:00.000000000 Z
12
+ date: 2014-05-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler