[英]Recurring Payment With Authorize.Net
I am trying to implement Authorize.Net
in an ASP.NET
web form app and as I am new to it, was going through its official website and few other random sites to learn about it.我正在尝试在
ASP.NET
web 表单应用程序中实现Authorize.Net
,由于我是新手,因此正在通过其官方网站和其他一些随机网站了解它。 The following links helped me a bit:以下链接对我有所帮助:
Recurring Bill Code Sample 经常性账单代码示例
So far, the following code snippet seems ok to implement as it has few configurations to set up and created a sandbox account to get it done:到目前为止,以下代码片段似乎可以实现,因为它需要设置的配置很少,并创建了一个沙盒帐户来完成它:
ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = new merchantAuthenticationType()
{
name = ApiLoginID,
ItemElementName = ItemChoiceType.transactionKey,
Item = ApiTransactionKey,
};
paymentScheduleTypeInterval interval = new paymentScheduleTypeInterval();
interval.length = intervalLength; // months can be indicated between 1 and 12
interval.unit = ARBSubscriptionUnitEnum.days;
paymentScheduleType schedule = new paymentScheduleType
{
interval = interval,
startDate = DateTime.Now.AddDays(1), // start date should be tomorrow
totalOccurrences = 9999, // 999 indicates no end date
trialOccurrences = 3
};
#region Payment Information
var creditCard = new creditCardType
{
cardNumber = "4111111111111111",
expirationDate = "1028"
};
I've a tricky requirement and one thing to confirm here.我有一个棘手的要求,还有一件事要在这里确认。 In the web app, if a user signs up in the website, then an amount of $1 will be charged with
Authorize.Net
api and if the user uses the website for more than three days after sign up, then it'll automatically redirect the user to a monthly subscription (So another fee will be charged here).在 web 应用程序中,如果用户在网站上注册,则将向
Authorize.Net
api 收取 1 美元的费用,如果用户在注册后使用该网站超过三天,则会自动重定向用户每月订阅(因此这里将收取另一笔费用)。
Is it something that can be handled with Authorize.Net
and for recurring bill, do I require to save user credit card details in the website's database or something similar?是否可以使用
Authorize.Net
处理,对于经常性账单,我是否需要将用户信用卡详细信息保存在网站的数据库或类似的东西中?
What you would want to do is:你想做的是:
Be sure to store their profile ID and payment profile ID for later reference.请务必存储他们的个人资料 ID 和付款资料 ID 以供日后参考。 You will need it to charge their first subscription payment and to create their subscription (you will need to trigger these from your website, most likely through an automated process).
您将需要它来收取他们的第一笔订阅费用并创建他们的订阅(您需要从您的网站触发这些,很可能是通过自动化过程)。 At some point you will also need to update their credit card information once it expires.
在某些时候,您还需要在到期后更新他们的信用卡信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.