function pay_method_gateway::execute in Pay 6
Same name and namespace in other branches
- 7 includes/handlers/pay_method_gateway.inc \pay_method_gateway::execute()
2 calls to pay_method_gateway::execute()
- pay_method_gateway::authorize_action in includes/
handlers/ pay_method_gateway.inc - Effect an 'authorize' gateway transaction. If successful, the transaction state will be set to 'active' and the authorization history will be stored in our records.
- pay_method_gateway::complete_action in includes/
handlers/ pay_method_gateway.inc - Complete a transaction. For new transactions, this means creating an AUTH_CAPTURE request. For existing ones, capture a preauthorization.
File
- includes/
handlers/ pay_method_gateway.inc, line 128 - The base class for credit card payment activities.
Class
- pay_method_gateway
- @file The base class for credit card payment activities.
Code
function execute($activity) {
if ($request = $this
->gateway_request()) {
$ret = drupal_http_request($this
->gateway_url(), $this
->gateway_headers(), 'POST', $request);
if ($ret->error) {
watchdog('payment', "Gateway Error: @err Payment NOT processed.", array(
'@err' => $ret->error,
));
$this->activity->data = (array) $ret;
$this->activity->result = FALSE;
}
else {
$this->activity->result = $this
->gateway_response($ret->data);
}
// Return TRUE or FALSE on success/failure.
return $this->activity->result == 1;
}
}