Question

I am attempted to create a new Sales Order in Netsuite using PHPtoolkip_v2010.php and add a authorization id to its payment method.

I can create the Sales Order and set the payment method to PayPal, but I am unable to set the AuthId. If I try to set the Transaction Id I'm successful, but as soon as I switch the code to do an auth it fails.

Here's a snippet of the code I'm trying:

$sales_order_data = array(
    'entity'=> new nsRecordRef(array('internalId' => $customer_id)),
    'tranDate'=>date('c', strtotime($order_date)),
    'itemList'=>array('item'=>array()),
);

//...

$sales_order_data['paymentMethod'] = array('internalId'=>7);

//$sales_order_data['payPalTranId'] = $paypal_transaction_id;
$sales_order_data['paypalAuthId'] = $paypal_transaction_id;

$sales_order = new nsComplexObject('SalesOrder', $sales_order_data);
$new_sales_order = $ns->add($sales_order);

If I get an existing Paypal order through the API and var_dump it I see the fields payPalTranId and paypalAuthId are set. Notice that the seconds P in Paypal is capitalized for the TranId but not for the AuthId. But I have tried both capped and uncapped for AuthId with no results.

Was it helpful?

Solution

It looks like what I wanted to do was impossible.

I've found this statement on from Celigo, a company that specializes in integrating Magento with Netsuite.

Both authorization and capture must be done on the Magento side. NetSuite does not facilitate capture of payments that have been authorized outside NetSuite. The NetSuite field that needs to be set to indicate the authorization status, ‘PayPal Status’, is read-only and thus cannot be set. The transaction cannot be processed unless this field is set.

While they don't explicitly state that I can't set the AuthId, my goal in doing so was to authroize the payment outside of Netsuite and capture within. If that's not possible, then setting the AuthId is pointless for me.

OTHER TIPS

Hope you got it straightened out and sucessfully. Did you try to enable the "Override PayPal Settings " field? I am trying to bring in PayPal information from external webstore and authid, looking at this field as reading your posting.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top