spec/paypal/payment/request_spec.rb in paypal-express-0.5.2 vs spec/paypal/payment/request_spec.rb in paypal-express-0.5.3

- old
+ new

@@ -7,21 +7,26 @@ :tax_amount => 0.4, :shipping_amount => 1.5, :currency_code => :JPY, :description => 'Instant Payment Request', :notify_url => 'http://merchant.example.com/notify', + :invoice_number => 'ABC123', + :custom => 'Custom', :items => [{ :quantity => 2, :name => 'Item1', :description => 'Awesome Item 1!', :amount => 10.25 }, { :quantity => 3, :name => 'Item2', :description => 'Awesome Item 2!', :amount => 1.1 - }] + }], + :custom_fields => { + "l_surveychoice{n}" => 'abcd' # The '{n}' will be replaced with the index + } ) end let :recurring_request do Paypal::Payment::Request.new( @@ -67,20 +72,23 @@ instant_request.to_params.should == { :PAYMENTREQUEST_0_AMT => "25.70", :PAYMENTREQUEST_0_TAXAMT => "0.40", :PAYMENTREQUEST_0_SHIPPINGAMT => "1.50", :PAYMENTREQUEST_0_CURRENCYCODE => :JPY, - :PAYMENTREQUEST_0_DESC => "Instant Payment Request", + :PAYMENTREQUEST_0_DESC => "Instant Payment Request", :PAYMENTREQUEST_0_NOTIFYURL => "http://merchant.example.com/notify", :PAYMENTREQUEST_0_ITEMAMT => "23.80", + :PAYMENTREQUEST_0_INVNUM => "ABC123", + :PAYMENTREQUEST_0_CUSTOM => "Custom", :L_PAYMENTREQUEST_0_NAME0 => "Item1", :L_PAYMENTREQUEST_0_DESC0 => "Awesome Item 1!", :L_PAYMENTREQUEST_0_AMT0 => "10.25", :L_PAYMENTREQUEST_0_QTY0 => 2, :L_PAYMENTREQUEST_0_NAME1 => "Item2", :L_PAYMENTREQUEST_0_DESC1 => "Awesome Item 2!", :L_PAYMENTREQUEST_0_AMT1 => "1.10", - :L_PAYMENTREQUEST_0_QTY1 => 3 + :L_PAYMENTREQUEST_0_QTY1 => 3, + :L_SURVEYCHOICE0 => 'abcd' # Note the 'n' was replaced by the index } end it 'should handle Recurring Payment parameters' do recurring_request.to_params.should == {