2013-04-01 6 views
0

나는 누군가가 나를 붙잡 았던이 문제로 나를 도울 수 있기를 바라고 있습니다. 나는 내 레일 앱에서 ActiveMerchant를 사용하여 Paypal 게이트웨이와 장바구니 거래를 처리합니다.ActiveMerchant (지불 전문가)와 함께 PayPal로 상품 데이터 전달

거래가 성공적이지만, 내 PayPal 계정 내역을 볼 때 거래와 관련된 항목에 대한 정보는 없습니다. 경우에 따라 항목 데이터가 전달되지만 대부분의 경우 항목에 세부 정보가 표시되지 않습니다.

def process_order    
    @items = Array.new  

    @donations.each do |d| 
     item = Hash.new   
     item[:name] = d.project.title 
     item[:quantity] = 1 
     item[:description] = "Donation from website" 
     item[:amount] = (d.pledge.to_i*100).round 
     @items << item 
    end 

    @response = GATEWAY.purchase(price_in_cents, credit_card, purchase_options) 
    if @response.success? 
     @validTransaction = true 
    end 
end 

private 

def purchase_options  
    { 
    :items => @items,  
    :ip => request.remote_ip, 
    :billing_address => { 
    :name  => params[:first_name], 
    :address1 => params[:last_name], 
    :city  => params[:city], 
    :state => params[:state], 
    :country => params[:country], 
    :zip  => params[:zip] 
    } 
    } 
end 

def validate_card 
    unless credit_card.valid? 
    credit_card.errors.full_messages.each do |message| 
     @errors += message + "<br/>" 
    end 
    end 
end 

def credit_card 
    @credit_card ||= ActiveMerchant::Billing::CreditCard.new(
    :brand    => params[:card_type], 
    :number    => params[:card_number], 
    :verification_value => params[:card_verification], 
    :month    => params[:date][:month], 
    :year    => params[:date][:year], 
    :first_name   => params[:first_name], 
    :last_name   => params[:last_name] 
) 
end 

내가 그가 모든 관련 물건을 것 같아요, 그래서 사람이 작동하지 않을 이유를 볼 수 있다면, 그것은 많이 감사 할 것 :

여기 내 체크 아웃 컨트롤러에서 일어나고있는 일입니다.

감사합니다.

답변

0

나는 "설명"값 (내 설명은 HTML 코드를 저장)에 HTML 코드를 전달했기 때문에 이와 비슷한 문제가있었습니다. HTML 태그가 붙은 설명을 내 정적 인 설명으로 바꾸면 문제가 해결되어 제대로 작동합니다.

문제를 아직 해결하지 않은 경우 더 많은 정적 데이터로 테스트하여 문제의 원인을 확인하십시오.