-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+Payment, PaymentTerm, PaymentService
+Custom DTD
- Loading branch information
Showing
9 changed files
with
225 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace CXml\Model; | ||
|
||
use JMS\Serializer\Annotation as Serializer; | ||
|
||
class Payment | ||
{ | ||
|
||
public function __construct( | ||
#[Serializer\XmlElement] | ||
#[Serializer\SerializedName('PaymentService')] | ||
private PaymentService $paymentService) | ||
{ | ||
} | ||
|
||
public function getPaymentService(): PaymentService | ||
{ | ||
return $this->paymentService; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace CXml\Model; | ||
|
||
use JMS\Serializer\Annotation as Serializer; | ||
|
||
class PaymentService | ||
{ | ||
|
||
use IdReferencesTrait; | ||
use ExtrinsicsTrait; | ||
|
||
public function __construct( | ||
#[Serializer\XmlAttribute] | ||
readonly private string $method, | ||
#[Serializer\XmlAttribute] | ||
readonly private ?string $provider = null) | ||
{} | ||
|
||
public function getMethod(): string | ||
{ | ||
return $this->method; | ||
} | ||
|
||
public function getProvider(): ?string | ||
{ | ||
return $this->provider; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace CXml\Model; | ||
|
||
use JMS\Serializer\Annotation as Serializer; | ||
|
||
class PaymentTerm | ||
{ | ||
|
||
use ExtrinsicsTrait; | ||
|
||
public function __construct( | ||
#[Serializer\XmlAttribute] | ||
private int $payInNumberOfDays) | ||
{} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.060/cXML.dtd"> | ||
<cXML payloadID="1737963337.319.1846511.7249@eu-hub" timestamp="2025-01-27T07:35:37+00:00"> | ||
<Header> | ||
<From> | ||
<Credential domain="NetworkId"> | ||
<Identity>AN00000123</Identity> | ||
</Credential> | ||
</From> | ||
<To> | ||
<Credential domain="NetworkId"> | ||
<Identity>AN00000456</Identity> | ||
</Credential> | ||
</To> | ||
<Sender> | ||
<Credential domain="NetworkId"> | ||
<Identity>AN00000123</Identity> | ||
<SharedSecret>Secret!123</SharedSecret> | ||
</Credential> | ||
<UserAgent>Suppliers Super Order Processor</UserAgent> | ||
</Sender> | ||
</Header> | ||
<Request deploymentMode="test"> | ||
<OrderRequest> | ||
<OrderRequestHeader orderID="acme-1-1" orderDate="2025-01-27T07:35:36+00:00" type="new" requestedDeliveryDate="2025-01-28T23:00:00+00:00"> | ||
<Total> | ||
<Money currency="USD">10.00</Money> | ||
</Total> | ||
<ShipTo> | ||
<Address> | ||
<Name xml:lang="en">TEST.USA ACME</Name> | ||
<PostalAddress> | ||
<DeliverTo>ACME</DeliverTo> | ||
<DeliverTo>TEST.USA</DeliverTo> | ||
<Street>22 E 4th Ave</Street> | ||
<City>Columbus</City> | ||
<State>OH</State> | ||
<PostalCode>43201-3551</PostalCode> | ||
<Country isoCountryCode="US">United States</Country> | ||
<Extrinsic name="phone">+49121255566</Extrinsic> | ||
</PostalAddress> | ||
</Address> | ||
</ShipTo> | ||
<BillTo> | ||
<Address> | ||
<Name xml:lang="en">TEST.USA ACME</Name> | ||
<PostalAddress> | ||
<DeliverTo>ACME</DeliverTo> | ||
<DeliverTo>TEST.USA</DeliverTo> | ||
<Street>22 E 4th Ave</Street> | ||
<City>Columbus</City> | ||
<State>OH</State> | ||
<PostalCode>43201-3551</PostalCode> | ||
<Country isoCountryCode="US">United States</Country> | ||
</PostalAddress> | ||
</Address> | ||
</BillTo> | ||
<Payment> | ||
<PaymentService method="cc" provider="stripe"> | ||
<IdReference identifier="ch_..." domain="charge_id"/> | ||
<IdReference identifier="pi_..." domain="intent_id"/> | ||
</PaymentService> | ||
</Payment> | ||
</OrderRequestHeader> | ||
<ItemOut lineNumber="1" quantity="1"> | ||
<ItemID> | ||
<SupplierPartID>QA-ACME-AUTOTEST</SupplierPartID> | ||
<BuyerPartID>QA-ACME-AUTOTEST</BuyerPartID> | ||
</ItemID> | ||
<ItemDetail> | ||
<UnitPrice> | ||
<Money currency="USD">10.00</Money> | ||
</UnitPrice> | ||
<Description xml:lang="en">Testing</Description> | ||
<UnitOfMeasure>EA</UnitOfMeasure> | ||
<Classification domain="supplier_part_id">QA-ACME-AUTOTEST</Classification> | ||
</ItemDetail> | ||
</ItemOut> | ||
</OrderRequest> | ||
</Request> | ||
</cXML> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!ENTITY % cxml.payment "( PCard | PaymentService )"> | ||
|
||
<!ENTITY % elements SYSTEM "./cXML.dtd"> | ||
%elements; | ||
|
||
<!ELEMENT PaymentService (IdReference*, Extrinsic*)> | ||
<!ATTLIST PaymentService | ||
method CDATA #REQUIRED | ||
provider CDATA #IMPLIED | ||
> |