Multipayment Order processing / Refund - asp.net

I am working on an e-commerce application, currently my website is handling only one payment method either Credit card / BML or paypal,
Now i have to add another payment method i.e. Gift Card. Customer can pay order total from multiple payment methods. e.g
5 gift cards,
1 credit card and multiple gift cards etc
my current db structure is as follows
OrderTable
--------------------------------------------------
OrderID | OrderNumber | .. and many more columns
OrderPayment Table
-----------------------------------------------------------
ID | OrderID | Payment Mode (CC,Paypal,BML) | Amount |
these tables has one to one relation ship, now i need to split the payment mode to multiple payment modes. How i can achieve this by doing minimum changes to my existing architecture.
Secondly when an order is processed with multiple payment methods, how i can handle refunds in order (full refund, partial refund) that how i make sure that the exact amount is refund to the payment mode by which order is originally placed. e.g if customer place $100 order and pay $60 from credit card and $30 from one gift card and $10 from other gift card, when this order is refund how i refund the exact amount to CC and GC(s).

A separate solution could be to not see the gift card as a payment method, but rather as a coupon. That way the gift card would be subtracted from the total amount and you would still pay with just one payment method.
In the tools I use these are called Service Line Items (as apposed to product line items) which contain things like shipping costs, discounts, ... and one of the is a gift card.
This should make refunds easier as you will only have one payment in the end. That does mean you will need to create separate logic to refund the coupon.

Related

How to set Woocommerce Memberships discount OR coupon code to allow for a single freebie of every product?

I am using Woocommerce Memberships. We sell tickets to festival events. One of the perks of a specific level of membership is that you get 1 free to ticket to every event on offer. So if I had only three events (A, B & C), my members would be allowed 1 freebie ticket for each of the three but could purchase as many others as they like at the regular price.
I am not sure how to set this up either as a membership discount or a coupon...either would be fine. I would very much prefer not to have to make both free and paid versions of each event for simplicity, sanity, and recordkeeping purposes. Because they can buy multiples of each ticket, I can't set the price at Zero and limit them to one of each event.
Let's say each event cost $10. A fixed cart discount of $30 won't work, as they can only get 1 free ticket to each of the three events, and $30 off would allow 3 free entries to a single event. Nor can I limit their purchase of the events to 1 each with a cost of zero, as most will want to buy additional full price tickets to each event.
I might be overthinking things, but if anybody has a suggestion on how best to go about this, please share.

Can Dokan split out sales tax into a separate transaction?

We are currently running a marketplace using Dokan where all vendor/buyer transactions are handled by PayPal Express Checkout. Most of our user base is in California where tax rates vary between cities. WooCommerce tax settings are in place based on shipping address, but currently this gets tacked onto the money that the vendor receives, so they pocket the sales tax while we foot the bill out of our own pocket.
We have tried using the PayPal for WooCommerce Multi-Account Management plugin to send a flat percentage to our own PayPal account to deal with sales tax, but since this only allows a set percentage it is not suitable for California's infinite variety of tax rates, plus it incurs another transaction fee.
Is there any feasible way we can add sales tax to the total for the buyer, pay the vendor their share, and send the sales tax to our own PayPal account (with minimal or even no 2nd transaction fee)? If this is not possible with PayPal, is there any other payment provider that could do this & which could slot into Dokan with minimal hacking?
If you onboard every seller for multi-party payments including the third_party_details feature PARTNER_FEE (a necessary initial setup) -- then, for every transaction you can pass amount details including all item and tax information for display/transaction record purposes, and additionally include the tax amount you wish to collect as part of the partner_fee being deducted from what the seller receives and sent to you as the facilitator. This answer goes into more detail on that last part.

Woocommerce subscription: seperate tax rate, one for the signup fee and second for the recurring payment

We have a website that sells subscriptions.
The customer will get a physical product and then will be charged each month for the service.
We use WooCommerce Subscriptions plugin. We set the subscription product so the "Signup fee" will be used to charge for the physical device, and the subscription fee is for the service.
On some US states, the Tax for service and tangibles is different. For us it means different tax rate for the product (one time) and another tax rate for the recurring payment (service).
Since there is only one option to have Tax Class, I could not find a way to make it happen. Any ideas?
So...
The answer is to separate the subscription into two products. one as service and one as tangible.
We add the tangible on-the-fly.

Pay for multiple WooCommerce orders at once

I have a situation where my client want to the customers to place orders (almost reserve the product), but only pay for it after it reach the most economical postage point. They also want to discourage customers paying on an ad hoc basis as it will in crease their credit/debit card transaction fees.
Using a shipping class I can make it to 'Place the Order' instead of proceeding to payments, however is there a way I can allow customers to pay for multiple 'pending' orders at once?
See shippingeasy.com. They do it that way now. You can get a free account and poke around.

Additional payment on top of defined Plan in Stripe using asp.net

On Stripe is there any API where customer can pay additional charges along with the Plan amount within single transaction ?
Scenario is, total amount of charge is based on number of users. Means say 1 user has $100 need to charged and base plan amount is of $3000. While purchasing the license customer has to define number of users, say 5 (So 5*100=500) + 3000 (base plan amount) So total should be $3500 should pay within single transaction. number of users may varies. So how to code for Stripe for this scenario.
First, you would create your $100 plan and set the quantity depending on the number of users your customer currently has so that with a quantity of 5 he ends up paying $500. You can update the quantity and let Stripe handle the proration.
You would then use Invoice Items to change the amount you want to charge your customer on each billing cycle. Invoice items get added automatically to the customer's next invoice so that you could charge $3000 + $500 for example.
You would then have to use Stripe's webhooks to be notified about events that happen in your Stripe account. That way you can listen for the invoice.created event and create an invoice item for this invoice to change the amount billed to this customer.
In the end, here are the steps you'd follow:
Create a customer in Stripe with the card token.
Create the first $3000 Invoice Item for the first invoice since that one is always closed by default.
Create the subscription to the $100 monthly plan with the expected quantity. This will automatically bill the Invoice Item created before.
Each month, listen for the invoice.created event and create a new Invoice Item for $3000.
Another solution which some people find easier to build would be to use the quantity parameter of the subscription to charge a different amount to each customer. You would create a $1 monthly plan for example and set the quantity to 3100 for customers who pay only for one user ($3100) or 3500 for the ones with 5 users ($3500). This is also detailed in the subscriptions guide.

Resources