| Conditions | 1 |
| Paths | 1 |
| Total Lines | 32 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public function test_hashcoding() { |
||
| 13 | /* @link http://pronamic.nl/wp-content/uploads/2011/12/IDealBasic_EN_v2.3.pdf #page 23 */ |
||
| 14 | $client = new Client(); |
||
| 15 | |||
| 16 | $client->set_hash_key( '41e3hHbYhmxxxxxx' ); |
||
| 17 | $client->set_merchant_id( '0050xxxxx' ); |
||
| 18 | $client->set_sub_id( '0' ); |
||
| 19 | $client->set_purchase_id( '10' ); |
||
| 20 | $client->set_payment_type( 'ideal' ); |
||
| 21 | $client->set_expire_date( new DateTime( '2009-01-01 12:34:56' ) ); |
||
| 22 | |||
| 23 | $item = new Item( '1', 'omschrijving', 1, new Money( 1 ) ); |
||
| 24 | |||
| 25 | $items = $client->get_items(); |
||
| 26 | $items->add_item( $item ); |
||
| 27 | |||
| 28 | // Other variables (not in hash). |
||
| 29 | $client->set_language( 'nl' ); |
||
| 30 | $client->set_currency( 'EUR' ); |
||
| 31 | $client->set_description( 'Example hashcode' ); |
||
| 32 | |||
| 33 | $baseurl = 'http://www.uwwebwinkel.nl'; |
||
| 34 | |||
| 35 | $client->set_success_url( "$baseurl/Success.html" ); |
||
| 36 | $client->set_cancel_url( "$baseurl/Cancel.html" ); |
||
| 37 | $client->set_error_url( "$baseurl/Error.html" ); |
||
| 38 | |||
| 39 | // Create hash. |
||
| 40 | $shasign = $client->create_hash(); |
||
| 41 | |||
| 42 | // Assert. |
||
| 43 | $this->assertEquals( '7615604527e1edd65521e2180e445d3a89abc794', $shasign ); |
||
| 44 | } |
||
| 46 |