realexpayments / rxp-hpp-php

Please use our new PHP SDK: https://github.com/globalpayments/php-sdk
MIT License
13 stars 42 forks source link

Setting Customer Name #13

Open alanburke opened 6 years ago

alanburke commented 6 years ago

Perhaps I'm mistaken, but it doesn't seem possible to set Customer Name on a HppRequest object?

oliverfrodrigues commented 6 years ago

Hello, did you ever got this sorted ? I need to pass Customer Name / Variable Ref / Product ID / Comment 1 and 2

EDIT: just got it working (except for Prod ID, I will raise another issue for that)

$hppRequest = (new HppRequest()) ->addMerchantId($merchantId) ->addAccount("internet") ->addAmount($amount * 100) // realex takes the amount with no decimals ->addCurrency($currencyId) ->addAutoSettleFlag(TRUE) ->addSupplementaryData($supData) ->addCustomerNumber($MembershipNumber) ->addShippingCountry($CountryId) ->addBillingCountry($CountryId) ->addCommentOne($EmailAddress) ->addCommentTwo($CustomerName) ->addVariableReference($InvoiceId) ->addTimeStamp(date('YmdHis'));

rxp-developers commented 6 years ago

@alanburke, @oliverfrodrigues

The customer's first and last name can be added using Supplementary Data.

$supplementaryData = array("HPP_CUSTOMER_FIRSTNAME" => "James", "HPP_CUSTOMER_LASTNAME" => "Mason"); $hppRequest->addSupplementaryData($supplementaryData);

For Variable Ref, Product ID and Comment 1 & 2 the request object has methods required for all of those.