【问题标题】:ActiveMerchant: Buyer Account Balance Doesn't DecreaseActiveMerchant:买家账户余额不会减少
【发布时间】:2012-03-16 00:49:24
【问题描述】:

我在 Ruby 1.9.3 和 Rails 3.1 中使用 ActiveMerchant gem

我已经使用 WebPayments Pro 在 PayPal 上设置了买家虚拟账户和卖家虚拟账户。当我运行此脚本并查看我的贝宝沙箱时,我的卖家账户正确存入了 10 美元。

问题是,当我查看买家帐户的沙盒时,余额并没有减少。我的卖家从哪里得到钱?

我的代码在这里:

require "rubygems"
require "active_merchant"

ActiveMerchant::Billing::Base.mode = :test

gateway = ActiveMerchant::Billing::PaypalGateway.new(
  :login => "seller_1328509472_biz_api1.gmail.com",
  :password => "*******",
  :signature => "******"
)

credit_card ||= ActiveMerchant::Billing::CreditCard.new(
  :type               => "visa",
  :number             => "4193536536887351",
  :verification_value => "123",
  :month              => 2,
  :year               => 2017,
  :first_name         => "TESTING",
  :last_name          => "BUYER"
)

if credit_card.valid?
  response = gateway.authorize(1000, credit_card, :ip => "98.248.144.120", :billing_address => { :name => 'Test User', :company => '', :address1 => '1 Main St', :address2 => '', :city => 'San Jose', :state => 'CA', :zip => '95131'})
  if response.success?
    gateway.capture(1000, response.authorization)
  else
    puts "Response Unsuccessful Error: #{response.message}"
  end
else
  puts "Error: credit card is not valid. #{credit_card.errors.full_messages.join('. ')}"
end

请帮帮我!多年来我一直坚持这一点,我很困惑。

【问题讨论】:

    标签: ruby-on-rails paypal paypal-sandbox activemerchant


    【解决方案1】:

    因为您直接指定信用卡,所以没有“帐户”可以从中提取资金。 您使用的 API 方法 DoDirectPayment 直接向信用卡收费。它没有连接到 PayPal 账户,也没有使用 PayPal 账户的余额。

    如果您想从 PayPal 帐户而非信用卡中收取费用,请使用 PayPal Express Checkout:http://railscasts.com/episodes/146-paypal-express-checkout

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-09-23
      • 2014-01-01
      • 2015-10-22
      • 2011-12-09
      • 1970-01-01
      • 1970-01-01
      • 2016-10-11
      • 2021-05-19
      相关资源
      最近更新 更多