pag_seguro 0.5.5 → 0.5.6

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: 7aff3540c942b98fb40649b198be4433f1180b46
4
- data.tar.gz: 47906c183829ac71ce7187f0d250893e91f16aa4
3
+ metadata.gz: 855e564031122d7fe066c2b9534ace226afecca7
4
+ data.tar.gz: e126b017a4e8b23b51889425aa5256e24c102dd0
5
5
  SHA512:
6
- metadata.gz: 36cadf61f5dabceb2d71d571053e8aea72eca02a4f29a4f2a481a53d329b46be6140c22a466f0076e0613fe0daf3ab2e94a02385198688689a22cb8030c8dccc
7
- data.tar.gz: 6d950e06ad9ee88d5b6c8437a8c391f0ee5a9f72e559ccc3518a64a3570ffd6a7c709f27755f99c4d11d50cb021bd257002cf8ebfcb1f4ae34c34d79c4578a50
6
+ metadata.gz: 9233c304b25d2e8400889df6e00f1722670a187cafd8ebc6b6d117bb227e161dc1d924af51b6392156e57db612bb761d64b1253f156eecc6adb7364bedf9b8f6
7
+ data.tar.gz: 52c1a877692781c255057f0ebe8fdb8ff12222b62d0c12220f8dd067980d66ecbf4cbc4d05d8f2e928b014c46c751e13580c8b5ab5cda85c9dfcf91c0d8fee92
data/.gitignore CHANGED
@@ -7,3 +7,5 @@ doc/*
7
7
  spec/pag_seguro/integration/config_example.yml
8
8
  .DS_Store
9
9
  .sublime-project
10
+ .ruby-version
11
+ .ruby-gemset
data/Gemfile CHANGED
@@ -5,9 +5,10 @@ gemspec
5
5
 
6
6
  # test or development gems
7
7
  gem 'rspec'
8
+ gem 'rspec-its'
8
9
  gem 'simplecov', require: false
9
10
  gem 'guard-rspec'
10
- gem 'shoulda-matchers'
11
+ gem 'shoulda-matchers', '2.5.0'
11
12
  gem "factory_girl", "~> 4.0"
12
13
  gem 'growl'
13
- gem 'pry'
14
+ gem 'pry'
data/README.md CHANGED
@@ -18,6 +18,22 @@ Além disso, é necessário que tenha uma conta no pag seguro, e que habilite as
18
18
  Em [Integrações -> Pagamentos via API](https://pagseguro.uol.com.br/integracao/pagamentos-via-api.jhtml) é necessário ativar a opção "Quero receber somente pagamentos via API."
19
19
  Em [Integrações -> Notificação de transações](https://pagseguro.uol.com.br/integracao/notificacao-de-transacoes.jhtml) é necessário ativar a notificação de transações e definir a url de retorno
20
20
 
21
+ ### Sandbox
22
+
23
+ Altere o ambiente para `sandbox`:
24
+
25
+ ```ruby
26
+ # config/initializers/pagseguro.rb
27
+
28
+ PagSeguro::Url.environment = :sandbox # default: :production
29
+ ```
30
+ Você pode alterar o ambiente a qualquer momento para `:production`
31
+
32
+ ```ruby
33
+ PagSeguro::Url.environment = :production
34
+ ```
35
+ Acesse a página de [Sandbox](https://sandbox.pagseguro.uol.com.br/) no pag seguro para obter seus [dados de teste](https://sandbox.pagseguro.uol.com.br/dados-de-teste.html).
36
+
21
37
  ## Documentação
22
38
 
23
39
  ### Classes e Atributos
@@ -15,6 +15,7 @@ require "pagseguro_decimal_validator"
15
15
  require "convert_field_to_digit"
16
16
 
17
17
  # PagSeguro classes
18
+ require "url"
18
19
  require "item"
19
20
  require "payment"
20
21
  require "payment_method"
@@ -6,6 +6,8 @@
6
6
  %extraAmount= payment.extra_amount
7
7
  - if payment.redirect_url.present?
8
8
  %redirectURL= payment.redirect_url
9
+ - if payment.notification_url.present?
10
+ %notificationURL= payment.notification_url
9
11
  - if payment.max_uses.present?
10
12
  %maxUses= payment.max_uses
11
13
  - if payment.max_age.present?
@@ -10,7 +10,7 @@ module PagSeguro
10
10
 
11
11
  private
12
12
  def transaction_data(email, token, notification_code)
13
- notification_url = "#{PAGSEGURO_TRANSACTIONS_URL}/notifications/#{notification_code}"
13
+ notification_url = "#{Transaction.transactions_url}/notifications/#{notification_code}"
14
14
  super RestClient.get notification_url, params: {email: email, token: token}
15
15
  end
16
16
  end
@@ -3,10 +3,8 @@ module PagSeguro
3
3
  include ActiveModel::Validations
4
4
  extend PagSeguro::ConvertFieldToDigit
5
5
 
6
- CHECKOUT_URL = "https://ws.pagseguro.uol.com.br/v2/checkout"
7
-
8
6
  attr_accessor :id, :email, :token, :items, :sender, :shipping,
9
- :extra_amount, :redirect_url, :max_uses, :max_age,
7
+ :extra_amount, :redirect_url, :notification_url, :max_uses, :max_age,
10
8
  :response, :pre_approval
11
9
  alias :reference :id
12
10
  alias :reference= :id=
@@ -16,6 +14,7 @@ module PagSeguro
16
14
  validates_presence_of :email, :token
17
15
  validates :extra_amount, pagseguro_decimal: true
18
16
  validates_format_of :redirect_url, with: URI::regexp(%w(http https)), message: " must give a correct url for redirection", allow_blank: true
17
+ validates_format_of :notification_url, with: URI::regexp(%w(http https)), message: " must give a correct url for notification", allow_blank: true
19
18
  validate :max_uses_number, :max_age_number, :valid_pre_approval, :valid_items
20
19
 
21
20
  def initialize(email = nil, token = nil, options = {})
@@ -27,13 +26,18 @@ module PagSeguro
27
26
  @items = options[:items] || []
28
27
  @extra_amount = options[:extra_amount]
29
28
  @redirect_url = options[:redirect_url]
29
+ @notification_url = options[:notification_url]
30
30
  @max_uses = options[:max_uses]
31
31
  @max_age = options[:max_age]
32
32
  @pre_approval = options[:pre_approval]
33
33
  end
34
34
 
35
+ def self.checkout_url
36
+ PagSeguro::Url.api_url("/checkout")
37
+ end
38
+
35
39
  def self.checkout_payment_url(code)
36
- "https://pagseguro.uol.com.br/v2/checkout/payment.html?code=#{code}"
40
+ PagSeguro::Url.site_url("/checkout/payment.html?code=#{code}")
37
41
  end
38
42
 
39
43
  def checkout_xml
@@ -52,6 +56,10 @@ module PagSeguro
52
56
  self.class.checkout_payment_url(code)
53
57
  end
54
58
 
59
+ def checkout_url
60
+ self.class.checkout_url
61
+ end
62
+
55
63
  def code
56
64
  response || parse_checkout_response
57
65
  parse_code
@@ -92,8 +100,8 @@ module PagSeguro
92
100
  end
93
101
 
94
102
  def send_checkout
95
- params = { email: @email, token: @token }
96
- RestClient.post(CHECKOUT_URL, checkout_xml,
103
+ params = { email: @email, token: @token, ssl_version: :SSLv3 }
104
+ RestClient.post(checkout_url, checkout_xml,
97
105
  params: params,
98
106
  content_type: "application/xml"){|resp, request, result| resp }
99
107
  end
@@ -9,7 +9,7 @@ module PagSeguro
9
9
  end
10
10
 
11
11
  def self.find(email, token, options={})
12
- url = Transaction::PAGSEGURO_TRANSACTIONS_URL
12
+ url = Transaction.transactions_url
13
13
  url += "/abandoned" if options[:abandoned]
14
14
 
15
15
  transactions_data = Nokogiri::XML(RestClient.get url, params: search_params(email, token, options))
@@ -40,7 +40,7 @@ module PagSeguro
40
40
 
41
41
  private
42
42
  def transaction_data(email, token, transaction_code)
43
- transaction_url = "#{PAGSEGURO_TRANSACTIONS_URL}/#{transaction_code}"
43
+ transaction_url = "#{Transaction.transactions_url}/#{transaction_code}"
44
44
  super RestClient.get transaction_url, params: {email: email, token: token}
45
45
  end
46
46
  end
@@ -5,8 +5,6 @@ module PagSeguro
5
5
  class Transaction
6
6
  attr_accessor :data
7
7
 
8
- PAGSEGURO_TRANSACTIONS_URL = "https://ws.pagseguro.uol.com.br/v2/transactions"
9
-
10
8
  # possible status values
11
9
  PAGSEGURO_PROCESSING = 1
12
10
  PAGSEGURO_IN_ANALYSIS = 2
@@ -35,6 +33,10 @@ module PagSeguro
35
33
  end
36
34
  end
37
35
 
36
+ def self.transactions_url
37
+ PagSeguro::Url.api_url("/transactions")
38
+ end
39
+
38
40
  def initialize(transaction_xml)
39
41
  @data = transaction_data(transaction_xml)
40
42
  end
@@ -0,0 +1,36 @@
1
+ module PagSeguro
2
+ class Url
3
+ class << self
4
+ attr_accessor :environment
5
+ end
6
+
7
+ self.environment = :production
8
+
9
+ def self.uris
10
+ @uris ||= {
11
+ production: {
12
+ api: "https://ws.pagseguro.uol.com.br/v2",
13
+ site: "https://pagseguro.uol.com.br/v2"
14
+ },
15
+ sandbox: {
16
+ api: "https://ws.sandbox.pagseguro.uol.com.br/v2",
17
+ site: "https://sandbox.pagseguro.uol.com.br/v2"
18
+ }
19
+ }
20
+ end
21
+
22
+ def self.root_uri(type)
23
+ root = uris.fetch(environment.to_sym) { raise InvalidEnvironmentError }
24
+ root[type.to_sym]
25
+ end
26
+
27
+ def self.api_url(path)
28
+ File.join(root_uri(:api), path)
29
+ end
30
+
31
+ def self.site_url(path)
32
+ File.join(root_uri(:site), path)
33
+ end
34
+ InvalidEnvironmentError = Class.new(StandardError)
35
+ end
36
+ end
@@ -1,3 +1,3 @@
1
1
  module PagSeguro
2
- VERSION = "0.5.5"
2
+ VERSION = "0.5.6"
3
3
  end
@@ -22,154 +22,159 @@ describe PagSeguro::Payment do
22
22
  its(:checkout_xml){ should match(/^<\?xml.+encoding="UTF-8".+\?>$/) }
23
23
 
24
24
  describe 'settings' do
25
- it { xml_content('checkout reference').should be_empty }
26
- it { xml_content('checkout extraAmount').should be_empty }
27
- it { xml_content('checkout redirectURL').should be_empty }
28
- it { xml_content('checkout maxUses').should be_empty }
29
- it { xml_content('checkout maxAge').should be_empty }
30
- it { xml_content('checkout currency').should == 'BRL' }
25
+ it { expect(xml_content('checkout reference')).to be_empty }
26
+ it { expect(xml_content('checkout extraAmount')).to be_empty }
27
+ it { expect(xml_content('checkout redirectURL')).to be_empty }
28
+ it { expect(xml_content('checkout maxUses')).to be_empty }
29
+ it { expect(xml_content('checkout maxAge')).to be_empty }
30
+ it { expect(xml_content('checkout currency')).to eq('BRL') }
31
31
 
32
32
  context 'with id' do
33
33
  before{ payment.id = 305 }
34
- it { xml_content('checkout reference').should == '305' }
34
+ it { expect(xml_content('checkout reference')).to eq('305') }
35
35
  end
36
36
 
37
37
  context 'with extra amount' do
38
38
  before{ payment.extra_amount = '10.50' }
39
- it { xml_content('checkout extraAmount').should == '10.50' }
39
+ it { expect(xml_content('checkout extraAmount')).to eq('10.50') }
40
40
  end
41
41
 
42
42
  context 'with redirect url' do
43
43
  before{ payment.redirect_url = 'http://heavenstudio.com.br' }
44
- it { xml_content('checkout redirectURL').should == 'http://heavenstudio.com.br' }
44
+ it { expect(xml_content('checkout redirectURL')).to eq('http://heavenstudio.com.br') }
45
+ end
46
+
47
+ context 'with notification url' do
48
+ before{ payment.notification_url = 'http://heavenstudio.com.br/notification' }
49
+ it { expect(xml_content('checkout notificationURL')).to eq('http://heavenstudio.com.br/notification') }
45
50
  end
46
51
 
47
52
  context 'with max uses' do
48
53
  before{ payment.max_uses = '10' }
49
- it { xml_content('checkout maxUses').should == '10' }
54
+ it { expect(xml_content('checkout maxUses')).to eq('10') }
50
55
  end
51
56
 
52
57
  context 'with max age' do
53
58
  before{ payment.max_age = '5000' }
54
- it { xml_content('checkout maxAge').should == '5000' }
59
+ it { expect(xml_content('checkout maxAge')).to eq('5000') }
55
60
  end
56
61
  end
57
62
 
58
63
  describe 'items' do
59
64
  let(:payment){ build :payment_with_items }
60
65
 
61
- it { xml_collection('checkout items item').size.should == 4 }
62
- it { xml_collection('checkout items item id').should == ['25', '73', '95', '17'] }
63
- it { xml_collection('checkout items item description').should == ['A Bic Pen', 'A Book & Cover', 'A Towel', 'A pipe'] }
64
- it { xml_collection('checkout items item amount').should == ['1.50', '38.23', '69.35', '3.00'] }
65
- it { xml_collection('checkout items item quantity').should == ['4', '1', '2', '89'] }
66
- it { xml_collection('checkout items item shippingCost').should == ['1.00', '12.00'] }
67
- it { xml_collection('checkout items item weight').should == ['10', '300', '400'] }
66
+ it { expect(xml_collection('checkout items item').size).to eq(4) }
67
+ it { expect(xml_collection('checkout items item id')).to eq(['25', '73', '95', '17']) }
68
+ it { expect(xml_collection('checkout items item description')).to eq(['A Bic Pen', 'A Book & Cover', 'A Towel', 'A pipe']) }
69
+ it { expect(xml_collection('checkout items item amount')).to eq(['1.50', '38.23', '69.35', '3.00']) }
70
+ it { expect(xml_collection('checkout items item quantity')).to eq(['4', '1', '2', '89']) }
71
+ it { expect(xml_collection('checkout items item shippingCost')).to eq(['1.00', '12.00']) }
72
+ it { expect(xml_collection('checkout items item weight')).to eq(['10', '300', '400']) }
68
73
 
69
74
  it 'should escape html in item description' do
70
- payment.checkout_xml.should include('A Book &amp; Cover')
75
+ expect(payment.checkout_xml).to include('A Book &amp; Cover')
71
76
  end
72
77
  end
73
78
 
74
79
  describe 'sender info' do
75
80
  context 'without sender' do
76
- it { xml_content('checkout sender name').should be_empty }
77
- it { xml_content('checkout sender email').should be_empty }
78
- it { xml_content('checkout sender phone areaCode').should be_empty }
79
- it { xml_content('checkout sender phone number').should be_empty }
81
+ it { expect(xml_content('checkout sender name')).to be_empty }
82
+ it { expect(xml_content('checkout sender email')).to be_empty }
83
+ it { expect(xml_content('checkout sender phone areaCode')).to be_empty }
84
+ it { expect(xml_content('checkout sender phone number')).to be_empty }
80
85
  end
81
86
 
82
87
  context 'with sender' do
83
88
  let(:payment){ build :payment_with_sender }
84
89
 
85
- it { xml_content('checkout sender name').should == 'Stefano Diem Benatti' }
86
- it { xml_content('checkout sender email').should == 'stefano@heavenstudio.com.br' }
87
- it { xml_content('checkout sender phone areaCode').should == '11' }
88
- it { xml_content('checkout sender phone number').should == '993430994' }
90
+ it { expect(xml_content('checkout sender name')).to eq('Stefano Diem Benatti') }
91
+ it { expect(xml_content('checkout sender email')).to eq('stefano@heavenstudio.com.br') }
92
+ it { expect(xml_content('checkout sender phone areaCode')).to eq('11') }
93
+ it { expect(xml_content('checkout sender phone number')).to eq('993430994') }
89
94
  end
90
95
  end
91
96
 
92
97
  describe 'shipping info' do
93
98
  context 'without shipping' do
94
- it { xml_content('checkout shipping').should be_empty }
95
- it { xml_content('checkout shipping address').should be_empty }
99
+ it { expect(xml_content('checkout shipping')).to be_empty }
100
+ it { expect(xml_content('checkout shipping address')).to be_empty }
96
101
  end
97
102
 
98
103
  context 'with empty shipping' do
99
104
  before{ payment.shipping = PagSeguro::Shipping.new }
100
105
 
101
- it { xml_content('checkout shipping').should_not be_empty }
102
- it { xml_content('checkout shipping address').should_not be_empty }
103
- it { xml_content('checkout shipping address state').should be_empty }
104
- it { xml_content('checkout shipping address city').should be_empty }
105
- it { xml_content('checkout shipping address postalCode').should be_empty }
106
- it { xml_content('checkout shipping address district').should be_empty }
107
- it { xml_content('checkout shipping address street').should be_empty }
108
- it { xml_content('checkout shipping address number').should be_empty }
109
- it { xml_content('checkout shipping address complement').should be_empty }
110
- it { xml_content('checkout shipping type').to_i.should == PagSeguro::Shipping::UNIDENTIFIED }
106
+ it { expect(xml_content('checkout shipping')).not_to be_empty }
107
+ it { expect(xml_content('checkout shipping address')).not_to be_empty }
108
+ it { expect(xml_content('checkout shipping address state')).to be_empty }
109
+ it { expect(xml_content('checkout shipping address city')).to be_empty }
110
+ it { expect(xml_content('checkout shipping address postalCode')).to be_empty }
111
+ it { expect(xml_content('checkout shipping address district')).to be_empty }
112
+ it { expect(xml_content('checkout shipping address street')).to be_empty }
113
+ it { expect(xml_content('checkout shipping address number')).to be_empty }
114
+ it { expect(xml_content('checkout shipping address complement')).to be_empty }
115
+ it { expect(xml_content('checkout shipping type').to_i).to eq(PagSeguro::Shipping::UNIDENTIFIED) }
111
116
  end
112
117
 
113
118
  context 'with shipping' do
114
119
  let(:payment){ build :payment_with_shipping }
115
120
 
116
- it { xml_content('checkout shipping').should_not be_empty }
117
- it { xml_content('checkout shipping address').should_not be_empty }
118
- it { xml_content('checkout shipping type').to_i.should == PagSeguro::Shipping::SEDEX }
119
- it { xml_content('checkout shipping cost').should == '12.13' }
120
- it { xml_content('checkout shipping address state').should == 'SP' }
121
- it { xml_content('checkout shipping address city').should == 'São Paulo' }
122
- it { xml_content('checkout shipping address postalCode').should == '05363000' }
123
- it { xml_content('checkout shipping address district').should == 'Jd. PoliPoli' }
124
- it { xml_content('checkout shipping address street').should == 'Av. Otacilio Tomanik' }
125
- it { xml_content('checkout shipping address number').should == '775' }
126
- it { xml_content('checkout shipping address complement').should == 'apto. 92' }
121
+ it { expect(xml_content('checkout shipping')).not_to be_empty }
122
+ it { expect(xml_content('checkout shipping address')).not_to be_empty }
123
+ it { expect(xml_content('checkout shipping type').to_i).to eq(PagSeguro::Shipping::SEDEX) }
124
+ it { expect(xml_content('checkout shipping cost')).to eq('12.13') }
125
+ it { expect(xml_content('checkout shipping address state')).to eq('SP') }
126
+ it { expect(xml_content('checkout shipping address city')).to eq('São Paulo') }
127
+ it { expect(xml_content('checkout shipping address postalCode')).to eq('05363000') }
128
+ it { expect(xml_content('checkout shipping address district')).to eq('Jd. PoliPoli') }
129
+ it { expect(xml_content('checkout shipping address street')).to eq('Av. Otacilio Tomanik') }
130
+ it { expect(xml_content('checkout shipping address number')).to eq('775') }
131
+ it { expect(xml_content('checkout shipping address complement')).to eq('apto. 92') }
127
132
  end
128
133
  end
129
134
 
130
135
  describe 'pre approval info' do
131
136
  context 'without pre approval' do
132
- it { xml_content('checkout preApproval').should be_empty }
137
+ it { expect(xml_content('checkout preApproval')).to be_empty }
133
138
  end
134
139
 
135
140
  context 'with pre_approval' do
136
141
  let(:payment){ build :payment_with_pre_approval }
137
142
 
138
- it { xml_content('checkout preApproval').should_not be_empty }
139
- it { xml_content('checkout preApproval name').should == 'Super seguro para notebook' }
140
- it { xml_content('checkout preApproval details').should == 'Toda segunda feira será cobrado o valor de R$150,00 para o seguro do notebook' }
141
- it { xml_content('checkout preApproval amountPerPayment').should == '150.00' }
142
- it { xml_content('checkout preApproval initialDate').should == '2015-01-17T00:00:00+00:00' }
143
- it { xml_content('checkout preApproval finalDate').should == '2017-01-17T00:00:00+00:00' }
144
- it { xml_content('checkout preApproval maxAmountPerPeriod').should == '200.00' }
145
- it { xml_content('checkout preApproval maxTotalAmount').should == '900.00' }
146
- it { xml_content('checkout preApproval reviewURL').should == 'http://sounoob.com.br/produto1' }
143
+ it { expect(xml_content('checkout preApproval')).not_to be_empty }
144
+ it { expect(xml_content('checkout preApproval name')).to eq('Super seguro para notebook') }
145
+ it { expect(xml_content('checkout preApproval details')).to eq('Toda segunda feira será cobrado o valor de R$150,00 para o seguro do notebook') }
146
+ it { expect(xml_content('checkout preApproval amountPerPayment')).to eq('150.00') }
147
+ it { expect(xml_content('checkout preApproval initialDate')).to eq('2015-01-17T00:00:00+00:00') }
148
+ it { expect(xml_content('checkout preApproval finalDate')).to eq('2017-01-17T00:00:00+00:00') }
149
+ it { expect(xml_content('checkout preApproval maxAmountPerPeriod')).to eq('200.00') }
150
+ it { expect(xml_content('checkout preApproval maxTotalAmount')).to eq('900.00') }
151
+ it { expect(xml_content('checkout preApproval reviewURL')).to eq('http://sounoob.com.br/produto1') }
147
152
 
148
153
  context 'weekly' do
149
154
  let(:payment){ build :payment_with_weekly_pre_approval }
150
155
 
151
- it { xml_content('checkout preApproval period').should == 'weekly' }
152
- it { xml_content('checkout preApproval dayOfWeek').should == 'monday' }
153
- it { xml_content('checkout preApproval dayOfMonth').should be_empty }
154
- it { xml_content('checkout preApproval dayOfYear').should be_empty }
156
+ it { expect(xml_content('checkout preApproval period')).to eq('weekly') }
157
+ it { expect(xml_content('checkout preApproval dayOfWeek')).to eq('monday') }
158
+ it { expect(xml_content('checkout preApproval dayOfMonth')).to be_empty }
159
+ it { expect(xml_content('checkout preApproval dayOfYear')).to be_empty }
155
160
  end
156
161
 
157
162
  context 'monthly' do
158
163
  let(:payment){ build :payment_with_monthly_pre_approval }
159
164
 
160
- it { xml_content('checkout preApproval period').should == 'monthly' }
161
- it { xml_content('checkout preApproval dayOfWeek').should be_empty }
162
- it { xml_content('checkout preApproval dayOfMonth').should == '3' }
163
- it { xml_content('checkout preApproval dayOfYear').should be_empty }
165
+ it { expect(xml_content('checkout preApproval period')).to eq('monthly') }
166
+ it { expect(xml_content('checkout preApproval dayOfWeek')).to be_empty }
167
+ it { expect(xml_content('checkout preApproval dayOfMonth')).to eq('3') }
168
+ it { expect(xml_content('checkout preApproval dayOfYear')).to be_empty }
164
169
  end
165
170
 
166
171
  context 'yearly' do
167
172
  let(:payment){ build :payment_with_yearly_pre_approval }
168
173
 
169
- it { xml_content('checkout preApproval period').should == 'yearly' }
170
- it { xml_content('checkout preApproval dayOfWeek').should be_empty }
171
- it { xml_content('checkout preApproval dayOfMonth').should be_empty }
172
- it { xml_content('checkout preApproval dayOfYear').should == '03-01' }
174
+ it { expect(xml_content('checkout preApproval period')).to eq('yearly') }
175
+ it { expect(xml_content('checkout preApproval dayOfWeek')).to be_empty }
176
+ it { expect(xml_content('checkout preApproval dayOfMonth')).to be_empty }
177
+ it { expect(xml_content('checkout preApproval dayOfYear')).to eq('03-01') }
173
178
  end
174
179
  end
175
180
  end