Last active
July 25, 2016 08:52
-
-
Save jimyhuang/75a93bb87295d9e248e5dea2a2b7b0ce to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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