Ejemplo n.º 1
0
        public PurchaseCreate CreatePurchase(Domain.Models.SubscriptionCreate subscriptionModel)
        {
            (int recurringPayment, int remainderPayment) = (subscriptionModel.UnitAmount, Constants.QuarterlyPayment).RecurringAndRemainderPaymentCalc();
            var purchaseCreate = new PurchaseCreateBuilder()
                                 .BuildAccount(subscriptionModel.AccountCode)
                                 .BuildCollectionMethod()
                                 .BuildCurrency()
                                 .BuildSubscriptions(Constants.QUARTETLY_PLAN, recurringPayment);

            purchaseCreate = remainderPayment > 0 ?
                             purchaseCreate.BuildLineItems(remainderPayment, Constants.REMAINDER) :
                             purchaseCreate;
            return(purchaseCreate.GetPurchaseCreate());
        }
Ejemplo n.º 2
0
 public Subscription CreateSubscription(Domain.Models.SubscriptionCreate subscriptionModel)
 {
     return(client.CreateSubscription(_mapper.Map <Recurly.Resources.SubscriptionCreate>(subscriptionModel)));
 }