public function __construct($values)
 {
     parent::__construct();
     $details = $values['RefundDetails'];
     $this->setGatewayIds($details['AmazonRefundId']);
     $this->date = UtcDate::getUtcTimestamp($details['CreationTimestamp']);
     $this->currency = $details['RefundAmount']['CurrencyCode'];
     $this->gross = $details['RefundAmount']['Amount'];
     // TODO: do we need to use FeeRefunded for anything?
 }
 public function __construct($values)
 {
     parent::__construct();
     $details = $values['CaptureDetails'];
     $this->setGatewayIds($details['AmazonCaptureId']);
     $captureReferenceId = $details['CaptureReferenceId'];
     $this->completion_message_id = "amazon-{$captureReferenceId}";
     $this->order_id = $captureReferenceId;
     $parts = explode('-', $captureReferenceId);
     $this->contribution_tracking_id = $parts[0];
     $this->date = UtcDate::getUtcTimestamp($details['CreationTimestamp']);
     $this->currency = $details['CaptureAmount']['CurrencyCode'];
     $this->gross = $details['CaptureAmount']['Amount'];
     $this->fee = $details['CaptureFee']['Amount'];
     $this->gateway_status = $details['CaptureStatus']['State'];
 }