Class: Ccfulfillment::Base
- Inherits:
-
Object
- Object
- Ccfulfillment::Base
- Defined in:
- lib/ccfulfillment.rb
Instance Attribute Summary collapse
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
- #create_fulfillment(data) ⇒ Object
- #fulfillment_url ⇒ Object
-
#initialize(info) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(info) ⇒ Base
Returns a new instance of Base.
9 10 11 |
# File 'lib/ccfulfillment.rb', line 9 def initialize(info) @user = info end |
Instance Attribute Details
#user ⇒ Object
Returns the value of attribute user.
7 8 9 |
# File 'lib/ccfulfillment.rb', line 7 def user @user end |
Instance Method Details
#create_fulfillment(data) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/ccfulfillment.rb', line 19 def create_fulfillment(data) create_fulfillment_url = fulfillment_url + "&action=createFulfillment&transactionId=" + data["transaction_id"] + "&shippingCompany=" + data["shipping_company"] + "&trackingId=" + data["tracking_id"] response = RestClient.get create_fulfillment_url hash_response = Crack::XML.parse(response.to_s) return hash_response["results"] end |
#fulfillment_url ⇒ Object
13 14 15 16 17 |
# File 'lib/ccfulfillment.rb', line 13 def fulfillment_url "https://datalink.ccbill.com/utils/subscriptionManagement.cgi?clientAccnum=" + @user["client_acc_num"] + "&username=" + @user["username"] + "&password=" + @user["password"] + "&returnXML=1" + "&clientSubacc=" + @user["client_sub_acc"] end |