我认为您必须创建一个结算计划。以下摘录来自PayPal SDK。我根据您的需要对其进行了一些修改,但是您仍然需要对其进行自定义。
var plan = new Plan
{
name = "Donation Split Payment",
description = "Monthly plan for the less fortunate.",
type = "fixed",
// Define the merchant preferences.
// More Information: https://developer.paypal.com/webapps/developer/docs/api/#merchantpreferences-object
merchant_preferences = new MerchantPreferences()
{
setup_fee = GetCurrency("0"),
return_url = httpContext.Request.Url.ToString(),
cancel_url = httpContext.Request.Url.ToString() + "?cancel",
auto_bill_amount = "YES",
initial_fail_amount_action = "CONTINUE",
max_fail_attempts = "0"
},
payment_definitions = new List<PaymentDefinition>
{
// Define a trial plan that will only charge $50 for the first
// month. After that, the standard plan will take over for the
// remaining 4 months.
new PaymentDefinition()
{
name = "First Payment",
type = "REGULAR",
frequency = "MONTH",
frequency_interval = "1",
amount = GetCurrency("50.00"),
cycles = "1",
charge_models = new List<ChargeModel>
{
new ChargeModel()
{
type = "TAX",
amount = GetCurrency("9.99")
}
}
},
// Define the standard payment plan. It will represent a monthly
// plan for $50 USD that charges once month for 3 months.
new PaymentDefinition
{
name = "Other payment",
type = "REGULAR",
frequency = "MONTH",
frequency_interval = "1",
amount = GetCurrency("50.00"),
// > NOTE: For `IFNINITE` type plans, `cycles` should be 0 for a `REGULAR` `PaymentDefinition` object.
cycles = "3",
charge_models = new List<ChargeModel>
{
new ChargeModel
{
type = "TAX",
amount = GetCurrency("9.99")
}
}
}
}
};
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
155 次 |
| 最近记录: |