0
나는 사용자 정의 드루팔 module.The 오류에 2c2p 결제 API를 구현하고하는Drupal 모듈에 2c2p 결제 API를 통합하는 방법은 무엇입니까?
9002처럼 보여주고있다 : 결제 승인에 실패했습니다. URL을
.
여기에 제출할 몇 가지 코드가 있습니다.
$controller_data = $payment->method->controller_data;
// Get settings from controller data.
$merchant_id = $controller_data['msp_2c2p_id'];
$secret_key = $controller_data['msp_2c2p_secret'];
$url = $controller_data['msp_2c2p_mode'];
$version = $controller_data['msp_2c2p_version'];
$version = '6.7';
$payment_description = 'test payment';
$order_id = '00000000010000091203';
$invoice_no = $payment->pid;
$currency = '840'; //840 = USD, 104 = MMK
$customer_email = '[email protected]';
$pay_category_id = ''; // (Optional) Merchant’s predefined payment category code for reporting purpose. Merchant can manage predefined codes from the my.2c2p interface, section merchant report. ACCOUNT => Options => Predefined References Use PAYCATEGORYID value from “Ref Code” column to show “Reference Name” in the homepage sales volume graph.
$promotion = 'PROMO_VC';
$user_defined_1 = 'test1';
$user_defined_2 = 'test2';
$user_defined_3 = 'test3';
$user_defined_4 = 'test4';
$user_defined_5 = 'test5';
$result_url_1 = url(MSP_2C2P_PAYMENT_RETURN_PATH
. '/' . $payment->pid, array('absolute' => TRUE));
$result_url_2=url(MSP_2C2P_PAYMENT_RETURN_PATH
. '/' . $payment->pid, array('absolute' => TRUE));
$enable_store_card = 'N';
$stored_card_unique_id = '';//(Optional) Mandatory when payment is made by stored card
$pan_masked = '';
$request_3ds = 'Y'; //(Optional) Y – Do 3ds (default) F – Force 3ds (Only ECI 02/05 are accepted) N - Do not do 3ds
$recurring = 'N'; //(Optional) N – Not recurring (default) Y – Recurring transaction
$order_prefix = ''; //Note: if it is recurring payment, it is mandatory.
$recurring_amount = '000000199900'; //Example: THB (764)
$allow_accumulate = 'N'; //N – Not allow Y – Allow accumulate Note: if it is recurring payment, it is mandatory.
$max_accumulate_amount = '000000199900';//Note: if it is recurring payment, it is mandatory.
$recurring_interval = ''; //Note: If it is recurring payment, it is mandatory if charge_on_date is blank.
$recurring_count = ''; //Note: If it is recurring payment, it is mandatory
$charge_next_date = ''; //Note: If it is recurring payment, it is mandatory
$charge_on_date = ''; //Note: If it is recurring payment, either charge_on_date or recurring_interval is mandatory
$payment_option = 'A'; //By default, all available options (A) will be shown.
$ipp_interest_type = 'A'; //By default, all available options (A) will be shown
$payment_expiry = ''; //By default, 1-2-3 system will set the expiry according to merchant configuration.
$default_lang = 'en'; //ja – Japanese th – Thailand en – English (default)
$statement_descriptor = 'A23'; //Only allows alphanumeric in latin character
/**
* Calculate amount to pay.
*/
$amount = 0;
foreach ($payment->line_items as $line_item) {
$amount += (1 + $line_item->tax_rate) * $line_item->amount
* $line_item->quantity;
}
$payment_data = array(
//'amount' => $amount,
'amount' => '000000000100',
'description' => $payment->description,
);
$amount = $payment_data['amount'];
및
$strSignatureString = $version . $merchant_id . $payment_description . $order_id . $invoice_no . $currency . $amount . $customer_email . $pay_category_id . $promotion . $user_defined_1 . $user_defined_2 . $user_defined_3 . $user_defined_4 . $user_defined_5 . $result_url_1 . $result_url_2 . $enable_store_card . $stored_card_unique_id . $pan_masked . $request_3ds . $recurring . $order_prefix . $recurring_amount . $allow_accumulate . $max_accumulate_amount . $recurring_interval . $recurring_count . $charge_next_date . $charge_on_date . $payment_option . $ipp_interest_type . $payment_expiry . $default_lang . $statement_descriptor;
$data = array(
'version' => $version,
'merchant_id' => $merchant_id,
'payment_description' =>$payment_description,
'order_id' => $order_id,
'invoice_no' => $invoice_no,
'currency' => $currency,
'amount' => $amount,
'customer_email' => $customer_email,
'pay_category_id' => $pay_category_id,
'promotion' => $promotion,
'user_defined_1' => $user_defined_1,
'user_defined_2' => $user_defined_2,
'user_defined_3' => $user_defined_3,
'user_defined_4' => $user_defined_4,
'user_defined_5' => $user_defined_5,
'result_url_1' => $result_url_1,
'result_url_2' => $result_url_2,
'enable_store_card' => $enable_store_card,
'stored_card_unique_id' => $stored_card_unique_id,
'pan_masked' => $pan_masked,
'request_3ds' => $request_3ds,
'recurring' => $recurring,
'order_prefix' => $order_prefix,
'recurring_amount' => $recurring_amount,
'allow_accumulate' => $allow_accumulate,
'max_accumulate_amount' => $max_accumulate_amount,
'recurring_interval' => $recurring_interval,
'recurring_count' => $recurring_count,
'charge_next_date' => $charge_next_date,
'charge_on_date' => $charge_on_date,
'payment_option' => $payment_option,
'ipp_interest_type' => $ipp_interest_type,
'payment_expiry' => $payment_expiry,
'default_lang' => $default_lang,
'statement_descriptor' => $statement_descriptor,
'hash_value' => strtoupper(hash_hmac('sha1', $strSignatureString, $secret_key, false)),
);
$form['#action'] = $url;
//$form['#action'] = 'http://msp_2c2p.dd:8083/2c2ptest.php';
foreach($data as $name => $value) {
if (!empty($value)) {
$form[$name] = array('#type' => 'hidden', '#value' => $value);
}
}
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Pay with 2c2p'),
);
return $form;
}
내 코드에 어떤 잘못이 있습니까? 우리는이 링크를 사전에 2c2p developer doc 및 doc2 감사를 따르고 있습니다.
형제에, 내가? 이젠 문제가 상인 계정 및 비밀 키를 함께 통과 할 수 확인하십시오, 나는, BTW, 내가 진짜 MPU 또는 신용으로 테스트해야합니다을 찾아 와요 고마워요위한 상인 계정을 만들 요청 데모 모드에서 지불 할 계정 또는 데모 모드에 대한 mpu 또는 신용 계정 테스트 중 2c2p에서 응답을 테스트하려면 다음을 수행하십시오. –
데모 모드에서 리얼 카드로 테스트 할 수 있습니다. – saturngod