davidtsadler / ebay-sdk-php

An eBay SDK for PHP. Use the eBay API in your PHP projects.
Apache License 2.0
349 stars 341 forks source link

ReviseSellingManagerSaleRecord Issue #239

Closed olimortimer closed 5 years ago

olimortimer commented 5 years ago

I'm attempting to revise a sales record, by adding a NotesToSeller with an invoice number - I would use InvoiceNumber but this can only be retrieved via the eBay API, and not set...!

https://developer.ebay.com/devzone/xml/docs/reference/ebay/fieldindex.html#InvoiceNumber

NotesToSeller can be set, but when I try to, I receive an error: Indirect modification of overloaded property DTS\eBaySDK\Trading\Types\ReviseSellingManagerSaleRecordRequestType::$SellingManagerSoldOrder has no effect so I must be doing this incorrectly.

https://developer.ebay.com/devzone/xml/docs/reference/ebay/fieldindex.html#NotesToSeller

Would anyone know how I can set NotesToSeller please, using the ReviseSellingManagerSaleRecord call?

https://developer.ebay.com/devzone/xml/docs/reference/ebay/ReviseSellingManagerSaleRecord.html#Request.SellingManagerSoldOrder.NotesToSeller

    $request = new Types\ReviseSellingManagerSaleRecordRequestType();
    $request->OrderID = $order->OrderID;
    $request->SellingManagerSoldOrder->NotesToSeller = $invoice->InvoiceNumber;

    $request->RequesterCredentials = new Types\CustomSecurityHeaderType();
    $request->RequesterCredentials->eBayAuthToken = config('ebay.production.authToken');

    $response = $this->service->ReviseSellingManagerSaleRecord($request);

    dd($response);
michabbb commented 5 years ago

just a guess:

instead of

$request->SellingManagerSoldOrder->NotesToSeller = $invoice->InvoiceNumber;

try

$SellingManagerSoldOrderType = new \DTS\eBaySDK\Trading\Types\SellingManagerSoldOrderType();
$SellingManagerSoldOrderType->NotesToBuyer = $invoice->InvoiceNumber;
$request->SellingManagerSoldOrder = $SellingManagerSoldOrderType;
olimortimer commented 5 years ago

Fantastic, thank you!