mundipagg_sdk 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e4570e8accdb1715c95142df6d860df05ed09de
4
- data.tar.gz: 6e36566499df37b6329397464b47ed0d31e8e322
3
+ metadata.gz: f16b487c8c873dadb43239df6bcfb6265b643382
4
+ data.tar.gz: 25c7703006b00a98a24ac147f959a36debadaa40
5
5
  SHA512:
6
- metadata.gz: 619aa8d703a8b3c37bfc7ce62d6563279db9c7429a67733603a2e2d4ac85c54ef61313050c5aafea4ef3c72569ce7e5675946d8ea8eb54b57bbdd916963dabd4
7
- data.tar.gz: ca5a939b541a37d7c22c0657274172ddd7d54c18a3196b5cace45f53e1cbace3feee3829901011733f593f96ccdde1a1d5b6d3853ac0a75d250cc6cb8cee2d9c
6
+ metadata.gz: d8f7d5b368ce594ec2b38cc85b6c6c99cdd6746353db304ab239ef7ceb7a52e95a6ce6ee16c421c12601bab69ad783c14fc74f04467c4a38675a821251620f57
7
+ data.tar.gz: 924605f77e445f440ca202391bbb35e234e14072d3de9f8794ad141428640c678eed9e41a2a9ca36391cf0807265c4e45910a9a882500b2b0ba4971d7c5cdcb1
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # mundipagg-one-ruby
1
+ # mundipagg-one-ruby [![Build Status](https://travis-ci.org/mundipagg/mundipagg-one-ruby.svg?branch=master)](https://travis-ci.org/mundipagg/mundipagg-one-ruby)
2
2
 
3
3
  ### Mundipagg Gem Download
4
4
  https://rubygems.org/gems/mundipagg_sdk
@@ -58,4 +58,4 @@ $ rake
58
58
 
59
59
  ## Code Examples
60
60
 
61
- You can access all the code examples [HERE, the Wiki page!](https://github.com/mundipagg/mundipagg-one-ruby/wiki)
61
+ You can access all the code examples [HERE, the Wiki page!](https://github.com/mundipagg/mundipagg-one-ruby/wiki)
@@ -230,15 +230,14 @@ class Gateway
230
230
  retrySaleRequest.RetrySaleCreditCardTransactionCollection.each do |retrySale|
231
231
  r = retrySale.to_json
232
232
  saleHash['RetrySaleCreditCardTransactionCollection'] << r
233
-
234
- if retrySaleRequest.Options.to_json.any?
235
- retry_options = retrySaleRequest.Options.to_json
236
- saleHash['Options'] = retry_options
237
- else
238
- saleHash['Options'] = nil
239
- end
240
233
  end
241
234
  end
235
+ if retrySaleRequest.Options.to_json.any?
236
+ retry_options = retrySaleRequest.Options.to_json
237
+ saleHash['Options'] = retry_options
238
+ else
239
+ saleHash['Options'] = nil
240
+ end
242
241
  rescue Exception => e
243
242
  return e.message
244
243
  end
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
2
2
  s.name = 'mundipagg_sdk'
3
3
  s.summary = 'MundiPagg Ruby Client Library'
4
4
  s.description = 'Ruby library for integrating with the MundiPagg payment web services'
5
- s.version = '1.0.1' # Major.Minor.Revision
5
+ s.version = '1.0.2' # Major.Minor.Revision
6
6
  s.author = 'MundiPagg'
7
7
  s.email = 'github@mundipagg.com'
8
8
  s.homepage = 'http://www.mundipagg.com/'
@@ -309,6 +309,41 @@ RSpec.describe Gateway do
309
309
 
310
310
  end
311
311
 
312
+ it 'should do a retry method with only order key' do
313
+ createSaleRequest = CreateSaleRequest.new
314
+ creditCardTransactionItem = CreditCardTransaction.new
315
+ creditCardTransactionItem.AmountInCents = 100
316
+ creditCardTransactionItem.CreditCard.CreditCardBrand = 'Visa'
317
+ creditCardTransactionItem.CreditCard.CreditCardNumber = '41111111111111'
318
+ creditCardTransactionItem.CreditCard.ExpMonth = 10
319
+ creditCardTransactionItem.CreditCard.ExpYear = 22
320
+ creditCardTransactionItem.CreditCard.HolderName = 'Maria do Carmo'
321
+ creditCardTransactionItem.CreditCard.SecurityCode = '123'
322
+ creditCardTransactionItem.CreditCardOperation = 'AuthAndCapture'
323
+ creditCardTransactionItem.TransactionReference = 'RubySDK-RetryTest'
324
+
325
+ createSaleRequest.CreditCardTransactionCollection << creditCardTransactionItem
326
+ createSaleRequest.Order.OrderReference = 'RubySDK-RetryTest'
327
+
328
+ # cria o pedido que sera usado para retentativa
329
+ responseCreate = gateway.CreateSale(createSaleRequest)
330
+
331
+ # pega o orderkey e o transaction key da resposta que sao necessarios para fazer a retentativa
332
+ orderKey = responseCreate["OrderResult"]["OrderKey"]
333
+ transactionKey = responseCreate['CreditCardTransactionResultCollection'][0]['TransactionKey']
334
+
335
+ retrySaleRequest = RetrySaleRequest.new
336
+
337
+ # monta o objeto de retentativa
338
+ retrySaleRequest.OrderKey = orderKey
339
+
340
+ # faz a requisicao de retentativa
341
+ response = gateway.Retry(retrySaleRequest)
342
+
343
+ expect(response['ErrorReport']).to eq nil
344
+
345
+ end
346
+
312
347
  it 'should cancel a transaction' do
313
348
  createSaleRequest = CreateSaleRequest.new
314
349
  creditCardTransactionItem = CreditCardTransaction.new
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mundipagg_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - MundiPagg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-26 00:00:00.000000000 Z
11
+ date: 2015-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client