Braintree Prorate amount is wrong - paypal

I have two plans.
The first one is 4.99€.
The second one is 9.99€.
When using prorate_charges = true option.
I pick the 4.99€ subscription, the transaction amount is 4,99 €.
Now I want to upgrade from the 4.99€ plan to the 9.99€ plan and apply the prorate charges. I should pay 5€ on day one since 9.99€ - 4.99€ but instead of paying 5€, braintree generate a transaction with an amount of 4,83 € and I don't know why. The billing cycle is set to one month but It looks like it calculate the proration without 1 day.

Related

How to sum multiple confitional dynamic ranges in Google sheet?

I use Google sheet to record my revenue for months, but recently I have some trouble.
I offer both post-paid and prepaid service, so I have some customers prepaid for more than one month, while post-paid service would be charged each month because it's usage-based. In short, I have to distinguish prepaid and postpaid service, and the billing date, then sum the total amount I need to bill my customers.
I used to use the formula that simply multiply the prepaid service amount of the first month by payment cycle (how many months he prepaid), but recently it starts to go wrong because the amount would be different in each month.
I do search for some articles about sum the dynamic range, but soonly find it hard to use because I have to select my column conditionally, and even with mutiple columns to sum.
The sample of my sheet:
https://docs.google.com/spreadsheets/d/1x0-1ckpoCB6XZJOqkEYZzoqUP49F-tdisrMXKbxZ4kk/edit?usp=sharing
So the problem is: How to sum with the conditional dynamic range for my prepaid services? Please do not hesitate to give me some suggetion on my sheet. Thank you!
try:
=INDEX(LAMBDA(d, h, aa, bi, cr, e, MAP(A2:A7, B2:B7, C2:C7,
LAMBDA(a, b, c, IFERROR(IF((b="1st")+(NOT(ISERROR(SEARCH(TEXT(e, "M/D"), b)))), SUM(
IFERROR(FILTER(FILTER(d, h>=EOMONTH(e, 0)+1, h<(EOMONTH(e, c)+1)), aa=a, OFFSET(aa,,1)=bi, FILTER(d, h=cr)=0)),
IFERROR(FILTER(FILTER(d, h<e, h>=(EOMONTH(e, -c-1)+1)), aa=a, OFFSET(aa,,1)=bi, FILTER(d, h=cr)=1))),
SUM(FILTER(FILTER(d, h<e, h>(EOMONTH(e, -c+1)+1)), aa=a, OFFSET(aa,,1)=bi, FILTER(d, h=cr)=1))), "no match"))))
('My raw data'!C$2:$15, 'My raw data'!C$1:$1, 'My raw data'!A$2:A$15, "Billing", "Criterian", B8))

Magento 1 create partial invoice for specific amount and not products

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

Recurring payments: how to specify an initial payment TAX value different than the subsequent cycles?

If I do a request with the INITAMT equal to the recurring payment amount, it works.
But if I try to bill a different INITAMT (and so different TAX), I get this error:
Tax calculation mismatch. The tax amount for the regular non-trial billing period is different than the sum of the tax for each item in the cart.
My actual request:
I have an initial payment of 4.84€ including 0.84€ of VAT tax.
The next month the amount to bill should be 25.09€ (including 6.09€ VAT).
The request I send is basically this:
Method: CreateRecurringPaymentsProfile
"CURRENCYCODE":"EUR",
"INITAMT":4.84,
"TAXAMT":0.84,
"DESC":"Subscription",
"BILLINGPERIOD":"Month",
"BILLINGFREQUENCY":1,
"AMT":29,
"L_PAYMENTREQUEST_0_ITEMCATEGORY0":"Digital",
"L_PAYMENTREQUEST_0_NAME0":"Subscription",
"L_PAYMENTREQUEST_0_AMT0":29,
"L_PAYMENTREQUEST_0_TAXAMT0":6.09,
"L_PAYMENTREQUEST_0_QTY0":1
"PROFILEREFERENCE":"51a1f8f4732baf580a000031",
"PAYMENTREQUEST_0_INVNUM":"51a1f8f4732baf580a000031",
"INVNUM":"51a1f8f4732baf580a000031",
"PROFILESTARTDATE":"2013-06-26T11:59:12+0000",
And the response:
"TIMESTAMP":"2013-05-27T10:55:46Z",
"CORRELATIONID":"969d07e2cef8a",
"ACK":"Failure",
"VERSION":"74",
"BUILD":"5908853",
"L_ERRORCODE0":"10004",
"L_SHORTMESSAGE0":"Tax calculation mismatch.",
"L_LONGMESSAGE0":"Tax calculation mismatch. The tax amount for the regular non-trial billing period is different than the sum of the tax for each item in the cart.",
"L_SEVERITYCODE0":"Error"
I'd like to do this with the INITAMT value, so that the user can see the two purchases as correlated in the Paypal private area (ie: a subscription with an inital payment).
Otherwise I'll have to do a separate DoExpressCheckout for the initial payment.
What's happening is that you cannot (I believe) set a tax amount for the Initial Amount.
The TAXAMT is for the recurring payment, not the Initial Amount.
Your statement is saying "Billing 29€ with a tax of 0.84€".
However your item list says the tax should be 6.09€
Change your TAXAMT to 6.09€ and it should be fine.

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).