payza_payments 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3a2eb8ce7c8f9c67f7d01d9b96a3dd840d3c636f
4
- data.tar.gz: 4f8d0ed3b043c50c59a7541ce54c04f7dd0036d3
3
+ metadata.gz: fe3de823c0e9139dc6283f6844554bc6e56d91a6
4
+ data.tar.gz: 09facf316cf520fa95358d0fff1873bbdbddf91f
5
5
  SHA512:
6
- metadata.gz: 05756a59ad447e1330d0abfc977407fce2e6f53cd08b8565ad3eeb2c75dcc11856dd4a8bf67f0f4de77cbdd3ac733775648579f688c7df243acf438c376e5407
7
- data.tar.gz: f39a10e68a5684923f687260a2d9b2a94e787bae39ed212827f300a072dcc63d4112804e300b9f96166312066742311a12f547fd160b5fe18f2ea6425557b7a1
6
+ metadata.gz: 4e936f49485c26dfd929ceedf227f2222eb2882bd5b6c8a2b9d732d723a02eb3300671255eeb8c20632d0b52ecf689f46840fbd37b06a329c1cc32d65175e6f2
7
+ data.tar.gz: 4af1afbade03e2c88a15c85d897ad2125c78e0fda1e3889fa622e56b418fabca6e967de0d12551fe858fcd0d5c4ffddee17b11797d299a3eb775c506b822a555
@@ -2,4 +2,4 @@ language: ruby
2
2
  rvm:
3
3
  - 2.0.0
4
4
  before_script: cd ./test/dummy/ && bundle install
5
- script: cd ./test/dummy/ && bundle exec rake spec
5
+ script: bundle exec rake spec
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # PayzaPayments
2
- [![Build Status](https://travis-ci.org/FreedomVPN/liberty_reserve_payments.png?branch=master)](https://travis-ci.org/FreedomVPN/liberty_reserve_payments)
2
+ [![Build Status](https://travis-ci.org/supernova32/payza_payments.png?branch=master)](https://travis-ci.org/supernova32/payza_payments)
3
3
 
4
4
  Configure buttons for Payza based on your requirements and validate IPN requests sent by Payza.
5
5
  With this gem the user of your shop can pay for a digital item (or any type of item) and you can validate the transaction
@@ -24,7 +24,7 @@ module PayzaPayments
24
24
  private
25
25
 
26
26
  def validate_ipn(token)
27
- if self.sandbox?
27
+ if PayzaPayments.sandbox?
28
28
  send_ipn_validation(token, SANDBOX_IPN)
29
29
  else
30
30
  send_ipn_validation(token, PRODUCTION_IPN)
@@ -1,3 +1,3 @@
1
1
  module PayzaPayments
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
@@ -1,5 +1,5 @@
1
1
  class ApplicationController < ActionController::Base
2
2
  # Prevent CSRF attacks by raising an exception.
3
3
  # For APIs, you may want to use :null_session instead.
4
- protect_from_forgery with: :exception
4
+ #protect_from_forgery with: :exception
5
5
  end
@@ -2,4 +2,11 @@ class DummyController < ApplicationController
2
2
  def index
3
3
  @payza = PayzaPayments::ButtonGenerator.new PAYZA_CONFIG
4
4
  end
5
+
6
+ def ipn_notification
7
+ @payza = PayzaPayments::IpnHandler.new PAYZA_CONFIG
8
+ @response = @payza.handle_ipn_v2(params[:token])
9
+ p @response.inspect
10
+ render nothing: true
11
+ end
5
12
  end
@@ -1,6 +1,8 @@
1
1
  Dummy::Application.routes.draw do
2
2
 
3
3
  root 'dummy#index'
4
+
5
+ post '/ipn_notify' => 'dummy#ipn_notification', as: 'ipn_notify'
4
6
  # The priority is based upon order of creation: first created -> highest priority.
5
7
  # See how all your routes lay out with "rake routes".
6
8
 
@@ -40,4 +40,12 @@ describe DummyController do
40
40
  response.body.should have_xpath './/input[@name="ap_image"]'
41
41
  end
42
42
  end
43
+
44
+ context 'post an ipn request' do
45
+ before { post :ipn_notification, { token: 'jkfhaugf9wuflegfbasf=='} }
46
+ it { should respond_with :success }
47
+ it 'should be an invalid token' do
48
+ assigns(:response).should == 'INVALID REQUEST'
49
+ end
50
+ end
43
51
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: payza_payments
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patricio Cano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-30 00:00:00.000000000 Z
11
+ date: 2013-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler