0

クライアント向けのサイトを開発していますが、要件の 1 つは、購入プロセスに worldpay の支払いを統合することです。

ユーザーが製品の支払いを完了したら、ライセンス システムに支払いの完了を知らせる必要があります。worldpay のドキュメントには、支払い応答サービスの概要が記載されていますが、コード例は記載されていません。

テスト インストールでクライアントに支払い応答オプションを設定してもらいましたが、他の誰かが既に行っている場合は、応答を処理するために自分のページをコーディングする必要はありません。良いコード例 (php) へのリンクを持っている人はいますか?? 私はオンラインでまともな外観を持っていましたが、あまり現れていません。

ありがとう!

4

4 に答える 4

4

問題が解決しました。最終的に、worldpay からの応答を処理するカスタム クラスを作成しました。これは、他の誰かが役に立つと思われる場合に備えて、私のハンドラー ページの簡略版です。

(注: 私は実際には PHP 開発者ではないので、一部の構文は少し怪しいかもしれません!)

<?php //Worldpay 

// class definition
class WorldPay_Response {
    // define properties
    public $transaction_id = null;
    public $transaction_status = null;
    public $transaction_time = null;
    public $authorisation_amount = null;
    public $authorisation_currency = null;
    public $authorisation_amount_string = null;
    public $raw_auth_message = null;
    public $raw_auth_code = null;
    public $callback_password = null;
    public $card_type = null;
    public $authentication = null;
    public $ip_address = null;
    public $character_encoding = null;
    public $future_payment_id = null;
    public $future_payment_status_change = null;

    //custom properties not included by worldpay
    public $mc_custom_property = null;

    // constructor
    public function __construct() {
        $this->transaction_id = $_POST['transId'];
        $this->transaction_status = $_POST['transStatus']; //should be either Y (successful) or C (cancelled)
        $this->transaction_time = $_POST['transTime'];
        $this->authorisation_amount = $_POST['authAmount'];
        $this->authorisation_currency = $_POST['authCurrency'];
        $this->authorisation_amount_string = $_POST['authAmountString'];
        $this->raw_auth_message = $_POST['rawAuthMessage'];
        $this->raw_auth_code = $_POST['rawAuthCode'];
        $this->callback_password = $_POST['callbackPW'];
        $this->card_type = $_POST['cardType'];
        $this->country_match = $_POST['countryMatch']; //Y - Match, N - Mismatch, B - Not Available, I - Country not supplied, S - Issue Country not available
        $this->waf_merchant_message = $_POST['wafMerchMessage'];
        $this->authentication = $_POST['authentication'];
        $this->ip_address = $_POST['ipAddress'];
        $this->character_encoding = $_POST['charenc'];
        $this->future_payment_id = $_POST['futurePayId'];
        $this->future_payment_status_change = $_POST['futurePayStatusChange'];

        //custom properties
        $this->mc_custom_property = $_POST['MC_custom_property'];

    }
}

?>
<html>
<head><title>Thank you for your payment</title></head>
<WPDISPLAY FILE="header.html">

<?php
//Response from Worldpay
$wp_response = new WorldPay_Response();


    if($wp_response->transaction_status == "Y"){ ?>

            <strong>Transaction Details</strong><br />
     <?php
            echo "Worldpay Transaction id: " . $wp_response->transaction_id . "<br />";
            echo "Payment Status: " . $wp_response->transaction_status . "<br />";
            echo "Transaction Time: " . $wp_response->transaction_time . "<br />";
            echo "Amount: " . $wp_response->authorisation_amount_string . "<br />";
            echo "IP Address: " . $wp_response->ip_address . "<br /><br />"; 
        }else if($wp_response->transaction_status == "C") { ?>
            <strong>Transaction Cancelled</strong>
<?php } else { ?>
        Your transaction was unsuccessful.
<?php } ?>
<WPDISPLAY ITEM="banner">
<WPDISPLAY FILE="footer.html">
</html>
于 2011-12-29T10:56:48.033 に答える
2

Google 検索からこれを読んでいる他の方は、re: worldpay Payment response を参照してください。

2015 年 3 月:

私はクライアントのために worldpay オンライン決済システムをセットアップしていますが、ひどいものです。彼らは2011年に平凡なシステムを作り、それ以来それを更新することを気にしませんでした. それは退屈で、コード例とドキュメントには多くの要望が残されています。

Worldpay は依然としてMD5()「高度に安全な暗号化方法」としてハッシュを使用しており、使用されなくなったさまざまなリソースやサーバーの概念を参照しています。実用的なプログラミングの観点から、WORLDPAY は使用しないでください。

.html彼らは動的支払いを処理するためのドキュメントを持っておらず、動的コードを出力するために顧客を私のウェブサイトに送り返すのではなく、表示するファイルを送信することで各支払いが完了することを期待しています.

この作業の後、私は決して WorldPay に触れませんでしたが、私のクライアントはサインアップのために既に支払いを済ませているので、私は彼のためにこれを実装する必要があります。:-/

彼らの顧客サービス(英国)も非常に貧弱です.

于 2015-03-27T11:43:25.030 に答える
0

ペイパルによく似ています。基本的にサーバー<>サーバーのもの。彼らはここに9ヤードあります。http://www.worldpay.com/support/kb/bg/pdf/custa.pdf本格的な購入サービス センターをお探しですか? b/c 簡単な通知で受信するだけで 1 ページ程度です。グーグルにはオープンソースのものがあります。http://code.google.com/p/opencart/source/browse/trunk/upload/catalog/language/english/payment/worldpay.php?spec=svn694&r=694 . google worldpay.php だけです。何かを見つけたら、お知らせください。私たちはクライアントにWORLDPAYを提供することを検討しています。過去5年間で彼らがどのように変化したか。

于 2011-12-28T09:58:23.063 に答える