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

Setting the item description for the Payee #41

Open
paulleader opened this issue Mar 3, 2013 · 2 comments
Open

Setting the item description for the Payee #41

paulleader opened this issue Mar 3, 2013 · 2 comments

Comments

@paulleader
Copy link

I think I must be missing something obvious, but I can't figure out how to change the text that PayPal displays for the item description when people come to pay, in the "Payment Summary" section.

It just displays the name of the primary account.

I'm building a site that let people make payments to other members, from which we take a small cut.

Setting the descriptions for the invoices works a treat, with each user seeing the correct thing, except for the actual payee, who just sees "Joe Smith's Test Store" (the sandbox test account's name).

I've looked in the docs for ActiveMerchant and Adaptive Payments but I just can't work out where the correct place to do this is. Some help would be very much appreciated. The code I'm using is below.

payment = payment_gateway.setup_purchase(
  :action_type => "CREATE",
  :return_url => completed_credit_path(@credit.uuid, :only_path => false),
  :cancel_url => failed_credit_path(@credit.uuid, :only_path => false),
  :currency_code => 'GBP',
  :memo => "Payment - #{@credit.event.name}",
  :receiver_list => recipients
)

payment_gateway.set_payment_options(
  :display_options => {
    :business_name    => "My Business"
  },
  :pay_key => payment["payKey"],
  :receiver_options => [
    {
      :receiver => { :email =>  ENV['PAYPAL_ACCOUNT'] },
      :invoice_data => {
        :item => [
          { 
            :name => "Payment - #{@credit.event.name}",
            :description => "Payment - #{@credit.event.name}",
            :item_count => 1,
            :item_price => @credit.full_price,
            :price => @credit.full_price
          }
        ]
      }
    },
    {
      :receiver => { :email => @credit.organiser.email },
      :invoice_data => {
        :item => [
          { 
            :name => "Payment - #{@credit.event.name} (After Fees)",
            :description => "Payment - #{@credit.event.name} (After Fees)",
            :item_count => 1,
            :item_price => @credit.take_home,
            :price => @credit.take_home
          }
        ]
      }
    }
  ]
)

redirect_to (payment_gateway.redirect_url_for(payment["payKey"]))
@DarrenFung
Copy link

You are doing it correctly. I am doing it this way, and I see the invoice under the seller's name in PayPal (after expanding via [+]). I think this is more of a PayPal documentation problem. I believe the redirect flow for AP and the embedded flow for AP differ quite a bit. For example, the embedded flow allows requesting shipping details, but the redirect flow doesn't. This might be another difference between the two flows. Try using the embedded flow to see if you see the invoice details.

@paxer
Copy link

paxer commented Apr 6, 2013

I have a problem with this too and by watching on official PayPal AdaptivePayment API examples https://paypal-sdk-samples.herokuapp.com/adaptive_payments/set_payment_options , looks like it's not possible to set Payment Options without providing the Institution attribute. The InstitutionId attribute is something PayPal provide to only its partners, so PayPal account owner should be registered on PayPal as a partner.

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