0

The client is using PayPal Express for the payment gateway. When orders are placed, Paypal shows the ID for the order, not the Order Number. Is there somewhere I can change that?

  • Commerce 1 or 2-beta? – Luke Holder May 23 '18 at 2:13
  • Commerce v1.2.1362, sorry. – smartpill May 23 '18 at 12:31
  • I guess I also meant order.shortNumber since that's what appears in the Control Panel and on the order confirmation. – smartpill May 23 '18 at 13:25
1

Commerce V1 - You can use a hooks for this:

https://craftcommerce.com/docs/hooks-reference#commerce_modifygatewayrequestdata

or

https://craftcommerce.com/docs/hooks-reference#commerce_modifypaymentrequest

...basically, start by dumping all the data to look at what is being sent, then modify it as you need. Here's an example of something similar (I truncate the data to make sure it fits the gateway's limits):

    public function commerce_modifyGatewayRequestData($data,$type,$transaction){

        # Dump the data to see what is there....
        BusinessLogicPlugin::log("commerce_modifyGatewayRequestData"); 
        BusinessLogicPlugin::log("data");
        BusinessLogicPlugin::log($data);
        BusinessLogicPlugin::log("type");
        BusinessLogicPlugin::log($type);
        BusinessLogicPlugin::log("transaction");
        BusinessLogicPlugin::log($transaction);

        # TRUNCATE any over-sized data eWay might not like....
        # Data limits come from here: https://eway.io/api-v3/#direct-connection

       if(isset($data['Customer']['FirstName']))
        $data['Customer']['FirstName'] = substr($data['Customer']['FirstName'], 0, 49);

       ... etc

      return $data;
   }
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.