Beste mensen ik heb een oscommerce webshop met een ideal lite module.
Alles werkt maar als ik wilt gaan betalen krijg ik deze error:
Digitale handtekening is niet geldig
Dit houd dus in dat mijn SHA1 Hash niet goed is maar ik weet niet wat eraan fout is
In mijn mail krijg ik dit
Geachte klant,
In het iDEAL Lite betalingsverzoek hebben wij één of meer fouten geconstateerd:
Datum: Nov 17, 2009 10:26:20 PM
Request parameters: &catalogurl=http://site.com/webshop/index.php&subID=0&urlError=http://site.com/webshop/checkout_process.php?part=2&CN=klantnaam&exceptionurl=http://site.com/webshop/checkout_process.php?part=2&itemDescription1=ARTIKEL¤cy=EUR&urlCancel=http://site.com/webshop/checkout_process.php?part=2&language=nl&owneraddress=straat 2&itemQuantity1=1&hash=bc89c4ce585803271eef75fe480ecdfbd78ebeeb&merchantID=000000000&amount=200&paymentType=ideal&urlSuccess=http://site.com/webshop/checkout_process.php?part=2&COM=Een bestelling bij www.site.com/webshop. Klant #: 8&purchaseID=091117222620&description=Order webwinkel&validUntil=2009-11-24T22:26:20Z&email=[email="20Z&email=test@gmail.com&itemNumber1"]test@gmail.com&itemNumber1[/email]=1234&itemPrice1=200&ownerZIP=5345FG
(Wegens privacy redenen site en merchantID wegelaten)
Ideal_lite.php betaalmodule in oscommerce
Alles werkt maar als ik wilt gaan betalen krijg ik deze error:
Digitale handtekening is niet geldig
Dit houd dus in dat mijn SHA1 Hash niet goed is maar ik weet niet wat eraan fout is
In mijn mail krijg ik dit
Geachte klant,
In het iDEAL Lite betalingsverzoek hebben wij één of meer fouten geconstateerd:
Datum: Nov 17, 2009 10:26:20 PM
Request parameters: &catalogurl=http://site.com/webshop/index.php&subID=0&urlError=http://site.com/webshop/checkout_process.php?part=2&CN=klantnaam&exceptionurl=http://site.com/webshop/checkout_process.php?part=2&itemDescription1=ARTIKEL¤cy=EUR&urlCancel=http://site.com/webshop/checkout_process.php?part=2&language=nl&owneraddress=straat 2&itemQuantity1=1&hash=bc89c4ce585803271eef75fe480ecdfbd78ebeeb&merchantID=000000000&amount=200&paymentType=ideal&urlSuccess=http://site.com/webshop/checkout_process.php?part=2&COM=Een bestelling bij www.site.com/webshop. Klant #: 8&purchaseID=091117222620&description=Order webwinkel&validUntil=2009-11-24T22:26:20Z&email=[email="20Z&email=test@gmail.com&itemNumber1"]test@gmail.com&itemNumber1[/email]=1234&itemPrice1=200&ownerZIP=5345FG
(Wegens privacy redenen site en merchantID wegelaten)
Ideal_lite.php betaalmodule in oscommerce
PHP: ideal_lite.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
| <?php /* $Id: ideal_lite.php,v 1.3 2006/06/27 00:00:00 Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License Johan Velthuizen Velthuizen Webdesign Ideal Lite contributie v.1.3 modifications by Jeroen de Grebber - j.p.degrebber@gmail.com Felix Scheiffers, NL - Oct. 2007 - 'First order than payment' contribution support added */ class ideal_lite { var $code, $title, $description, $enabled, $form_action_url, // FS - 'First order than payment' - START $icon, $order_id; // FS - 'First order than payment' - STOP // class constructor function ideal_lite() { // FS - 'First order than payment' - START $this->icon = DIR_WS_ICONS . 'iDeal_small.gif'; // FS - 'First order than payment' - STOP $this->code = 'ideal_lite'; $this->title = MODULE_PAYMENT_IDEAL_LITE_TEXT_TITLE; $this->description = MODULE_PAYMENT_IDEAL_LITE_TEXT_DESCRIPTION; $this->sort_order = MODULE_PAYMENT_IDEAL_LITE_SORT_ORDER; // $this->enabled = MODULE_PAYMENT_IDEAL_LITE_STATUS; // Minimum amount - start if (MODULE_PAYMENT_IDEAL_LITE_STATUS == '1'){ $cart_total = $_SESSION['cart']->total; $min_amount = MODULE_PAYMENT_IDEAL_LITE_MIN_AMOUNT; if($cart_total > $min_amount){ $this->enabled = true; } else { $this->enabled = false; } } else{ $this->enabled = false; } // Minimum amount - end $this->form_action_url = MODULE_PAYMENT_IDEAL_LITE_URL; // FS - 'First order than payment' - START $this->email_footer = MODULE_PAYMENT_IDEAL_LITE_TEXT_EMAIL_FOOTER; // FS - 'First order than payment' - STOP } // class methods function javascript_validation() { return true; } function selection() { return array('id' => $this->code,'module' => $this->title, // FS - 'First order than payment' - START 'fields' => array(array('title' => tep_image(DIR_WS_IMAGES . '/icons/iDeal_small.gif', 'iDeal Basic')))); // FS - 'First order than payment' - STOP } function pre_confirmation_check() { return false; } function confirmation() { // FS - 'First order than payment' - START //return false; return array('title' => MODULE_PAYMENT_IDEAL_LITE_TEXT_DESCRIPTION); // FS - 'First order than payment' - STOP } function process_button() { global $HTTP_POST_VARS, $customer_id, $order, $currencies; $validUntil = date("Y-m-d\TG:i:s\Z",strtotime ("+1 week")); // v1.3 Modification - Jeroen de Grebber - start // original: $ideal_lite_orderID = $customer_id . date('YmdHis'); // bij ING iDEAL is maximale lengte 16 tekens. Met YmdHis wordt dit 18 tekens: // ymdHis geeft 16 tekens, eerste 2 getallen van jaar zijn ook niet zo belangrijk // FS - 'First order than payment' - START //$ideal_lite_orderID = $customer_id . date('ymdHis'); $ideal_lite_orderID = $this->order_id . date('ymdHis'); // FS - 'First order than payment' - STOP // v1.3 Modification - Jeroen de Grebber - end $totaal = $order->info['total']; $bedrag = ereg_replace(',', '', $totaal); $bedrag = round($bedrag,2); $ideal_lite_amount= $bedrag *100; $key=MODULE_PAYMENT_IDEAL_LITE_SHA_STRING; $merchantID=MODULE_PAYMENT_IDEAL_LITE_PSPID; $subID='0'; $amount=$ideal_lite_amount; $orderNumber=$ideal_lite_orderID; $paymentType='ideal'; $itemNumber1='1234'; $itemDescription1='ARTIKEL'; $itemQuantity1='1'; $itemPrice1=$ideal_lite_amount; ### bereken alvast een deel van de SHA string ### $partOfSha = $partOfSha . $itemNumber1 . $itemDescription1 . $itemQuantity1 . $itemPrice1; ### bouw de String op waarover een SHA1 moet worden berekend ### $shastring = "$key" . "$merchantID" . "$subID" . "$amount" . "$orderNumber" . "$paymentType" . "$validUntil" . $partOfSha ; ###speciale HTML entiteiten verwijderen: $clean_shaString = HTML_entity_decode($shastring); ### De tekens "\t", "\n", "\r", " " (spaties) mogen niet voorkomen in de string $not_allowed = array("\t", "\n", "\r", " "); $clean_shaString = str_replace($not_allowed, "", $clean_shaString); $shasign = sha1($clean_shaString); $process_button_string = tep_draw_hidden_field('merchantID', MODULE_PAYMENT_IDEAL_LITE_PSPID) . tep_draw_hidden_field('subID','0') . tep_draw_hidden_field('amount', $ideal_lite_amount). tep_draw_hidden_field('purchaseID', $ideal_lite_orderID) . tep_draw_hidden_field('language', MODULE_PAYMENT_IDEAL_LITE_LANGUAGE) . tep_draw_hidden_field('currency', $order->info['currency']) . tep_draw_hidden_field('description','Order webwinkel') . tep_draw_hidden_field('hash',$shasign). tep_draw_hidden_field('paymentType','ideal') . tep_draw_hidden_field('validUntil',$validUntil). tep_draw_hidden_field('itemNumber1','1234') . tep_draw_hidden_field('itemDescription1','ARTIKEL') . tep_draw_hidden_field('itemQuantity1','1') . tep_draw_hidden_field('itemPrice1', $ideal_lite_amount). // FS - 'First order than payment' - START //tep_draw_hidden_field('urlSuccess', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL')) . //tep_draw_hidden_field('urlError', tep_href_link(FILENAME_SHOPPING_CART)) . //tep_draw_hidden_field('exceptionurl', tep_href_link(FILENAME_SHOPPING_CART)) . //tep_draw_hidden_field('urlCancel', tep_href_link(FILENAME_SHOPPING_CART)) . tep_draw_hidden_field('urlSuccess', tep_href_link(FILENAME_CHECKOUT_PROCESS, 'part=2', 'SSL')) . tep_draw_hidden_field('urlError', tep_href_link(FILENAME_CHECKOUT_PROCESS, 'part=2', 'SSL')) . tep_draw_hidden_field('exceptionurl', tep_href_link(FILENAME_CHECKOUT_PROCESS, 'part=2', 'SSL')) . tep_draw_hidden_field('urlCancel', tep_href_link(FILENAME_CHECKOUT_PROCESS, 'part=2', 'SSL')) . // FS - 'First order than payment' - STOP tep_draw_hidden_field('CN', $order->customer['firstname'] . ' ' . $order->customer['lastname']) . tep_draw_hidden_field('catalogurl', tep_href_link(FILENAME_DEFAULT)) . tep_draw_hidden_field('owneraddress', $order->delivery['street_address']) . tep_draw_hidden_field('ownerZIP', $order->delivery['postcode']) . tep_draw_hidden_field('COM', MODULE_PAYMENT_IDEAL_LITE_COM_DESCRIPTION . $customer_id) . tep_draw_hidden_field('email', $order->customer['email_address']); return $process_button_string; } function before_process() { return false; } function after_process() { return false; } function output_error() { return false; } function check() { if (!isset($this->check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_IDEAL_LITE_STATUS'"); $this->check = tep_db_num_rows($check_query); } return $this->check; } function install() { tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Allow iDEAL Payments', 'MODULE_PAYMENT_IDEAL_LITE_STATUS', '1', 'Do you want to accept iDEAL payments?', '6', '20', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('iDEAL Status Mode', 'MODULE_PAYMENT_IDEAL_LITE_MODE', 'test', 'Status mode for IDEAL payments? (test or prod)', '6', '21', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('iDEAL Merchant ID', 'MODULE_PAYMENT_IDEAL_LITE_PSPID', '', 'Merchant ID', '6', '22', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_IDEAL_LITE_SORT_ORDER', '1', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('iDEAL Client Language', 'MODULE_PAYMENT_IDEAL_LITE_LANGUAGE', 'nl', 'Client language', '6', '23', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('iDEAL SHA String', 'MODULE_PAYMENT_IDEAL_LITE_SHA_STRING', '', 'SHA string used for the signature (set at the merchant administration page)', '6', '24', now())"); // FS - 'First order than payment' - START //tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('iDEAL URL', 'MODULE_PAYMENT_IDEAL_LITE_URL', 'https://ideal.secure-ing.com/ideal/mpiPayInitIng.do', 'Bank url', '6', '75', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('iDEAL URL', 'MODULE_PAYMENT_IDEAL_LITE_REDIRECT', 'https://', 'Bank url', '6', '75', now())"); // FS - 'First order than payment' - STOP // Minimum amount - start tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('iDEAL Min amount', 'MODULE_PAYMENT_IDEAL_LITE_MIN_AMOUNT', '1', 'The minimum amount to make the iDEAL payment method available', '6', '0', now())"); // Minimum amount - end // FS - 'First order than payment' - START tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Program checkout_process step', 'MODULE_PAYMENT_IDEAL_LITE_URL', 'http://www.yourdomain.com/checkout_process.php?part=1&method=iDealLite', 'Program checkout_process step', '6', '75', now())"); // FS - 'First order than payment' - STOP } function remove() { $keys = ''; $keys_array = $this->keys(); for ($i=0; $i<sizeof($keys_array); $i++) { $keys .= "'" . $keys_array[$i] . "',"; } $keys = substr($keys, 0, -1); tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in (" . $keys . ")"); } function keys() { // FS - 'First order than payment' - START //return array('MODULE_PAYMENT_IDEAL_LITE_STATUS', 'MODULE_PAYMENT_IDEAL_LITE_MIN_AMOUNT','MODULE_PAYMENT_IDEAL_LITE_MODE', 'MODULE_PAYMENT_IDEAL_LITE_PSPID', 'MODULE_PAYMENT_IDEAL_LITE_LANGUAGE', 'MODULE_PAYMENT_IDEAL_LITE_SHA_STRING' , 'MODULE_PAYMENT_IDEAL_LITE_SORT_ORDER','MODULE_PAYMENT_IDEAL_LITE_URL'); return array('MODULE_PAYMENT_IDEAL_LITE_STATUS','MODULE_PAYMENT_IDEAL_LITE_MODE', 'MODULE_PAYMENT_IDEAL_LITE_PSPID', 'MODULE_PAYMENT_IDEAL_LITE_SORT_ORDER', 'MODULE_PAYMENT_IDEAL_LITE_LANGUAGE', 'MODULE_PAYMENT_IDEAL_LITE_SHA_STRING' , 'MODULE_PAYMENT_IDEAL_LITE_REDIRECT', 'MODULE_PAYMENT_IDEAL_LITE_MIN_AMOUNT','MODULE_PAYMENT_IDEAL_LITE_URL'); // FS - 'First order than payment' - STOP } } ?> |