Paypal and Braintree SDK How to add final discount

baecedrick
New Community Member

Hi,

 

I've been using Paypal with Braintree SDK since my country is not fully supported by Braintree. I want to add a final discount that will reflect in the invoice. My code is this

[
    "paymentMethodNonce" : "XXXXX_XXXX_XXXX_XXXX"
    "orderId" : "XXXX"
    "merchantAccountId" : "PHP"
    "discountAmount" : "100.00"
    "amount" : "180.00"
    "lineItems" : [
        [
            "name" : "Item Name",
            "description" : "Item Description",
            "kind" : "debit",
            "quantity" : "1",
            "unitAmount" : "135",
            "totalAmount" : "135"
        ],
        [
            "name" : "Item Name",
            "description" : "Item Description",
            "kind" : "debit",
            "quantity" : "1",
            "unitAmount" : "145",
            "totalAmount" : "145"
        ]
    ]
]

But paypay rejected it and returns error with the message "Paypal Verification Failed".

What I want is to apply the discount to the final total amount and not per line item.

 

Thanks in advance!

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.