Score:0

How do I get the total amount when creating a payment method at checkout(Gateway Plugin)?

ca flag

This is for a gateway plugin that I am developing. This is when the user is checking out and entering payment information, etc.

My Process When the paymentMethodAddForm is submitted I create a transaction with the status of 'HOLD'. The user is then presented with a "review" form. When the review form is submitted the transaction is updated with a status of 'CAPTURE'.

The Issue I need to submit the HOLD transaction with the actual price they will pay. If I set a generic price value it will be declined if it is not within 30% of the original amount of the hold. I do not know how to retrieve the total amount.

Can someone please tell me how to retrieve the total amount within the function: createPaymentMethod(PaymentMethodInterface $payment_method, array $payment_details)

I would really appreciate some direction. I have been stuck for a while now.

Thanks!

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.