Skip to content

Setting the item description for the Payee #41

Open
@paulleader

Description

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"]))

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions