Details
-
Type: New Feature
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 5.0.0-b1
-
Component/s: None
-
Labels:None
Description
The newer versions (2020-02-26 and above) are incompatible with the current set of parameters, however older versions are compatible with the new set. Update SquareApi::buildPayment to use the new set of parameters. change the code starting at line 151 of components/gateways/nonmerchant/square/lib/square_api.php from:
// Build payment parameters array
$params = [
'redirect_url' => $redirect_url,
'idempotency_key' => !empty($transaction_id) ? $transaction_id : $unique_id,
'ask_for_shipping_address' => isset($address),
'order' => [
'reference_id' => !empty($transaction_id) ? $transaction_id : $unique_id,
'line_items' => $line_items
],
'pre_populate_buyer_email' => $client_email
];
To
// Build payment parameters array $idempotency_key = !empty($transaction_id) ? $transaction_id : $unique_id; $params = [ 'redirect_url' => $redirect_url, 'idempotency_key' => $idempotency_key, 'ask_for_shipping_address' => isset($address), 'order' => [ 'idempotency_key' => $idempotency_key, 'order' => [ 'reference_id' => $idempotency_key, 'location_id' => $this->location_id, 'line_items' => $line_items ], ], 'pre_populate_buyer_email' => $client_email ];