Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neither product name nor SKU in paypal order #36

Closed
momolog opened this issue Oct 23, 2013 · 9 comments
Closed

Neither product name nor SKU in paypal order #36

momolog opened this issue Oct 23, 2013 · 9 comments

Comments

@momolog
Copy link

momolog commented Oct 23, 2013

We use rails 3.2.14 and spree 2.0.5.beta

This is our Gemfile:

source 'https://rubygems.org'
ruby '1.9.3'

if RUBY_VERSION =~ /1.9/
  Encoding.default_external = Encoding::UTF_8
  Encoding.default_internal = Encoding::UTF_8
end

gem 'rails',        '~> 3.2'
gem 'sass-rails',   '~> 3.2'
gem 'compass-rails'
gem 'slim-rails'
gem 'authlogic'
gem 'maruku'

gem 'spree', '2.0.5.beta',  :github => 'spree/spree',                 :branch => '2-0-stable'
gem 'spree_i18n',           :github => 'spree/spree_i18n',            :branch => '2-0-stable'
gem 'spree_gateway',        :github => 'spree/spree_gateway',         :branch => '2-0-stable'
gem 'spree_auth_devise',    :github => 'spree/spree_auth_devise',     :branch => '2-0-stable'
gem 'spree_static_content', :github => 'spree/spree_static_content',  :branch => '2-0-stable'
gem 'spree_editor',         :github => 'spree/spree_editor'
gem 'spree_paypal_express', :github => "radar/better_spree_paypal_express", :branch => "2-0-stable"

# Gems used only for assets and not required in production environments by default.
group :assets do
  gem 'coffee-rails', '~> 3.2'
  gem 'uglifier', '>= 1.0.3'
  gem 'compass-rails'
end

group :development, :test do
  gem 'rspec-rails'
  gem 'capybara'
  gem 'sqlite3-ruby'
  gem 'debugger'
  gem 'mocha'
  gem 'factory_girl_rails'
end

# heroku stuff
gem 'pg'
gem 'activerecord-postgresql-adapter'
gem 'heroku'
gem 'taps'
gem 'thin'
gem 'foreman'
gem 'sentry-raven' # https://devcenter.heroku.com/articles/sentry

# our extensions
gem 'spree_multilingual_static_content', :github => 'momolog/spree_multilingual_static_content'

When checking out the Paypal cart is reached and contains the ordered item with name:
cart
After ordering, the item name does not turn up in the order confirmation (neither for the customer nor the shop):
cart
Nor is it visible in the paypal backend. This makes it impossible to know, which product was ordered.

There obviously is no stacktrace but a inspect of the object returned by BuildSetExpressCheckout (lib/paypal-sdk/merchant/services.rb:573) looks like this

#<PayPal::SDK::Merchant::DataTypes::SetExpressCheckoutRequestType:0x007fb4e30dfd00 
  @SetExpressCheckoutRequestDetails=#<PayPal::SDK::Merchant::DataTypes::SetExpressCheckoutRequestDetailsType:0x007fb4e30dfb70 
    @ReturnURL="http://localhost:3000/paypal/confirm?payment_method_id=3", 
    @CancelURL="http://localhost:3000/paypal/cancel", 
    @PaymentDetails=[
      #<PayPal::SDK::Merchant::DataTypes::PaymentDetailsType:0x007fb4ed476428 
        @OrderTotal=#<PayPal::SDK::Merchant::DataTypes::BasicAmountType:0x007fb4ed476338 
          @currencyID="EUR", 
          @value="0.1"
        >, 
      @ItemTotal=#<PayPal::SDK::Merchant::DataTypes::BasicAmountType:0x007fb4ed47bb80 
        @currencyID="EUR", 
        @value="0.1"
       >, 
       @ShippingTotal=#<PayPal::SDK::Merchant::DataTypes::BasicAmountType:0x007fb4ed4796c8 
         @currencyID="EUR", 
         @value="0.0"
       >, 
       @TaxTotal=#<PayPal::SDK::Merchant::DataTypes::BasicAmountType:0x007fb4ed47f078 
         @currencyID="EUR", 
         @value="0"
       >, 
       @ShipToAddress=#<PayPal::SDK::Merchant::DataTypes::AddressType:0x007fb4ed47eb78 
         @Name="Olaf Perkins", 
         @Street1="Luisestr. 1", 
         @Street2=nil, 
         @CityName="Berlin", 
         @StateOrProvince="Germany", 
         @Country="DE", 
         @PostalCode="10188"
        >, 
        @PaymentDetailsItem=[
          #<PayPal::SDK::Merchant::DataTypes::PaymentDetailsItemType:0x007fb4ed47ddb8 
            @Name="COPY OF Testprodukt", 
            @Quantity=1, 
            @Amount=#<PayPal::SDK::Merchant::DataTypes::BasicAmountType:0x007fb4ed47d9f8 
              @currencyID="EUR", 
              @value="0.01"
            >, 
           @ItemCategory="Physical"
         >
       ], 
       @ShippingMethod="Shipping Method Name Goes Here", 
       @PaymentAction="Sale", 
       @ButtonSource="PayPal_SDK"
     >
   ]
 >, 
 @Version="106.0"
>

The products SKU seems to be never to transferred to Paypal at all.

I was expecting

  1. the name of the product to be part of the final paypal transaction
  2. that the SKU of the product is transferred as part of the item description to avoid confusion when products have similar names
@momolog
Copy link
Author

momolog commented Oct 23, 2013

I filed a stackoverflow question about this, too, because I need to fix this quickly.

@radar
Copy link
Contributor

radar commented Oct 24, 2013

This is very strange. Could you please provide the information we ask for in the Contributing Guidelines? That'd help me be able to debug this problem properly.

Thanks!

@momolog
Copy link
Author

momolog commented Oct 24, 2013

Fair enough, sorry.
I added information to the original problem description.

@momolog
Copy link
Author

momolog commented Oct 26, 2013

This is what the paypal technical customer service wrote (translated by me):

I saw that you are sending

    paymentrequest_0_name "COPY OF Testprodukt" 

but it should be 

    L_PAYMENTREQUEST_n_NAMEm "COPY OF Testprodukt"

Now I wonder, what could be the reason for this? Where are these strings generated?

@momolog
Copy link
Author

momolog commented Oct 30, 2013

This problem is still existent and I have no idea on how to fix it.
Is there anything I can provide as further information to get your help? I do have a complete dump of the payment request to Paypal from their technical support team. They say the format is not correct.
Which gem is the low level generation of the request taking place in? Maybe I should file a bug there?

@radar
Copy link
Contributor

radar commented Oct 30, 2013

I'm sorry that this problem still exists. I am currently attending to other things within Spree, but will get to this as soon as I can.

@azinazadi
Copy link
Contributor

The problem is on SetExpressCheckout we send the item details but in DoExpressCheckoutPayment we dont.

The answer from the paypal team is not quiete relevant, as we are sending them soap data.

The REAL problem is that, we dont send paypal item details. "what??". yeah. Let me describe it better:

papal express checkout works in 4 steps:

  1. The shop calls SetExpressCheckout on paypal to set up the payment and get a token
  2. redirect the buyer to paypal with the token
  3. After the buyer has agreed to the payment, he is returned back to the shop
  4. The shop calls DoExpressCheckoutPayment to finalize the payment. the user dont see this.

what is happening here is that, we (send item details on the first step)[https://github.com/radar/better_spree_paypal_express/blob/master/app/controllers/spree/paypal_controller.rb#L45], so paypal shows it. but in the last step to finalize it, we (dont send the item details)[https://github.com/radar/better_spree_paypal_express/blob/master/app/models/spree/gateway/pay_pal_express.rb#L38]. so paypal dont care of it in the emails and so on.

I checked the logs of what we do send to paypal and it confirms with what i said. I am on 2-1-stable branch.

azinazadi added a commit to keevee/better_spree_paypal_express that referenced this issue Nov 9, 2013
- send line items on purchase step (last step) to paypal, so it shows up in the paypal backend and in emails

[Fixes spree-contrib#36]
@azinazadi
Copy link
Contributor

With the above changes it looks good

mit_paypal_bezahlen_-_paypal

paypal_website_payment_details_-_paypal

azinazadi added a commit to keevee/better_spree_paypal_express that referenced this issue Nov 9, 2013
radar pushed a commit that referenced this issue Nov 11, 2013
…p (last step) to paypal, so it shows up in the paypal backend and in emails

Fixes #36
Fixes #43
@radar radar closed this as completed in 2f58375 Nov 11, 2013
@radar
Copy link
Contributor

radar commented Nov 11, 2013

@momolog Please try the latest commits to this extension now.

radar pushed a commit that referenced this issue Nov 11, 2013
…p (last step) to paypal, so it shows up in the paypal backend and in emails

Fixes #36
Fixes #43
azinazadi added a commit to keevee/better_spree_paypal_express that referenced this issue Dec 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants