offsite_payments 2.7.10 → 2.7.11

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
- SHA1:
3
- metadata.gz: f6784710cabbc90a43b307a4cc412047c96a6171
4
- data.tar.gz: d86bd553ec1eae59bc7482169ee53d9047b036e2
2
+ SHA256:
3
+ metadata.gz: 80e586df2a8864f246dc9aaa3ab3f53d3cc04b4f14200f195a504cf8cb3bb551
4
+ data.tar.gz: dbbf5498a71aa62aafc296834d849f7c2c307a1c6abcae457c50a4385108860f
5
5
  SHA512:
6
- metadata.gz: 2c0ef45575498d7af98ebfd5b39a6abca73ddf8b0dfa1588c8db87528e05406ea09c853854a543f18c808c14cecca2a36dc242286f0d7dd4c6aa890c90a43f8e
7
- data.tar.gz: 813a8370cd80285e9bbc94759d2a5eeb0f293f2c496708f2fb5cf76933aa7cc9d6141d39be893976ac9c5521cb6f95ca58e1f7387a2dc509220ec1bfecea1d87
6
+ metadata.gz: 0c032a24a16ff43cf25fc011f1eddd2b0fde6f3064e14ae6982977d280f9eb6a99cc79d559e6091f6fc311a846a7ee21087b24f87448c07faa38eff46cb6fe37
7
+ data.tar.gz: d7205f0cc31e891d3f88b8c7c4419516f2f59232ccf342a39f32bd1a24f53ec623e51c190c17e7372fae04a6763b5aecf922893b6de875a33dc5d749c3c53f36
@@ -15,6 +15,17 @@ module OffsitePayments #:nodoc:
15
15
  subclass.mappings ||= {}
16
16
  end
17
17
 
18
+ # @param order [String] unique id of this order
19
+ # @param account [String] merchant account id from gateway provider
20
+ # @param options [Hash] convenience param to set common attributes including:
21
+ # * amount
22
+ # * currency
23
+ # * credential2
24
+ # * credential3
25
+ # * credential4
26
+ # * notify_url
27
+ # * return_url
28
+ # * redirect_param
18
29
  def initialize(order, account, options = {})
19
30
  options.assert_valid_keys([:amount, :currency, :test, :credential2, :credential3, :credential4, :country, :account_name, :description, :transaction_type, :authcode, :notify_url, :return_url, :redirect_param, :forward_url, :checkout_token])
20
31
  @fields = {}
@@ -33,10 +44,52 @@ module OffsitePayments #:nodoc:
33
44
  self.checkout_token = options[:checkout_token]
34
45
  end
35
46
 
47
+ # Add a mapping between attribute name and gateway specific field name.
48
+ # This mapping can then be used in form helper to assign values to each
49
+ # attributes. For example, a `mapping :height, "HEIGHT"` means user can
50
+ # write `f.height 182` in 'payment_service_for' form helper, and an
51
+ # input tag with the name "HEIGHT" and value of 182 will be generated.
52
+ # This is an abstraction over the `add_field` method.
53
+ #
54
+ # @param attribute [Symbol] attribute name
55
+ # @param options [String, Array, Hash] input name from gateway's side.
56
+ #
57
+ # String:
58
+ # Name of generated input
59
+ #
60
+ # Array:
61
+ # Names of generated inputs, for creating synonym inputs.
62
+ # Each generated input will have the same value.
63
+ #
64
+ # Hash:
65
+ # Keys as attribute name and values as generated input names.
66
+ # Used to group related fields together, such as different segments
67
+ # of an address, for example:
68
+ #
69
+ # mapping :address, :region => 'REGION',
70
+ # :city => 'CITY',
71
+ # :address => 'ADD'
36
72
  def self.mapping(attribute, options = {})
37
73
  self.mappings[attribute] = options
38
74
  end
39
75
 
76
+ # Add an input in the form. Useful when gateway requires some uncommon
77
+ # fields not provided by the gem.
78
+ #
79
+ # # inside `payment_service_for do |service|` block
80
+ # service.add_field('c_id','_xclick')
81
+ #
82
+ # Gateway implementor can also use this to add default fields in the form:
83
+ #
84
+ # # in a subclass of ActiveMerchant::Billing::Integrations::Helper
85
+ # def initialize(order, account, options = {})
86
+ # super
87
+ # # mandatory fields
88
+ # add_field('Rvg2c', 1)
89
+ # end
90
+ #
91
+ # @param name [String] input name
92
+ # @param value [String] input value
40
93
  def add_field(name, value)
41
94
  return if name.blank? || value.blank?
42
95
  @fields[name.to_s] = value.to_s
@@ -72,10 +125,15 @@ module OffsitePayments #:nodoc:
72
125
  @fields
73
126
  end
74
127
 
128
+ # @return [Boolean] whether in test mode
75
129
  def test?
76
130
  @test_mode ||= OffsitePayments.mode == :test || !!@test
77
131
  end
78
132
 
133
+ # Specifies the HTTP method used in form submmition.
134
+ # Set to POST which gateway implementor can override if other http method is desired (e.g. PUT).
135
+ #
136
+ # @return [String] form submit action, default is "POST".
79
137
  def form_method
80
138
  "POST"
81
139
  end
@@ -11,7 +11,7 @@ module OffsitePayments #:nodoc:
11
11
 
12
12
  # self.test_url = 'https://pguat.paytm.com/oltp-web/processTransaction'
13
13
  # self.production_url = 'https://secure.paytm.in/oltp-web/processTransaction'
14
-
14
+
15
15
  self.test_url = 'https://securegw-stage.paytm.in/theia/processTransaction'
16
16
  self.production_url = 'https://securegw.paytm.in/theia/processTransaction'
17
17
 
@@ -109,7 +109,7 @@ module OffsitePayments #:nodoc:
109
109
  end
110
110
 
111
111
  class Notification < OffsitePayments::Notification
112
- PAYTM_RESPONSE_PARAMS = %w(MID BANKTXNID TXNAMOUNT CURRENCY STATUS RESPCODE RESPMSG TXNDATE GATEWAYNAME BANKNAME PAYMENTMODE PROMO_CAMP_ID PROMO_STATUS PROMO_RESPCODE ORDERID TXNID REFUNDAMOUNT REFID MERC_UNQ_REF CUSTID).freeze
112
+ PAYTM_RESPONSE_PARAMS = %w(MID BANKTXNID TXNAMOUNT CURRENCY STATUS RESPCODE RESPMSG TXNDATE GATEWAYNAME BANKNAME PAYMENTMODE PROMO_CAMP_ID PROMO_STATUS PROMO_RESPCODE ORDERID TXNID REFUNDAMOUNT REFID MERC_UNQ_REF CUSTID TXNDATETIME).freeze
113
113
 
114
114
  def initialize(post, options = {})
115
115
  super
@@ -1,3 +1,3 @@
1
1
  module OffsitePayments
2
- VERSION = "2.7.10"
2
+ VERSION = "2.7.11"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: offsite_payments
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.10
4
+ version: 2.7.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Luetke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-27 00:00:00.000000000 Z
11
+ date: 2018-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -278,7 +278,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
278
278
  version: '0'
279
279
  requirements: []
280
280
  rubyforge_project:
281
- rubygems_version: 2.6.14
281
+ rubygems_version: 2.7.6
282
282
  signing_key:
283
283
  specification_version: 4
284
284
  summary: Framework and tools for dealing with offsite (hosted) payment pages.