Business-cXML

 view release on metacpan or  search on metacpan

lib/Business/cXML/Message/PunchOutOrder.pm  view on Meta::CPAN

sub _from_status {
	my ($self, $val) = @_;
	return CXML_POOM_STATUS_FINAL if $val eq 'final';
	return CXML_POOM_STATUS_PENDING;
}

sub from_node {
	my ($self, $el) = @_;

	$el->ferry($self, {
			BuyerCookie                => 'buyer_cookie',
			PunchOutOrderMessageHeader => {
				operationAllowed  => 'highest_operation',
				quoteStatus       => [ 'status', \&_from_status ],
				SourcingStatus    => '__UNIMPLEMENTED',
				Total             => [ 'total',    'Business::cXML::Amount' ],
				ShipTo            => [ 'shipto',   'Business::cXML::ShipTo' ],
				Shipping          => [ 'shipping', 'Business::cXML::Amount' ],
				Tax               => [ 'tax',      'Business::cXML::Amount' ],
				SupplierOrderInfo => {
					orderID   => 'id',

lib/Business/cXML/Message/PunchOutOrder.pm  view on Meta::CPAN

			},
			ItemIn => [ 'items', 'Business::cXML::ItemIn' ],
		}
	);
}

sub to_node {
	my ($self, $doc) = @_;
	my $node = $doc->create($self->{_nodeName});

	$node->add('BuyerCookie', $self->{buyer_cookie});

	my $head = $node->add('PunchOutOrderMessageHeader', undef,
		operationAllowed => $self->{highest_operation},
	);
	$head->{quoteStatus} = ($self->is_final ? 'final' : 'pending') if defined $self->{status};

	# UNIMPLEMENTED: SourcingStatus
	$self->total({}) unless defined $self->{total};
	$head->add($self->{total}->to_node($node));
	$head->add($self->{shipto}->to_node($node))   if defined $self->{shipto};

lib/Business/cXML/Request/PunchOutSetup.pm  view on Meta::CPAN

	shipto   => 'Business::cXML::ShipTo',
);

use Business::cXML::Contact;
use XML::LibXML::Ferry;

sub from_node {
	my ($self, $el) = @_;

	$el->ferry($self, {
			BuyerCookie     => 'buyer_cookie',
			BrowserFormPost => { URL => 'checkout_url' },
			Contact         => [ 'contacts',     'Business::cXML::Contact' ],
			SupplierSetup   => '__OBSOLETE',
			ShipTo          => [ 'shipto',       'Business::cXML::ShipTo'  ],
			SelectedItem    => '__UNIMPLEMENTED',
			ItemOut         => '__UNIMPLEMENTED',
			Extrinsic       => {
				__meta_name       => 'name',
				ReturnFrame       => 'checkout_target',
				UserEmail         => '_ext_email',

lib/Business/cXML/Request/PunchOutSetup.pm  view on Meta::CPAN

			);
		};
	};
}

sub to_node {
	my ($self, $doc) = @_;
	my $node = $doc->create($self->{_nodeName});
	$node->{operation} = $self->{operation};

	$node->add('BuyerCookie', $self->{buyer_cookie});
	$node->add('Extrinsic', $self->{checkout_target}, name => 'ReturnFrame') if defined $self->{checkout_target};
	$node->add('BrowserFormPost')->add('URL', $self->{checkout_url}) if defined $self->{checkout_url};
	$node->add($_->to_node($node)) foreach (@{ $self->{contacts} });
	$node->add($self->{shipto}->to_node($node)) if defined $self->{shipto};

	return $node;
}

=item C<B<operation>>

t/xml-assets/punchoutorder-message.xml  view on Meta::CPAN

		</To>
		<Sender>
			<Credential domain="TEST">
				<Identity>remotehost</Identity>
			</Credential>
			<UserAgent>Test Service</UserAgent>
		</Sender>
	</Header>
	<Message deploymentMode="production">
		<PunchOutOrderMessage>
			<BuyerCookie>12345678</BuyerCookie>
			<PunchOutOrderMessageHeader operationAllowed="create">
				<Total>
					<Money currency="USD">0.00</Money>
				</Total>
			</PunchOutOrderMessageHeader>
			<ItemIn quantity="0">
				<ItemID><SupplierPartID></SupplierPartID></ItemID>
				<ItemDetail>
					<UnitPrice><Money currency="USD">0.00</Money></UnitPrice>
					<Description xml:lang="en-US"></Description>

t/xml-assets/punchoutorder2-message.xml  view on Meta::CPAN

		</To>
		<Sender>
			<Credential domain="TEST">
				<Identity>remotehost</Identity>
			</Credential>
			<UserAgent>Test Service</UserAgent>
		</Sender>
	</Header>
	<Message deploymentMode="production" inReplyTo="123.olderMessage">
		<PunchOutOrderMessage>
			<BuyerCookie>12345678</BuyerCookie>
			<PunchOutOrderMessageHeader operationAllowed="create" quoteStatus="final">
				<Total>
					<Money currency="CAD">12.99</Money>
				</Total>
			</PunchOutOrderMessageHeader>
		</PunchOutOrderMessage>
	</Message>
</cXML>

t/xml-assets/punchoutorder3-message.xml  view on Meta::CPAN

		<Sender>
			<Credential domain="TEST">
				<Identity>remotehost</Identity>
			</Credential>
			<UserAgent>Test Service</UserAgent>
		</Sender>
	</Header>
	<Message deploymentMode="production" inReplyTo="123.olderMessage">
		<Status code="201" text="Accepted" xml:lang="en-US">We're all set</Status>
		<PunchOutOrderMessage>
			<BuyerCookie>12345678</BuyerCookie>
			<PunchOutOrderMessageHeader operationAllowed="create">
				<Total>
					<Money currency="CAD">12.99</Money>
				</Total>
			</PunchOutOrderMessageHeader>
		</PunchOutOrderMessage>
	</Message>
</cXML>

t/xml-assets/punchoutorder4-message.xml  view on Meta::CPAN

		</To>
		<Sender>
			<Credential domain="TEST">
				<Identity>remotehost</Identity>
			</Credential>
			<UserAgent>Test Service</UserAgent>
		</Sender>
	</Header>
	<Message deploymentMode="production">
		<PunchOutOrderMessage>
			<BuyerCookie>12345678</BuyerCookie>
			<PunchOutOrderMessageHeader operationAllowed="create" quoteStatus="pending">
				<Total>
					<Money currency="CAD">524.93</Money>
				</Total>
				<ShipTo>
					<Address>
						<Name xml:lang="en-US">John Smith</Name>
						<PostalAddress>
							<DeliverTo>John Smith</DeliverTo>
							<Street>123 Main St.</Street>

t/xml-assets/punchoutsetup1-request.xml  view on Meta::CPAN

		<Sender>
			<Credential domain="TEST">
				<Identity>remotehost</Identity>
				<SharedSecret>password</SharedSecret>
			</Credential>
			<UserAgent>Test Service</UserAgent>
		</Sender>
	</Header>
	<Request deploymentMode="production">
		<PunchOutSetupRequest operation="create">
			<BuyerCookie>buyer1234</BuyerCookie>
			<Extrinsic name="ReturnFrame">_returnFrame</Extrinsic>
			<BrowserFormPost>
				<URL>https://example.com/punchout_return</URL>
			</BrowserFormPost>
			<Contact>
				<Name xml:lang="en-US">John Smith</Name>
				<Email>1234@remotehost</Email>
				<Phone>
					<TelephoneNumber>
						<CountryCode isoCountryCode="CA">1</CountryCode>

t/xml-assets/punchoutsetup2-request.xml  view on Meta::CPAN

		<Sender>
			<Credential domain="TEST">
				<Identity>remotehost</Identity>
				<SharedSecret>password</SharedSecret>
			</Credential>
			<UserAgent>Test Service</UserAgent>
		</Sender>
	</Header>
	<Request deploymentMode="test">
		<PunchOutSetupRequest operation="create">
			<BuyerCookie>buyer1234</BuyerCookie>
			<Extrinsic name="UserEmail">1234@remotehost</Extrinsic>
			<Extrinsic name="FirstName">John</Extrinsic>
			<Extrinsic name="LastName">Smith</Extrinsic>
			<BrowserFormPost>
				<URL>https://example.com/punchout_return</URL>
			</BrowserFormPost>
			<ShipTo>
				<Address>
					<Name xml:lang="en-US">John Smith</Name>
					<PostalAddress>

t/xml-assets/punchoutsetup3-request.xml  view on Meta::CPAN

		<Sender>
			<Credential domain="TEST">
				<Identity>remotehost</Identity>
				<SharedSecret>password</SharedSecret>
			</Credential>
			<UserAgent>Test Service</UserAgent>
		</Sender>
	</Header>
	<Request deploymentMode="test">
		<PunchOutSetupRequest operation="create">
			<BuyerCookie>buyer1234</BuyerCookie>
			<Extrinsic name="UserEmail">1234@remotehost</Extrinsic>
			<Extrinsic name="UserFullName">John Smith</Extrinsic>
			<BrowserFormPost>
				<URL>https://example.com/punchout_return</URL>
			</BrowserFormPost>
			<ShipTo>
				<Address>
					<Name xml:lang="en-US">John Smith</Name>
					<PostalAddress>
						<DeliverTo>John Smith</DeliverTo>

t/xml-assets/punchoutsetup4-request.xml  view on Meta::CPAN

		<Sender>
			<Credential domain="TEST">
				<Identity>remotehost</Identity>
				<SharedSecret>password</SharedSecret>
			</Credential>
			<UserAgent>Test Service</UserAgent>
		</Sender>
	</Header>
	<Request deploymentMode="test">
		<PunchOutSetupRequest operation="create">
			<BuyerCookie>buyer1234</BuyerCookie>
			<Extrinsic name="UserEmail">1234@remotehost</Extrinsic>
			<Extrinsic name="UniqueName">jsmith</Extrinsic>
			<BrowserFormPost>
				<URL>https://example.com/punchout_return</URL>
			</BrowserFormPost>
			<ShipTo>
				<Address>
					<Name xml:lang="en-US">John Smith</Name>
					<PostalAddress>
						<DeliverTo>John Smith</DeliverTo>

t/xml-assets/punchoutsetup5-request.xml  view on Meta::CPAN

		<Sender>
			<Credential domain="TEST">
				<Identity>remotehost</Identity>
				<SharedSecret>password</SharedSecret>
			</Credential>
			<UserAgent>Test Service</UserAgent>
		</Sender>
	</Header>
	<Request deploymentMode="test">
		<PunchOutSetupRequest operation="create">
			<BuyerCookie>buyer1234</BuyerCookie>
			<Extrinsic name="UserEmail">1234@remotehost</Extrinsic>
		</PunchOutSetupRequest>
	</Request>
</cXML>

t/xml-assets/punchoutsetup6-request.xml  view on Meta::CPAN

		<Sender>
			<Credential domain="TEST">
				<Identity>remotehost</Identity>
				<SharedSecret>password</SharedSecret>
			</Credential>
			<UserAgent>Test Service</UserAgent>
		</Sender>
	</Header>
	<Request deploymentMode="test">
		<PunchOutSetupRequest operation="create">
			<BuyerCookie>buyer1234</BuyerCookie>
			<Extrinsic name="UserEmail">1234@remotehost</Extrinsic>
			<Extrinsic name="FirstName">John</Extrinsic>
		</PunchOutSetupRequest>
	</Request>
</cXML>

t/xml-assets/punchoutsetup7-request.xml  view on Meta::CPAN

		<Sender>
			<Credential domain="TEST">
				<Identity>remotehost</Identity>
				<SharedSecret>password</SharedSecret>
			</Credential>
			<UserAgent>Test Service</UserAgent>
		</Sender>
	</Header>
	<Request deploymentMode="test">
		<PunchOutSetupRequest operation="create">
			<BuyerCookie>buyer1234</BuyerCookie>
			<Extrinsic name="FullName">John Smith</Extrinsic>
		</PunchOutSetupRequest>
	</Request>
</cXML>

t/xml-assets/punchoutsetup8-request.xml  view on Meta::CPAN

		<Sender>
			<Credential domain="TEST">
				<Identity>remotehost</Identity>
				<SharedSecret>password</SharedSecret>
			</Credential>
			<UserAgent>Test Service</UserAgent>
		</Sender>
	</Header>
	<Request deploymentMode="production">
		<PunchOutSetupRequest operation="create">
			<BuyerCookie>buyer1234</BuyerCookie>
			<Contact>
				<Name xml:lang="en-US">John Smith</Name>
				<Email>1234@remotehost</Email>
				<Phone>
					<TelephoneNumber>
						<CountryCode isoCountryCode="CA">1</CountryCode>
						<AreaOrCityCode>888</AreaOrCityCode>
						<Number>5551212</Number>
					</TelephoneNumber>
				</Phone>

t/xml-catalog/cXML-1.2.036/cXML.dtd  view on Meta::CPAN

    redirects the user's browser to the provided location.  (For some
    non-HTML applications, opening a new browser window at that location
    may be more appropriate.)  The destination system eventually provides
    an HTML form to the user's browser.  This form submits the final
    Message to close the remote session, return that user to the
    originating application and carry any required information back to the
    originating application.
==== -->

<!--
    OriginatorCookie - Identification of a specific PunchOut session.  Used
    in both originating Request and later Message that returns user to
    originating application.

    Note: The BuyerCookie element used in a 'regular' PunchOut transaction
    (defined in Transaction.mod) is of type ANY.  That does not seem
    useful.  The string required below better matches the needs for this
    element.  Future transactions similar to the PunchOut transaction will
    use this element.
-->
<!ELEMENT OriginatorCookie (#PCDATA)>

<!--
    BrowserFormPost - Location to which the user's browser must submit the
    final Message.  This location (carried in the originating Request) does
    not need to be specific to a PunchOut session since the
    OriginatorCookie is returned in the Message.
-->
<!ELEMENT BrowserFormPost (URL)>

<!--
    SelectedService - Identification of a service offered by this provider
    and requested in this transaction.  Used only in the originating
    Request.
-->
<!ELEMENT SelectedService (#PCDATA)>

t/xml-catalog/cXML-1.2.036/cXML.dtd  view on Meta::CPAN


<!ELEMENT PurchaseRequisitionHeader (Shipping?, Tax?, Total?, ShipTo?, BillTo?, Contact*, Comments?,
                                     DocumentReference?, Extrinsic*)>
<!ATTLIST PurchaseRequisitionHeader
   requisitionID %string;        #IMPLIED
   requisitionDate %datetime.tz;   #IMPLIED
   type       (new | update | delete)  "new"
   requisitionVersion %number;      #IMPLIED
>

<!ELEMENT PunchOutSetupRequest (BuyerCookie, Extrinsic*, BrowserFormPost?,
                                Contact*, SupplierSetup?, ShipTo?,
                                SelectedItem?, ItemOut*)>
<!ATTLIST PunchOutSetupRequest
    operation  (create | inspect | edit | source)  #REQUIRED
>

<!ELEMENT BuyerCookie ANY> <!-- any valid XML data -->

<!ELEMENT SelectedItem (ItemID)>
<!ELEMENT SupplierSetup (URL)>

<!ELEMENT PunchOutSetupResponse (StartPage)>

<!--
    Definition of a PunchOut Order Message.  This is the data that is sent
    back to the procurement application from the external system that the
    PunchOut Request was targeted at.
-->
<!ELEMENT PunchOutOrderMessage (BuyerCookie, PunchOutOrderMessageHeader,
                                ItemIn*)>

<!--
     Header of a PunchOut Order Request.  This is the data that is sent from
     the supplier to transfer the supplier acquired shopping basket back to
     the buyer system.

     operationAllowed
          Highest operation allowed on the PunchOut shopping basket.
          "create" allows only later OrderRequest operations on these items.

t/xml-catalog/cXML-1.2.036/cXML.dtd  view on Meta::CPAN

     interactive session.  Inclusion should lead to a ProviderDoneMessage
     from the provider at the end of a session.

     The originating application would provide the Followup location if it
     wished the provider to provide information about later status changes
     in the service (after the end of a particular Provider session).  This
     applies only when the initial status (transmitted via a
     ProviderDoneMessage) was an interim value.
-->

<!ELEMENT ProviderSetupRequest (OriginatorCookie,
                                (BrowserFormPost, Followup?)?,
                                SelectedService, Extrinsic*)>

<!--
     ProviderSetupResponse
-->

<!ELEMENT ProviderSetupResponse (StartPage)>

<!--
    ProviderDoneMessage
-->

<!ELEMENT ProviderDoneMessage (OriginatorCookie, ReturnData*)>
<!--
    For cXML license agreement information, please see
    http://www.cxml.org/home/license.asp

    $Id: //ariba/cxml/release/schema/1.2.36.1+/Modules/DataAvailable.mod#1 $
-->


<!--
    DataAvailable message.



( run in 0.526 second using v1.01-cache-2.11-cpan-e9199f4ba4c )