Hi
This may be user misunderstanding… I am trying to implement a quick pay link for our website in the Sandbox. I’ve tried the data in the API tester and it gives me a result, but when I try it on my server, it returns a private array and any attempt to access it gives the error “Uncaught Error: Cannot access private property Square\Models\CreatePaymentLinkResponse”
My code is below (I’ve hidden the location id):
$price_money = new \Square\Models\Money();
$price_money->setAmount(3800);
$price_money->setCurrency(‘GBP’);
$quick_pay = new \Square\Models\QuickPay(
‘Tickets x 2’,
$price_money,
‘xxxxxxxxxxxxx’
);
$checkout_options = new \Square\Models\CheckoutOptions();
$checkout_options->setAllowTipping(false);
$checkout_options->setAskForShippingAddress(false);
$checkout_options->setEnableCoupon(false);
$checkout_options->setEnableLoyalty(false);
$sik = ‘tct-’.uniqid();
$body = new \Square\Models\CreatePaymentLinkRequest();
$body->setIdempotencyKey($sik);
$body->setDescription(‘Tickets’);
$body->setQuickPay($quick_pay);
$body->setCheckoutOptions($checkout_options);
$api_response = $client->getCheckoutApi()->createPaymentLink($body);
I get a full response, headed by:
[errors:Square\Models\CreatePaymentLinkResponse:private] =>
Any assistance gratefully received
Martin