Permalink
Browse files

add parameter of response for Reference Transaction

  • Loading branch information...
1 parent 4710a4f commit fc48ded9863582a55e5d6146095ef4723a8e925d @hanzawa hanzawa committed Jun 21, 2011
@@ -15,7 +15,8 @@ class Response < Base
:NOTIFYURL => :notify_url,
:TIMESTAMP => :timestamp,
:TOKEN => :token,
- :VERSION => :version
+ :VERSION => :version,
+ :BILLINGAGREEMENTID => :billing_agreement_id
}
attr_accessor *@@attribute_mapping.values
attr_accessor :shipping_options_is_default, :success_page_redirect_requested, :insurance_option_selected
@@ -1,7 +1,7 @@
module Paypal
module Payment
class Response < Base
- attr_accessor :amount, :ship_to, :description, :note, :items, :notify_url, :insurance_option_offered, :currency_code, :error_code, :transaction_id
+ attr_accessor :amount, :ship_to, :description, :note, :items, :notify_url, :insurance_option_offered, :currency_code, :error_code, :transaction_id, :billing_agreement_id
def initialize(attributes = {})
attrs = attributes.dup
@@ -31,6 +31,7 @@ def initialize(attributes = {})
@currency_code = attrs.delete(:CURRENCYCODE)
@error_code = attrs.delete(:ERRORCODE)
@transaction_id = attrs.delete(:TRANSACTIONID)
+ @billing_agreement_id = attrs.delete(:BILLINGAGREEMENTID)
# items
items = []
@@ -1 +1 @@
-TOKEN=EC-9E2743126S4330617&SUCCESSPAGEREDIRECTREQUESTED=false&TIMESTAMP=2011-02-08T03:23:55Z&CORRELATIONID=15b93874c358c&ACK=Success&VERSION=66.0&BUILD=1721431&INSURANCEOPTIONSELECTED=false&SHIPPINGOPTIONISDEFAULT=false&PAYMENTINFO_0_TRANSACTIONID=8NC65222871997739&PAYMENTINFO_0_TRANSACTIONTYPE=expresscheckout&PAYMENTINFO_0_PAYMENTTYPE=instant&PAYMENTINFO_0_ORDERTIME=2011-02-08T03:23:54Z&PAYMENTINFO_0_AMT=14.00&PAYMENTINFO_0_FEEAMT=0.85&PAYMENTINFO_0_TAXAMT=0.00&PAYMENTINFO_0_CURRENCYCODE=USD&PAYMENTINFO_0_PAYMENTSTATUS=Completed&PAYMENTINFO_0_PENDINGREASON=None&PAYMENTINFO_0_REASONCODE=None&PAYMENTINFO_0_PROTECTIONELIGIBILITY=Ineligible&PAYMENTINFO_0_PROTECTIONELIGIBILITYTYPE=None&PAYMENTINFO_0_ERRORCODE=0&PAYMENTINFO_0_ACK=Success
+TOKEN=EC-9E2743126S4330617&SUCCESSPAGEREDIRECTREQUESTED=false&TIMESTAMP=2011-02-08T03:23:55Z&CORRELATIONID=15b93874c358c&ACK=Success&VERSION=66.0&BUILD=1721431&INSURANCEOPTIONSELECTED=false&SHIPPINGOPTIONISDEFAULT=false&PAYMENTINFO_0_TRANSACTIONID=8NC65222871997739&PAYMENTINFO_0_TRANSACTIONTYPE=expresscheckout&PAYMENTINFO_0_PAYMENTTYPE=instant&PAYMENTINFO_0_ORDERTIME=2011-02-08T03:23:54Z&PAYMENTINFO_0_AMT=14.00&PAYMENTINFO_0_FEEAMT=0.85&PAYMENTINFO_0_TAXAMT=0.00&PAYMENTINFO_0_CURRENCYCODE=USD&PAYMENTINFO_0_PAYMENTSTATUS=Completed&PAYMENTINFO_0_PENDINGREASON=None&PAYMENTINFO_0_REASONCODE=None&PAYMENTINFO_0_PROTECTIONELIGIBILITY=Ineligible&PAYMENTINFO_0_PROTECTIONELIGIBILITYTYPE=None&PAYMENTINFO_0_ERRORCODE=0&BILLINGAGREEMENTID=B-1XR87946TC504770W&PAYMENTINFO_0_ACK=Success
@@ -79,6 +79,7 @@
response = request.checkout! 'token', 'payer_id', payment_request
response.payment_responses.size.should == 0
response.payment_info.size.should == 1
+ response.billing_agreement_id.should == 'B-1XR87946TC504770W'
response.payment_info.first.should be_instance_of(Paypal::Payment::Response::Info)
end
end

0 comments on commit fc48ded

Please sign in to comment.