Paypal
The following brands are covered in this section: PAYPAL
Requirements to process PAYPAL
transactions:
- Processing transactions with a redirect location (see chapter Redirect payment systems )
- If sent, the element
ShoppingCart
should be provided as detailed as possible. - If sent, the element
BillingAddr
(billing address of the order) should be provided with all details (name, address and email address of the customer). - The element
ShippingAddr
(shipping address of the order) should be provided if it differs from the elementBillingAddr
.
A payment with brand PAYPAL
requires the PaymentPAYPAL
type.
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:etp="https://www.mpay24.com/soap/etp/1.5/ETP.wsdl"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<etp:AcceptPayment>
<merchantID>90000</merchantID>
<tid>12081</tid>
<pType>PAYPAL</pType>
<payment xsi:type="etp:PaymentPAYPAL">
<amount>1800</amount>
<currency>EUR</currency>
</payment>
<order>
<description>Example order with shopping cart</description>
<shoppingCart>
<item>
<productNr>001</productNr>
<desciption>Test product A</desciption>
<quantity>1</quantity>
<tax>200</tax>
<amount>1200</amount>
</item>
<shippingCosts>600</shippingCosts>
<shippingTax>100</shippingTax>
<tax>300</tax>
</shoppingCart>
<billing>
<name>John Doe</name>
<street>Main street 100</street>
<zip>1010</zip>
<city>Vienna</city>
<countryCode>AT</countryCode>
<email>[email protected]</email>
</billing>
<language>EN</language>
</order>
</etp:AcceptPayment>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
PayPal state and province codes
For some countries PayPal requires the element
State
.
A list can be found here: https://developer.paypal.com/docs/classic/api/state-codes/
PayPal ExpressCheckout
PayPal can also be used to collect the payment information of the customer (e.g. shipping address) beforehand and adjust the final amount on the basis of the collect informations (e.g. increase the amount due to a shipping address in another country).
Two additional elements of the payment notification are needed for this implementation:
SHIPPING_ADDR
: Returns the shipping address as confirmed of the customerPAYPAL_PAYER
: Returns payer information about customer (e.g. PayPal email address)
Contact the mPAY24 Support to arrange the merchant configuration change needed for the payment notification.
An ExpressCheckout payment requires the brand PAYPAL
with the PaymentPAYPAL
type and <commit>false</commit>
to allow further changes to the amount.
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:etp="https://www.mpay24.com/soap/etp/1.5/ETP.wsdl"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<etp:AcceptPayment>
<merchantID>90000</merchantID>
<tid>12082</tid>
<pType>PAYPAL</pType>
<payment xsi:type="etp:PaymentPAYPAL">
<amount>1800</amount>
<currency>EUR</currency>
<manualClearing>false</manualClearing>
<commit>false</commit>
</payment>
<order>
<description>Example order with shopping cart</description>
<shoppingCart>
<item>
<productNr>001</productNr>
<desciption>Test product A</desciption>
<quantity>1</quantity>
<tax>200</tax>
<amount>1200</amount>
</item>
<shippingCosts>600</shippingCosts>
<shippingTax>100</shippingTax>
<tax>300</tax>
</shoppingCart>
<billing>
<mode>READWRITE</mode>
<name>John Doe</name>
<street>Main street 100</street>
<zip>1010</zip>
<city>Vienna</city>
<countryCode>AT</countryCode>
<email>[email protected]</email>
</billing>
</order>
<language>EN</language>
</etp:AcceptPayment>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
After customer redirection and processing of the payment notification, the transaction needs to be finalized. During this step the transaction amount can be changed (e.g. due to changed shipping costs).
A callback with brand PAYPAL
requires the CallbackPAYPAL
type.
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:etp="https://www.mpay24.com/soap/etp/1.5/ETP.wsdl"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<etp:ManualCallback>
<merchantID>90000</merchantID>
<mpayTID>1836238</mpayTID>
<paymentCallback xsi:type="etp:CallbackPAYPAL">
<amount>1800</amount>
<cancel>false</cancel>
</paymentCallback>
</etp:ManualCallback>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Updated about 2 months ago