Magento 1 create partial invoice for specific amount and not products - paypal

For a Magento order, after the order has been placed and a Payflow payment has been authorized, I want to be able to add a charge to the order. I could capture a different amount from the one authorized but this brings in the limitation issue because for Paypal amount captured can only be 15% above/below the amount authorized. In order to overcome this issue, I want to allow the user to be able to pay separately for the remaining charge. However, when the user tries to pay for the rest using the Payflow credit card again, a full invoice is created which results in the cancellation of the current order and creation of new order with order id xxx-1.
What I want is to have multiple invoices for the same order and I believe this can be done usig partial invoices like so:
if($order->canInvoice()) {
$invoiceId = Mage::getModel('sales/order_invoice_api')
->create($order->getIncrementId(), $itemsarray ,'your_comment' ,1,1);
}
But how do I create a partial invoice for a given price that is not related to any items?

how do I create a partial invoice for a given price that is not related to any items?
Specify your own new $itemsarray replacement, that contains a single line item that describes the charge for a given price

Related

Is it possible to override the tax calculated by Quickbooks Desktop when using IDS to POST an Invoice?

We are integrating our order management application with Quickbooks Desktop using IDS. We are finding that the tax calculated by our application is different by a few pennies to the tax calculated by Quickbooks. Is there any way to override the tax calculated by Quickbooks when we do an Invoice POST?
Normally, you would set the items as non-taxable and then add a line item that references the tax item and you can set the amount when added. However, it looks like IDS is NOT writing back the Taxable field in v2 (Cannot be written to QuickBooks.)
You should be able to change the tax code on the item to no-tax and then use the TaxLine to add the tax at the value you want.
William

How to add dynamic discount amount for one coupon in Magento

How to set dynamic discount amount if an coupon is applied.
For this i have created a shopping cart price rule and send this promo coupon to some customers and when they purchase products from my site and applied this coupon every customers get different discount amount based on the products in their shopping cart so how i can set this dynamic discount amount ?
I have already make some research on salesrule/rule module but getting confused so please help me...
Just for some your knowledge or someone needy finally i have found solution for my question for dynamic discount amount.
to achieve this you need to change in two methods first one is process(Mage_Sales_Model_Quote_Item_Abstract $item) under Mage_SalesRule_Model_Validator class in which you need to change the rule discount amount and set it to any dynamic calculated value like
$rule->setDiscountAmount($dynamicDiscountAmount);
and in the collect method just update the discount amount for display purpose in totals block
$address->setDiscountAmount(-$discountAmount);
$address->setBaseDiscountAmount(-$discountAmount);

Pass variable cart total to PayPal for Subscription (using Enhanced Recurring Payments w. Website Payments Standard)

Summary: Trying to pass along a variable Monthly Subscription cost to PayPal based on user-selected options on a form I created. Working within Website Payments Standard with Enhanced Recurring Payment option, is this possible?
Details:
User visits "shop" page, which is a form with 4 line items, each line item consisting of 2-7 options, each option with an associated price.
For example, line item 1 is "size of business" with the options being:
a) 1-3 employees - $10
b) 4+ employees - $12.50
User goes through the list and chooses 1 option for each line item and some javascript calculates the total due on the fly.
Is it possible to pass this total to PayPal, not as a one-time cost, rather as the base cost for a monthly subscription?
Yes. Just change the value you're passing for a3, rather than amount.
Is there a problem you're running into?

Paypal IPN using PHP to get customized Quantity and Amount

I have downloaded the sample paypal IPN script using php and customised with the email for the buyout option and it has also some hidden paramaters such as amount, quantity,return_url, notify_url like this. My main idea is to do the buyout option for the product purchase in my website.The current calculation for the product purchase is as follows:
Item Price:$20
Quantity :10
Total amount $200
I need the calculation to some different way as our site have some static set of quantities and prices, so our point of calculation is as follows:
Item Price:$20
Quantity :10
Total amount:$20
So, the total amount needs to be the same for the given number of quantities.The IPN configuration doesn't allow me to change the quantity field by this way, please suggest some ideas to overcome this issue.
The item price is price per item, the quantity is of course multiplied by the item price. Your second example should have $2 as the --Item-- price. If you want to sell "10 items for $20", I think you will need to make a new item for that combo and just but the actual quantity in a custom field.
If you want to use the same item and paypal's quantity field, I think you need to look into calculating a discount and making that part of the parameters (discount_amount_cart or discount_amount_X for item X I think).

Paypal Discount When purchasing two + items (not two instances of same object)

Paypal has listed out methods for discounts such as :
discount_amount
Optional
Discount amount associated with an item.
It must be less than the selling price of the item. If you specify discount_amount and discount_amount2 is not defined, then this flat amount is applied regardless of the quantity of items purchased.
Valid only for Buy Now and Add to Cart buttons.
discount_amount2
Optional
Discount amount associated with each additional quantity of the item.
It must be equal to or less than the selling price of the item. A discount_amount must also be specified as greater than or equal to 0 for discount_amount2 to take effect.
Valid only for Buy Now and Add to Cart buttons.
I understand that you can have a discount associated with the amount of the same object inside of the cart. I'm wondering if anyone knows a way or method to allow a discount to show up if you say add 3 items or 5 items. Basically the situation is users have the option of signing up for either 1-4 courses. If a user signs up for 1 normal price(lets say 30) occurs. If a second is added they would receive a 10 dollar discount on the tuition(50). Than if a third is added it would show up as the regular method (resulting in 90) However if a fourth is added it would be a charge of 3 courses plus 50. (95). Is there any solution to presenting this to paypal to update based on amount of items (each being different items[different course dates and names]) included in your cart?
If it's for the whole cart and not just the item use discount_amount_cart
Remember discount_amount_1 has to be less in value than amount_1