MediaWiki fundraising/REL1_35
IsoDate.php
Go to the documentation of this file.
1<?php
2
4 public function stage( GatewayType $adapter, $normalized, &$staged_data ) {
5 // Print timestamp as ISO 8601 string.
6 if ( isset( $normalized['date'] ) ) {
7 $staged_data['date'] = date( DateTime::ISO8601, $normalized['date'] );
8 }
9 }
10
11 public function unstage( GatewayType $adapter, $staged_data, &$unstaged_data ) {
12 // Parse ISO 8601 string to timestamp.
13 if ( isset( $staged_data['date'] ) ) {
14 $unstaged_data['date'] = strtotime( $staged_data['date'] );
15 }
16 }
17}
stage(GatewayType $adapter, $normalized, &$staged_data)
Transform a subset of normalized data into the "staged" data expected by a payment processor.
Definition IsoDate.php:4
unstage(GatewayType $adapter, $staged_data, &$unstaged_data)
Definition IsoDate.php:11
GatewayType Interface.
Used to mark any class which implements an staging method, for transforming data into the form expect...
Used to mark any class which implements an unstaging method, for transforming data returned by a paym...