나는 누군가가 나를 붙잡 았던이 문제로 나를 도울 수 있기를 바라고 있습니다. 나는 내 레일 앱에서 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
내가 그가 모든 관련 물건을 것 같아요, 그래서 사람이 작동하지 않을 이유를 볼 수 있다면, 그것은 많이 감사 할 것 :
여기 내 체크 아웃 컨트롤러에서 일어나고있는 일입니다.
감사합니다.