很抱歉,我们现在无法完成您的付款。请稍后再试 - PayPal Payments Pro

We’re sorry, we can’t complete your payment now. Please try again later - PayPal Payments Pro

我已经实现了 Website Payments Pro Hosted 的 IFrame 版本。我使用按钮 API 注册了我的按钮,取回一个 Url 以输入一个 IFrame,它显示了 PayPal 通过信用卡支付或登录并支付选项。

我的集成在登录和使用我的 PayPal 帐户时正常工作,但是当我输入信用卡详细信息时,出现错误:

We’re sorry, we can’t complete your payment now. Please try again later.

我没有得到任何其他信息表明这个和我的通知 Url 没有被错误代码或任何东西触及。

这是我用来让 Url 馈入 IFrame 的代码(注意:我添加了帐单地址字段,假设它可能会抛出错误,因为我需要地址刷卡支付详情。

public PayPalPaymentProRegistrationResponse RegisterTransaction(PayPalPaymentProRequest request)
{
    CountryCodeType countryCodeType;
    if (!Enum.TryParse(request.Order.BillingContact.Address.Country.Iso2Code, true, out countryCodeType))
        return new PayPalPaymentProRegistrationResponse(PayPalPaymentProRegistrationResponseType.Error, "Billing country not supported.");

    var service = new PayPalAPIInterfaceServiceService(GetConfig(request));
    var createButtonResponse = service.BMCreateButton(new BMCreateButtonReq
    {
        BMCreateButtonRequest = new BMCreateButtonRequestType
        {
            ButtonType = ButtonTypeType.PAYMENT,
            ButtonCode = ButtonCodeType.TOKEN,
            ButtonCountry = countryCodeType,
            ButtonVar = new List<string>
            {
                String.Format("subtotal={0}", _salesOrderPriceService.GetGrossTotal(request.Order)),
                String.Format("notify_url={0}", request.NotifyUrl),
                String.Format("return={0}", request.ReturnUrl),
                String.Format("invoice={0}", request.Order.Id),
                String.Format("currency_code={0}", request.Order.Currency.Code),
                String.Format("cancel_return={0}", request.CancelReturnUrl),
                "billing_first_name=my",
                "billing_last_name=name",
                "billing_address1=address 1",
                "billing_city=town",
                "billing_state=county",
                "billing_zip=PO CODE",
                "billing_country=GB",
                "showHostedThankyouPage=true",
                "template=templateD"
            }
        }
    });

    return new PayPalPaymentProRegistrationResponse
    {
        ForwardingUrl = createButtonResponse.Email,
        Status = PayPalPaymentProRegistrationResponseType.Ok
    };
}

注意:我使用的是信用卡号4111111111111111。如果我尝试使用其他号码 4929000000006 它会 return 一个不同的错误说信息无效并突出显示信用卡号码字段所以我确信我使用的测试号码是好的.

我正在使用我的 Sandbox 帐户进行集成。

有人对可能出现的问题有任何看法吗?

原来我用于SandBox 的信用卡号是错误的。您需要登录您的 Sandbox 帐户并查看配置文件。在其中,您会看到一个可以用来测试的信用卡号码。

我还在我的按钮请求中添加了 "paymentaction=sale"

完成这两项后,现在需要付款。