Is there any option of refunding partially using CCAvenue with OpenCart?
For Example if a customer orders a product of Rs.1000/- and paid for it. In some
cases admin cancels the product and refunds the product on the following basis - first time he will refund Rs. 500/- second time Rs.300/- and the third time Rs.200/-. Is there any possibility to refund like described above.
Related
I have a sample loan usecase, where I have two states:
Invoice State, and
Loan State.
Loan State is created by passing Invoice State as input.
Now as Corda follows UTXO model, when I do the default vault query, the Invoice state is not showed as it's consumed now.
To solve this, there are two possible ways:
Either, I query on all states i.e consumed and unconsumed.
Or, I
can maintain a status at Invoice state and mark the status to
something as Invoice paid after consuming it to create Loan State (So this is more like evolving state, something like bitcoin where balance is always getting transferred.).
Something like this:
Can anybody please recommend what would be the correct architecture decision?
Your Invoice should have a 'state' field with and enum of at least 'UNPAID' and 'PAID'
Your 'payInvoice' command should have the following inputs and outputs:
inputs:
Invoice - state=UNPAID
outputs
Invoice - state=PAID
Loan
The verify function should check that the inputs and outputs for this command are as above.
After which the 'UNPAID' invoice state is spent and cannot be used again.
I hope that makes sense.
Check out the 'MeteringInvoiceCommands.Pay' method in the following code. This is similar to what you need, but in this case, it is checking that a payment is produced as well as the input state is 'ISSUED' and output state is 'PAID'
https://gitlab.com/cordite/cordite/blob/master/cordapps/metering-contracts-states/src/main/kotlin/io/cordite/metering/contract/MeteringInvoiceContract.kt
I agree with bartman250. The second example makes the most sense in my view as it keeps options open in a more obvious way.
Let's say for example, for some reason the invoice needs to be reset to unpaid because there is a chargeback on a credit card, having the invoice as unconsumed works well.
The issue of worrying about it being consumed again can be handled by ensuring that the loan contract only consumes invoices that are marked as unpaid. We do something very similar with a purchase order in the letter of credit demo found here.
Having the invoice available to be queried from the vault as unconsumed is also the default query mode. It also provides the advantage of ensuring we're dealing with the latest version of the state by default.
The second example above is the best in my view.
Basically, if you hold an Enum on the Invoice with all the different states - i.e. UNPAID, PAID, REJECTED etc. You can then evolve this state in your flows.
You can then use the contract verify function for the 'paid command to check that a loan state has been created.
I am currently building a Django application where visitors can buy an online course. I now want to implement the possibility to provide discount codes. As these discount codes should be limited by quantity I now have the following implementation idea:
Guest visits www.page.com?discount=TEST
The model discount contains the fields discount_codes & max qty. I will check here, if the code exists. Also, I have to count all entries in my order model that used the discount code TEST. My order model contains the foreign_key field 'redeemed_discounts').
As soon the user clicks on Pay (via Stripe) I'll once again count all the orders in my order model which contain 'TEST' to make sure, the 'max_qty' is not reached meanwhile.
Now I can charge the visitor.
Would you consider this as good implemented or do you see any problems with the way I am planning to do it?
instead of using max_qty why don't you use something like use_left and max_use
so whenever someone uses that code you can reduce the count accordingly and when count hits zero you can stop using that with this approach you don't have to scan order table every time to see if the coupon code is still available.
We do not want to limit the number of items a person orders. Our products are all priced the same based on size. The only way I have found to do this with Opencart is by giving them an item a price of zero and controlling the price by using options.
Our problem is a user can not purchase more than one of an item. This may or may not be related to the option condition mentioned above.
EXAMPLE: Say the product is a t-shirt and we want the size to be an option. The customer would choose a design then a size. Then quantity and checkout.
Model number is the design.
The price is based upon size.
PROBLEM: Customer is limited to one t-shirt per model. In order words they can not order two size smalls of the same design.
Your problem does have a solution. You can order more than 1 size of the same design. I see that your problem is when you add the item on your shopping bag. When you go to checkout/cart page, there is a quantity column where in you can modify the quantity of your order.
I am having trouble with my order processing for Opencart 1.5.6. I have a series of checkboxes that if checked each cost $50.00. The problem is that the customer is ordering print materials in quantities of 500, 1000, 5000, etc. When they get to the shopping cart it charges the $50 extra for each option for each individual item ordered based on the quantity. This makes it so that their total skyrockets. If they pick one option for $50 and order 500 business cards they get charged an extra $25,000 for that one option.
The only solution that I can see is to have the Quantity be an option and only allow them to order one product but that does not allow them to change the Quantity of cards in the Cart.
Is there anyway to set it up so that an option charges a flat rate not based on total quantity of the order?
When customizing OpenCart follow these steps.
Look to see if this link has an extension that will do what you want.
If step 1 did not work. Go to your public_html file (the place that has all your code). Open the files that are related to your problem and edit those. There is also an OpenCart forum that will help with common problems.
As far as changing the settings on your payment function. Go look at OpenCart->catalog->checkout folder. Or maybe OpenCart->admin->checkout. You will need to find the function that adds quantity and gives value. You will need to change those around a little.
Imagine a little webshop which uses its own currency.
In the database, there is a table for items, which can be bought. The count of each item is limited. This limit is stored in a collumn in this table as integer.
Also, there is a table for the user's cash accounts, whereas for each account the current balance is saved.
If, for example, two users conduct their purchases at the same time and only one item is available, it could be possible that both users pay but only one receives the item due to racing conditions.
How can such racing conditions be resolved, without relying on entity framework throwing exceptions on saving?
How can I ensure the count of available items and the account balance of the buyer is correctly updated?
This isn't really a problem specific to Entity Framework, it's applicable to just about any shop scenario. It comes down to a question of policy - the only way to ensure that two customers do not purchase the same item is to allow a temporary lock to be placed on that item when they add the item to the cart, or begin the checkout process, similar to how concert tickets or flights are sold. This lock would expire if the purchase is not completed within a set amount of time, and the item would be released back for other customers to purchase.
In an e-commerce setting, this is not as suitable, since people may add an item to their cart and not check out, or spend extra time choosing additional items. This may lead to the scenario where you have items for sale but they can't be bought because they're in someone's cart who's not planning on checking out. Instead, duplicate orders are allowed, but payments are typically only pre-authorised and then completed at the time of shipping or order confirmation, so even if the second customer enters all their details and presses Buy, their card wouldn't be charged since the item wouldn't be shippable.
You can implement checks at different stages during the Checkout process to ensure the items in the cart are still available, or at the simplest level, leave it for the final "Pay Now" button on the last page. Ultimately though, this just reduces the potential for the race condition, rather than eliminating it.