2012-03-22 5 views
0

私は不足することなく、商人支払いゲートウェイをubercartに統合する方法を2日間探してきました。そこで私はここでそれを尋ねることにしました。ubercartでサードパーティの商人支払いゲートウェイを統合する方法

私は私の商人からの例として、次のコードを持っている:

<form name="payFormCcard" method="post" action=" https://test.MyMerchantGateway.com/ECN/eng/payment/payForm.jsp"> 
<input type="hidden" name="merchantId" value="1"> 
<input type="hidden" name="amount" value="3000.0" > 
<input type="hidden" name="orderRef" value="000000000014"> 
<input type="hidden" name="currCode" value="608" > 
<input type="hidden" name="successUrl" value="http://www.yourdomain.com/Success.html"> 
<input type="hidden" name="failUrl" value="http://www.yourdomain.com/Fail.html"> 
<input type="hidden" name="cancelUrl" value="http://www.yourdomain.com/Cancel.html"> 
<input type="hidden" name="payType" value="N"> 
<input type="hidden" name="lang" value="E"> 
<input type="submit" name="submit"> 
</form> 

私はセキュリティ上の理由のために上記の実際のドメインを変更することに注意してください。チェックアウトはhttps://test.MyMerchantGateway.com/ECN/eng/payment/payForm.jsp

答えて

1

にリダイレクトされた後、あなたは(あなたのDrupalサイトへの外部)オフサイトの支払いをしたいように見えるので、あなたの支払いモジュールでは、あなたが支払いを記述する必要があります私は何をしたい

function my_pay_gateway_uc_payment_method() { 
    $methods[] = array(
    'id' => 'my_pay_credit', 
    'name' => t('My Payment Gateway'), 
    'title' => t('My Payment Gateway'), 
    'desc' => t('Pay through my payment gateway'), 
    'callback' => 'my_payment_method', 
    'redirect' => 'my_payment_form', // <-- Note the redirect callback provided 
    'weight' => 1, 
    'checkout' => TRUE, 
); 
    return $methods; 
} 

を次にあなたが好き必要なすべての情報を含めてお支払いゲートウェイにリダイレクトするため送信ボタンをの後ろに座ってフォームを構築するためにリダイレクトコールバックにコードを追加する必要がありますので、同じようにリダイレクトする方法:

詳細について
function my_payment_form($form, &$form_state, $order) { 

    // Build the data to send to my payment gateway 
    $data = array(
    'merchantId' => '1', 
    'amount' => '3000.0', 
    'orderRef' => '000000000014', 
    'currCode' => '608', 
    // You can fill in the rest... 
); 

    // This code goes behind the final checkout button of the checkout pane 
    foreach ($data as $name => $value) { 
    if (!empty($value)) { 
     $form[$name] = array('#type' => 'hidden', '#value' => $value); 
    } 
    } 

    $form['#action'] = 'https://test.MyMerchantGateway.com/ECN/eng/payment/payForm.jsp'; 
    $form['actions'] = array('#type' => 'actions'); 
    $form['actions']['submit'] = array(
    '#type' => 'submit', 
    '#value' => t('Submit Orders'), 
); 
    return $form; 
} 

http://nmc-codes.blogspot.ca/2012/07/how-to-create-custom-ubercart-payment.html

+0

で私のブログの記事を参照してくださいNMCありがとうございます。私はあなたのコードを正常に実装しました。約$ form ['#action'] = 'https://test.MyMerchantGateway.com/ECN/eng/payment/payForm.jsp';私はいくつかの値を追加URLを追加するURLを追加します。例:https://test.MyMerchantGateway.com?id=111、name = "ex .......これらの値はすべてレビューページに既に表示されていますが、これらの値を取得する方法はわかりますか?投稿:http://stackoverflow.com/questions/34348089/array-how-to-retrieve-value – peifa

関連する問題