Paypal可变金额2的定期付款(在西班牙) [英] Paypal recurring payments with variable amount 2 (in Spain)

查看:115
本文介绍了Paypal可变金额2的定期付款(在西班牙)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几天前,我写了这篇有关可变金额的Paypal定期付款的帖子 Paypal定期可变金额的付款

some days ago, I wrote this post regarding Paypal recurring payments with variable amount Paypal recurring payments with variable amount

我将其标记为固定,但是不是固定的.

I marked it as fixed, however it is not.

首先,我决定开发方法1(通过删除旧的配置文件并创建一个新的配置文件).这行得通.但是,在那之后,我意识到,我并没有满足我的所有要求.所以最后,对我来说正确的方法是数字2.这意味着,正如@Andrew Angell所建议的那样,我将开发一个定制的计费系统来为客户计费.为此,我将创建账单协议",并使用返回的ID来以我需要的数量和所需的时间执行参考交易.到目前为止,对吗?

First, I decided to develop approach 1 (by removing old profile and creating a new one). This worked. But, after that I realized, that I didn´t cover all my requirements. So finally, the right approach for me is number 2. This means, as @Andrew Angell suggested, I will develop a custom billing system that bills the customers. For that, I will create Billing Agreements and I will use the returned ids to execute Reference transactions with the amount I need and whenever I need. So far, it´s right?

根据Paypal文档,这是可能的: https ://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECReferenceTxns/

According to Paypal docs, this is possible: https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECReferenceTxns/

因此,我正在尝试遵循以下步骤,因此首先执行setExpressCheckout:

So, I´m trying to follow the steps, so first a execute a setExpressCheckout:

# Paypal setExpressCheckout
def setExpressCheckout(billingType, returnURL, cancelURL, price, description)

  @api = PayPal::SDK::Merchant::API.new            

  if billingType == "credit-card"
    billingType = "Billing"
  else 
    billingType = "Login"
  end

  @set_express_checkout = @api.build_set_express_checkout({
  SetExpressCheckoutRequestDetails: {   
    ReturnURL: returnURL,
    CancelURL: cancelURL,
    LocaleCode: "US",
    LandingPage: billingType,
    PaymentDetails: [{
      NotifyURL: returnURL,
      OrderTotal: {
        currencyID: "EUR",
        value: price
      },       
      ShippingTotal: {
        currencyID: "EUR",
        value: "0"
      },
      TaxTotal: {
        currencyID: "EUR",
        value: "0"
      },
      PaymentDetailsItem: [{
        Name: description,  
        Quantity: 1,
        Amount: {
          currencyID: "EUR",
          value: price
        },           
      }],          
      PaymentAction: "Authorization" # To authorize and retain the funds, and when booking is confirmed capture them.
    }],
    BillingAgreementDetails: [{          
      BillingType: "MerchantInitiatedBillingSingleAgreement", 
      BillingAgreementDescription: description
    }]
   }
  })

  # Make API call & get response
  @express_checkout_response = @api.set_express_checkout(@set_express_checkout)

  # Access Response
  if @express_checkout_response.success?
    @token = @express_checkout_response.Token
    puts "setExpressCheckout completed OK :)"
    @paypal_url = @api.express_checkout_url(@express_checkout_response)        
  else
    puts "setExpressCheckout KO :("
    @express_checkout_response.Errors
    puts "@express_checkout_response=" + @express_checkout_response.inspect
  end

  @express_checkout_response
end

但是,出现此错误:

@LongMessage="Merchant not enabled for reference transactions", @ErrorCode="11452"

很明显,只需要联系Paypal支持人员并要求他们在我的Paypal沙箱帐户中启用参考交易即可.正确的?我已经做到了,我只是在等待.

It´s quite clear, just need to contact Paypal support guys and ask them to enable Reference transactions in my Paypal sandbox account. Right? I already did it and I´m just waiting.

但是,真正让我担心的是,我给贝宝(Paypal)支持打电话,他们告诉我,这种方法在西班牙不起作用.尽管它在文档中,但仅在英国使用.这是真的?

However, what really worries me, is that I called Paypal support and they told me that this approach will not work in Spain. Although it´s in the doc, it´s only working in UK. Is this true?

如果的确如此,我真的很麻烦,因为据我所知,Paypal不支持可变金额的订阅.

If it´s true, I´m really in a trouble, because as far as I know, Paypal doesn´t not support subscriptions with variable amount.

推荐答案

Paypal技术支持人员启用了我的沙箱帐户来引用交易.我已经开发出逻辑,并且可以正常工作.至少在沙盒和西班牙.

Paypal technical support guy has enabled my sandbox account to reference transactions. I have developed the logic and it´s working. At least, in Sandbox and in Spain.

所以,我想,它可以工作.

So, I will assume, it works.

在电话上告诉我这是不可能的Paypal家伙坏了.

Bad the Paypal guy on the phone that told me it wasn´t possible.

这篇关于Paypal可变金额2的定期付款(在西班牙)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆