In my current PHP process-card file I have:
use Square\SquareClient;
use Square\LocationsApi;
use Square\Exceptions\ApiException;
use Square\Http\ApiResponse;
use Square\Models\ListLocationsResponse;
use Square\Environment;
use Square\Models\Money;
use Square\Models\CreatePaymentRequest;
$client = new SquareClient([
'accessToken' => $access_token,
'environment' => Environment::PRODUCTION,
]);
$nonce = $_POST['nonce'];
$payments_api = $client->getPaymentsApi();
$money = new Money();
$money->setAmount(501);
$money->setCurrency('USD');
$create_payment_request = new CreatePaymentRequest($nonce, uniqid(), $money);
try {
$apiResponse = $payments_api->createOrder($location_id, $create_payment_request);
And this works fine. But I want to convert the transaction to an order.
I want to be able to assign a tracking number within my square account to the transaction (order). (All my square transactions will be for my ecommerce store)
QUESTION 1:
Is it even possible to sign in to square, view a transaction/order and assign a tracking number to it? This has to be added DAYS after the transaction has been made.
The only reason I Want to do this, is because I know with paypal when a customer files a dispute for a transaction that does not have any tracking number assigned to it, they tend to favor customer more.
QUESTION 2:
When it comes to converting the transaction to an order, Iām stuck with what to remove/change from the code above. What I found from online was:
$apiInstance = new SquareConnect\Api\OrdersApi();
$location_id = "location_id_example";
$order_id = "order_id_example";
$create_payment_request = new \SquareConnect\Model\UpdateOrderRequest();
try {
$apiResponse = $apiInstance->updateOrder($location_id, $order_id, $create_payment_request);
The problem is, this code above, conflicts with my CURRENT code at the top of this page.
Am I supposed to have them together? Or just one of them?
I mean the new code above does not even have a money AMOUNT in it :S
Also it says "update order. Iām trying to create a NEW one and add a custom amount and an order_id.
QUESTION 3:
When a sale has been made, I want to be notified. I do have a PHP file on my website that sends me an e-mail. Iām assuming where I should put this link in " Point of Sale API - Web Callback URLs" ?
So when ever somebody uses a browser regardless on PC or smartphone and buys something on my website, it should call that url ?
Thanks in advance!! =)