function _commerce_sagepay_array_to_post in Drupal Commerce SagePay Integration 7
Convert a data array to a single string ready to post.
Parameters
array $data: The data array.
Return value
string The array as a string.
11 calls to _commerce_sagepay_array_to_post()
- commerce_sagepay_abort_transaction in includes/
commerce_sagepay_abort.inc - commerce_sagepay_authorise_form_submit in includes/
commerce_sagepay_authorise.inc - Submit handler: process a prior authorization capture.
- commerce_sagepay_cancel_transaction in includes/
commerce_sagepay_cancel.inc - commerce_sagepay_paypal_handle_callback in modules/
commerce_sagepay_paypal/ includes/ commerce_sagepay_paypal.inc - Handle a POST callback from Pay Pal to confirm the transaction.
- commerce_sagepay_refund_form_submit in includes/
commerce_sagepay_refund.inc - Submit handler: process a refund request.
File
- includes/
commerce_sagepay_utils.inc, line 244 - commerce_sagepay_utils.inc Common utilities shared by all Integration methods.
Code
function _commerce_sagepay_array_to_post($data) {
$post = '';
foreach ($data as $name => $value) {
$post .= urlencode($name) . '=' . urlencode($value) . '&';
}
// Chop off the last &.
$post = substr($post, 0, -1);
return $post;
}