killbill-payment-test 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -22,3 +22,5 @@ Jarfile.lock
22
22
  Gemfile.lock
23
23
  *.swp
24
24
  killbill-payment-test
25
+
26
+ .DS_Store
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.5
1
+ 1.0.6
@@ -22,8 +22,7 @@ Gem::Specification.new do |s|
22
22
 
23
23
  s.rdoc_options << '--exclude' << '.'
24
24
 
25
- s.add_dependency 'killbill', '~> 1.0.13'
26
- s.add_dependency 'activemerchant', '~> 1.29.3'
25
+ s.add_dependency 'killbill', '~> 1.0.16'
27
26
  s.add_dependency 'sinatra', '~> 1.3.4'
28
27
 
29
28
  s.add_development_dependency 'jbundler', '~> 0.4.1'
@@ -19,15 +19,23 @@ module PaymentTest
19
19
  end
20
20
 
21
21
  def process_payment(kb_account_id, kb_payment_id, kb_payment_method_id, amount_in_cents, currency, options = {})
22
- res = Killbill::Plugin::PaymentResponse.new(amount_in_cents, DateTime.now, DateTime.now, Killbill::Plugin::PaymentStatus::SUCCESS, "gateway_error", "gateway_error_code")
22
+
23
+ # Make an API call from the payment call
24
+ account = @kb_apis.get_account_by_id(kb_account_id)
25
+ puts "process_payment got ACCOUNT #{account.inspect}"
26
+ Killbill::Plugin::Model::PaymentInfoPlugin.new(amount_in_cents, DateTime.now, DateTime.now, Killbill::Plugin::Model::PaymentPluginStatus.new(:PROCESSED), "gateway_error", "gateway_error_code", nil, nil)
23
27
  end
24
28
 
25
29
  def get_payment_info(kb_account_id, kb_payment_id, options = {})
26
- Killbill::Plugin::PaymentResponse.new(0, DateTime.now, DateTime.now, Killbill::Plugin::PaymentStatus::SUCCESS, "gateway_error", "gateway_error_code")
30
+ Killbill::Plugin::Model::PaymentInfoPlugin.new(0, DateTime.now, DateTime.now, Killbill::Plugin::Model::PaymentPluginStatus.new(:PROCESSED), "gateway_error", "gateway_error_code", nil, nil)
27
31
  end
28
32
 
29
33
  def process_refund(kb_account_id, kb_payment_id, amount_in_cents, currency, options = {})
30
- Killbill::Plugin::RefundResponse.new(amount_in_cents, DateTime.now, DateTime.now, Killbill::Plugin::PaymentStatus::SUCCESS, "gateway_error", "gateway_error_code")
34
+ Killbill::Plugin::Model::RefundInfoPlugin.new(amount_in_cents, DateTime.now, DateTime.now, Killbill::Plugin::Model::RefundPluginStatus.new(:PROCESSED), "gateway_error", "gateway_error_code", nil)
35
+ end
36
+
37
+ def get_refund_info(kb_account_id, kb_payment_id, options = {})
38
+ Killbill::Plugin::Model::RefundInfoPlugin.new(amount_in_cents, DateTime.now, DateTime.now, illbill::Plugin::Model::RefundPluginStatus.new(:PROCESSED), "gateway_error", "gateway_error_code", nil)
31
39
  end
32
40
 
33
41
  def add_payment_method(kb_account_id, kb_payment_method_id, payment_method_props, set_default, options = {})
@@ -38,14 +46,14 @@ module PaymentTest
38
46
  end
39
47
 
40
48
  def get_payment_method_detail(kb_account_id, kb_payment_method_id, options = {})
41
- Killbill::Plugin::PaymentMethodResponse.new("foo", true, [])
49
+ Killbill::Plugin::Model::PaymentMethodPlugin.new("foo", true, [], nil, "type", "cc_name", "cc_type", "cc_expiration_month", "cc_expiration_year", "cc_last4", "address1", "address2", "city", "state", "zip", "country")
42
50
  end
43
51
 
44
52
  def set_default_payment_method(kb_account_id, kb_payment_method_id, options = {})
45
53
  end
46
54
 
47
55
  def get_payment_methods(kb_account_id, refresh_from_gateway, options = {})
48
- [Killbill::Plugin::PaymentMethodResponseInternal.new(kb_account_id, kb_account_id, true, "external_payment_method_id")]
56
+ [Killbill::Plugin::Model::PaymentMethodInfoPlugin.new(kb_account_id, kb_account_id, true, "external_payment_method_id")]
49
57
  end
50
58
 
51
59
  def reset_payment_methods(kb_account_id, payment_methods)
data/pom.xml ADDED
@@ -0,0 +1,36 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ ~ Copyright 2010-2013 Ning, Inc.
4
+ ~
5
+ ~ Ning licenses this file to you under the Apache License, version 2.0
6
+ ~ (the "License"); you may not use this file except in compliance with the
7
+ ~ License. You may obtain a copy of the License at:
8
+ ~
9
+ ~ http://www.apache.org/licenses/LICENSE-2.0
10
+ ~
11
+ ~ Unless required by applicable law or agreed to in writing, software
12
+ ~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ ~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ ~ License for the specific language governing permissions and limitations
15
+ ~ under the License.
16
+ -->
17
+
18
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
19
+ <parent>
20
+ <groupId>org.sonatype.oss</groupId>
21
+ <artifactId>oss-parent</artifactId>
22
+ <version>5</version>
23
+ </parent>
24
+ <modelVersion>4.0.0</modelVersion>
25
+ <groupId>com.ning.killbill.ruby</groupId>
26
+ <artifactId>payment-test-plugin</artifactId>
27
+ <packaging>pom</packaging>
28
+ <version>1.0.6</version>
29
+ <name>payment-test-plugin</name>
30
+ <description></description>
31
+ <scm>
32
+ <connection>scm:git:git://github.com/killbill/killbill-payment-test-plugin.git</connection>
33
+ <url>https://github.com/killbill/killbill-payment-test-plugin/</url>
34
+ <developerConnection>scm:git:git@github.com:killbill/killbill-payment-test-plugin.git</developerConnection>
35
+ </scm>
36
+ </project>
data/release.sh ADDED
@@ -0,0 +1,28 @@
1
+ set -e
2
+
3
+ VERSION=`grep -E '<version>([0-9]+\.[0-9]+\.[0-9]+)</version>' pom.xml | sed 's/[\t \n]*<version>\(.*\)<\/version>[\t \n]*/\1/'`
4
+ if [ "$VERSION" != "$(cat $PWD/VERSION)" ]; then
5
+ echo "Unable to release: make sure the versions in pom.xml and VERSION match"
6
+ exit 1
7
+ fi
8
+
9
+ echo "Cleaning up"
10
+ rake killbill:clean ; rake build
11
+
12
+ echo "Pushing the gem to Rubygems"
13
+ rake release
14
+
15
+ echo "Building artifact"
16
+ rake killbill:package
17
+
18
+ ARTIFACT="$PWD/pkg/killbill-payment-test-$VERSION.tar.gz"
19
+ echo "Pushing $ARTIFACT to Maven Central"
20
+ mvn gpg:sign-and-deploy-file \
21
+ -DgroupId=com.ning.killbill.ruby \
22
+ -DartifactId=payment-test-plugin \
23
+ -Dversion=$VERSION \
24
+ -Dpackaging=tar.gz \
25
+ -DrepositoryId=ossrh-releases \
26
+ -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ \
27
+ -Dfile=$ARTIFACT \
28
+ -DpomFile=pom.xml
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: killbill-payment-test
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.5
5
+ version: 1.0.6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Killbill core team
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-11 00:00:00.000000000 Z
12
+ date: 2013-05-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: killbill
@@ -17,29 +17,13 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 1.0.13
20
+ version: 1.0.16
21
21
  none: false
22
22
  requirement: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.13
27
- none: false
28
- prerelease: false
29
- type: :runtime
30
- - !ruby/object:Gem::Dependency
31
- name: activemerchant
32
- version_requirements: !ruby/object:Gem::Requirement
33
- requirements:
34
- - - "~>"
35
- - !ruby/object:Gem::Version
36
- version: 1.29.3
37
- none: false
38
- requirement: !ruby/object:Gem::Requirement
39
- requirements:
40
- - - "~>"
41
- - !ruby/object:Gem::Version
42
- version: 1.29.3
26
+ version: 1.0.16
43
27
  none: false
44
28
  prerelease: false
45
29
  type: :runtime
@@ -122,6 +106,8 @@ files:
122
106
  - killbill.properties
123
107
  - lib/payment_test.rb
124
108
  - lib/payment_test/api.rb
109
+ - pom.xml
110
+ - release.sh
125
111
  - spec/payment_test/base_plugin_spec.rb
126
112
  - spec/spec_helper.rb
127
113
  homepage: http://www.killbilling.org