<commit_before>package Business::CyberSource::Request::Role::PurchaseInfo;
use 5.008;
use strict;
use warnings;
use Carp;
BEGIN {
	our $VERSION = 'v0.1.2'; # VERSION
}
use Moose::Role;

has currency => (
	required => 1,
	is       => 'ro',
	isa      => 'Str',
);

has total => (
	is       => 'ro',
	isa      => 'Num',
);

has foreign_currency => (
	is  => 'ro',
	isa => 'Str',
);

has item => (
	is  => 'ro',
	isa => 'Bool',
);

has unit_price => (
	is  => 'ro',
	isa => 'Num',
);

has quantity => (
	is  => 'ro',
	isa => 'Int',
);

sub _build_purchase_info {
	my ( $self, $sb ) = @_;

	if ( $self->item ) {

       my $item = $sb->add_elem(
               name => 'item',
               attributes => { 'id' => '0' },
       );

       $sb->add_elem(
               name => 'unitPrice',
               value => $self->unit_price,
               parent => $item,
       );

       $sb->add_elem(
               name => 'quantity',
               value => $self->quantity,
               parent => $item,
       );

	}

	my $purchase_totals = $sb->add_elem(
		name => 'purchaseTotals',
	);

	$sb->add_elem(
		name   => 'currency',
		parent => $purchase_totals,
		value  => $self->currency,
	);

	if ( $self->total ) {
		$sb->add_elem(
			name   => 'grandTotalAmount',
			value  => $self->total,
			parent => $purchase_totals,
		);
	}

	if ( $self->foreign_currency ) {
		$sb->add_elem(
			name   => 'foreignCurrency',
			value  => $self->foreign_currency,
			parent => $purchase_totals,
		);
	}<commit_msg>Build results of 53b777e (on master)<commit_after>package Business::CyberSource::Request::Role::PurchaseInfo;
use 5.008;
use strict;
use warnings;
use Carp;
BEGIN {
	our $VERSION = 'v0.1.2'; # VERSION
}
use Moose::Role;

has currency => (
	required => 1,
	is       => 'ro',
	isa      => 'Str',
);

has total => (
	is       => 'ro',
	isa      => 'Num',
);

has foreign_currency => (
	is  => 'ro',
	isa => 'Str',
);

has item => (
	is  => 'ro',
	isa => 'Bool',
);

has unit_price => (
	is  => 'ro',
	isa => 'Num',
);

has quantity => (
	is  => 'ro',
	isa => 'Int',
);

sub _build_purchase_info {
	my ( $self, $sb ) = @_;

	if ( $self->item ) {

       my $item = $sb->add_elem(
               name => 'item',
               attributes => { 'id' => '0' },
       );

#       $sb->add_elem(
#               name => 'unitPrice',
#               value => $self->unit_price,
#               parent => $item,
#       );

#       $sb->add_elem(
#               name => 'quantity',
#               value => $self->quantity,
#               parent => $item,
#       );

	}

	my $purchase_totals = $sb->add_elem(
		name => 'purchaseTotals',
	);

	$sb->add_elem(
		name   => 'currency',
		parent => $purchase_totals,
		value  => $self->currency,
	);

	if ( $self->total ) {
		$sb->add_elem(
			name   => 'grandTotalAmount',
			value  => $self->total,
			parent => $purchase_totals,
		);
	}

	if ( $self->foreign_currency ) {
		$sb->add_elem(
			name   => 'foreignCurrency',
			value  => $self->foreign_currency,
			parent => $purchase_totals,
		);
	}
{'fraction_non_alphanumeric': 0.19796119697467937, 'fraction_numerical': 0.007563301545544229, 'mean_word_length': 2.1168032786885247, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 109, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '131700', 'n_tokens_mistral': 1213, 'n_tokens_neox': 1128, 'n_words': 233}