Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
civicrm_initialize();
$pid = 1; // payment processor id from system
$payment_processor = CRM_Core_BAO_PaymentProcessor::getPayment($pid, 'live');
$contribution_trxn_id = 'ABCDE12345';
if($payment_processor['payment_processor_type'] == 'ALLPAY' || $payment_processor['payment_processor_type'] == 'ALLPAYX'){
if(!empty($payment_processor['url_recur']) && !empty($payment_processor['user_name'])){
$processor = array(
'password' => $payment_processor['password']
'signature' => $payment_processor['signature'],
);
$post_data = array(
'MerchantID' => $payment_processor['user_name'],
'MerchantTradeNo' => $contribution_trxn_id,
'TimeStamp' => time(),
);
_civicrm_allpay_checkmacvalue($post_data, $processor);
$json = FALSE;
$response = _civicrm_allpay_postdata($payment_processor['url_api'], $post_data, $json);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment