PHP Create order and Sale notification

I got the payment Id to work thanks to your sample above.
let me know if you need payment output to trouble troubleshoot why the payment is not connected to customer :slight_smile:

Good morning =)
Just following up to see if there’s any updates?
Thank you :slight_smile:

Have not heard from the customer’s team yet unfortunately, although today is a holiday and a lot of Square folks are offline for today. I’ll follow up as soon as I have more info, apologies for the delay.

1 Like

good afternoon =)
Is there a way I can call them? This is putting a hold on the website and sales & it’s been 10 days :confused:
Thank you so much in advance

Hi @Andrea apologies for the delay here, the team has been digging into this since last week. I just heard back from them, and the above payment it sounds like they were able to resolve the issue. Can you take a look on your side and ensure it now looks correct, and let us know if it happens again?

1 Like

Hi,

No. Issue is still not resolved. It does not connect/link contact to the transaction.
I tried a new transaction. Transaction ID/Payment ID:
famI2P3QNFnSx79Wl8t8DLVgOIaZY
9sneDOskZP8xN0UvfBlXHT2mgKNZY

Customer ID:
Q7VNT61AECT2HB8R3BZ9PX3E6G

I know for a fact the customer ID is produced successfully before processing the payment.
Anyway, here’s the code to submit payment:

$idempotency_key = uniqid();
$body = new \Square\Models\CreatePaymentRequest(
$nonce,
$idempotency_key,
$amount_money
);
$body->setAutocomplete(true);
$body->setOrderId($square_order_id);
$body->setCustomerId($square_customer_id);
$body->setLocationId($location_id);

$body->setShippingAddress($shipping_address);
$api_response = $client->getPaymentsApi()->createPayment($body);

I even weeks ago tried adding code and it still doesn’t do the trick: ā€œ$body->setReferenceId($square_customer_id);ā€

I have the entire output of creating payment let me know if you need it. Thanks in advance.

PS: in the payment output, I do see it has been added:
[referenceId:Square\Models\Payment:private] => [customerId:Square\Models\Payment:private] => Q7VNT61AECT2HB8R3BZ9PX3E6G

Thanks for sharing. So after discussing in detail with the Customers team, it seems there’s some inconsistent behavior here, but we’re still investigating and it sounds like full details (possibly a fix) won’t be available any time soon.

With that said, as a workaround, it seems if you set the customer_id in the Order object as well as the Payment object, the payment will correctly be associated to the right customer. Let me know if that doesn’t work for you either.

1 Like

You’re awesome. Absolutely amazing. I truly, truly appreciate your help with everything !!!

1 Like