Skip to content

Commit c47a4f4

Browse files
committed
Merge pull request #5 from voldern/master
Added support for setting the rcpreq parameter in the request.
2 parents b6958c6 + 6933b5c commit c47a4f4

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Properties currently supported are:
4242
* :deliverytime - a Time object specifying when to send the message
4343
* :tariff - the amount (in local currency as cents/"ører") to charge the receiver
4444
* :servicecode - ServiceCode for sending GAS messages. Requires that :tariff is set. See [wiki](http://wiki.pswin.com/CPA-Goods-and-Services.ashx) for details.
45+
* :rcpreq - Set to true to indicate that a delivery report forward is desired for this message. See [wiki](http://wiki.pswin.com/Receive%20delivery%20report%20request%20XML.ashx) for details.
4546

4647
Specifying Host
4748
---------------

lib/pswincom/request.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def constr_msg m, args, id
3737
m.TTL args[:TTL] if args[:TTL]
3838
m.TARIFF args[:tariff] if args[:tariff]
3939
m.SERVICECODE args[:servicecode] if args[:servicecode]
40+
m.RCPREQ 'Y' if args[:rcpreq] == true
4041
m.DELIVERYTIME args[:deliverytime].strftime(TIME_FORMAT) if args.include? :deliverytime
4142
end
4243
end

pswincom.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |s|
22
s.name = 'pswincom'
3-
s.version = '0.1.6'
3+
s.version = '0.1.7'
44
s.authors = ['PSWinCom AS']
55
s.email = ['[email protected]']
66
s.homepage = 'http://github.com/tormaroe/pswincomgem'

spec/request_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ module PSWinCom
2828
:sender => 'FooBar',
2929
:tariff => 500,
3030
:servicecode => 15001,
31+
:rcpreq => true,
3132
:TTL => 4,
3233
:deliverytime => Time.utc(2011, 02, 15, 13, 30)
3334
request.xml.should ==
@@ -36,7 +37,7 @@ module PSWinCom
3637
"<MSG>" +
3738
"<ID>1</ID><TEXT>A delayed message</TEXT><RCV>88888888</RCV>" +
3839
"<SND>FooBar</SND><TTL>4</TTL><TARIFF>500</TARIFF><SERVICECODE>15001</SERVICECODE>" +
39-
"<DELIVERYTIME>201102151330</DELIVERYTIME>" +
40+
"<RCPREQ>Y</RCPREQ><DELIVERYTIME>201102151330</DELIVERYTIME>" +
4041
"</MSG>" +
4142
"</MSGLST></SESSION>"
4243
end

0 commit comments

Comments
 (0)