Announcement

Collapse
No announcement yet.

Payment Method Name in FulfillmentModule_ProcessOrder function

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Payment Method Name in FulfillmentModule_ProcessOrder function

    Hi,

    I've been trying to get the name of payment method associated with the order in "FulfillmentModule_ProcessOrder" function. I tried with pay_data field, but when the order is made through some online method, It has much more information than I need except name, and when it is placed via some offline payment module, it has nothing in it.

    Miva shows that name at plenty of places like emails, batch reports etc, so there must be some sure way around to get that information from order. Could anyone point me to the direction from where can I get that name ?

    I am not after the details that were used to place the order, just looking to get the name of the method that was used.
    Rajnish Sinha
    ---------------------
    https://twitter.com/rajnishsi

    #2
    FulfillmentModule_ProcessOrder only has two parameters, module and order.

    The order var doesn't have the payment info in it, so you'll need to do a lookup.
    Take the order:id and use it to lookup the OrderPayments record
    Then take the orderpayments:pay_id and look up the payment module in Modules. The modules:name field is what you want.
    Gordon Currie
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit Any Document Easily | Free Modules | Follow Us on Facebook
    phosphormedia.com

    Comment


      #3
      Hi Gordon,

      Thanks for the help, it gave me the name of the module responsible for that payment method. But I am after the name of the payment method that is shown in the invoice page.
      e.g., for card payments, it gave me Authorise .NET as the name of the method, but I'm looking for the name of the method like Amex, Discover. Any pointers on that ?
      Rajnish Sinha
      ---------------------
      https://twitter.com/rajnishsi

      Comment


        #4
        Sorry to send you down a rabbit hole! The correct data you want is in the orderpayments:paydata field. Be aware that the data is usually serialized, so do miva_array_deserialize() on it. It will look like AMEX/VISA/MCRD/PAYP etc.

        I'm not sure if the string 'Mastercard' is stored anywhere (outside of the payment module itself).
        Last edited by Gordon - Phosphor Media; 03-21-16, 04:45 PM.
        Gordon Currie
        Phosphor Media - "Your Success is our Business"

        Improve Your Customer Service | Get MORE Customers | Edit Any Document Easily | Free Modules | Follow Us on Facebook
        phosphormedia.com

        Comment


          #5
          Hi Gordon,

          Thanks very much for all your help, I worked with pay_data field and it gave me the complete name of the card being used. It gave me strings like Visa, MasterCard etc.

          Thanks again,
          Rajnish Sinha
          ---------------------
          https://twitter.com/rajnishsi

          Comment

          Working...
          X