setTransaction

The following links contain data structure examples of the setTransaction API call

  1. Default (PAYMENT/RESERVE)

  2. With fraud enabled
    PayU's Fraud service is an optional paid-for service. If integrating and signed up for fraud, please make sure to include the sections Basket.productLineItem, Basket.shippingDetails and Fraud.

  3. Debit Order
    Please view the Credit Card Debit Order technical section for more information

  4. Once Off Payment and Debit Order
    Please view the Credit Card Debit Order technical section for more information

Please make sure that you understand the difference in transaction flow when implementing either a PAYMENT or RESERVE . 

setTransaction example (default: PAYMENT/RESERVE)
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soap.api.controller.web.payjar.com/"
    xmlns:ns2="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <SOAP-ENV:Header>
        <wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
            <wsse:UsernameToken wsu:Id="UsernameToken-9" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
                <wsse:Username>~~SOAP Username goes here~~</wsse:Username>
                <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">~~~SOAP Password goes here~~~</wsse:Password>
            </wsse:UsernameToken>
        </wsse:Security>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <ns1:setTransaction>
            <Api>ONE_ZERO</Api>
            <Safekey>~~~SAFEKEY goes here ~~~</Safekey>
            <TransactionType>~~~ The values of PAYMENT or RESERVE~~~</TransactionType>
            <AdditionalInformation>
                <merchantReference>~~~Merchant ref goes here ~~~</merchantReference>
                <cancelUrl>http://example.com/cancel-page/</cancelUrl>
                <notificationUrl>http://example.com/notification-page/</notificationUrl>
                <returnUrl>http://example.com/return-page/</returnUrl>
                <supportedPaymentMethods>CREDITCARD</supportedPaymentMethods>
                <showBudget>false</showBudget>
            </AdditionalInformation>
            <Customer>
                <email>john@doe.com</email>
                <firstName>John</firstName>
                <lastName>Doe</lastName>
                <mobile>278288888888</mobile>
            </Customer>
            <Basket>
                <amountInCents>1000</amountInCents>
                <currencyCode>ZAR</currencyCode>
                <description>Fraud Basket</description>
            </Basket>
        </ns1:setTransaction>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Top

setTransaction example (with Fraud enabled)
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soap.api.controller.web.payjar.com/"
    xmlns:ns2="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <SOAP-ENV:Header>
        <wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
            <wsse:UsernameToken wsu:Id="UsernameToken-9" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
                <wsse:Username>~~SOAP Username goes here~~</wsse:Username>
                <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">~~~SOAP Password goes here~~~</wsse:Password>
            </wsse:UsernameToken>
        </wsse:Security>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <ns1:setTransaction>
            <Api>ONE_ZERO</Api>
            <Safekey>~~~SAFEKEY goes here ~~~</Safekey>
            <TransactionType>~~~ The values of PAYMENT or RESERVE~~~</TransactionType>
            <AdditionalInformation>
                <merchantReference>~~~Merchant ref goes here ~~~</merchantReference>
                <cancelUrl>http://example.com/cancel-page/</cancelUrl>
                <notificationUrl>http://example.com/notification-page/</notificationUrl>
                <returnUrl>http://example.com/return-page/</returnUrl>
                <supportedPaymentMethods>CREDITCARD</supportedPaymentMethods>
                <showBudget>false</showBudget>
            </AdditionalInformation>
            <Customer>
                <email>john@doe.com</email>
                <firstName>John</firstName>
                <lastName>Doe</lastName>
                <mobile>278288888888</mobile>
            </Customer>
            <Basket>
                <amountInCents>1000</amountInCents>
                <currencyCode>ZAR</currencyCode>
                <description>Fraud Basket</description>
                <!-Zero or more repetitions:->
                <productLineItem>
                    <amount>10000</amount>
                    <costAmount>1000</costAmount>
                    <description>Product 1</description>
                    <giftMessage>Happy Birthday</giftMessage>
                    <productCode>ABC0002</productCode>
                    <quantity>1</quantity>
                    <recipientAddress1>21 Main Road</recipientAddress1>
                    <recipientCity>Cape Town</recipientCity>
                    <recipientCountryCode>ZAR</recipientCountryCode>
                    <recipientPostalCode>8000</recipientPostalCode>
                    <recipientFirstName>John</recipientFirstName>
                    <recipientLastName>Doe</recipientLastName>
                </productLineItem>
                <shippingDetails>
                    <shippingAddress1>21 Shipping Road</shippingAddress1>
                    <shippingAddressCity>Portland</shippingAddressCity>
                    <shippingEmail>john@doe.com </shippingEmail>
                    <shippingCountryCode>AFG</shippingCountryCode>
                    <shippingMethod>P</shippingMethod>
                    <shppingFirstName>James</shppingFirstName>
                    <shippingLastName>Green</shippingLastName>
                    <shippingFax>27214688020</shippingFax>shippingFax>
                    <shippingPhone>27214688021</shippingPhone>shippingPhone>
                </shippingDetails>
            </Basket>
            <Fraud>
                <checkFraudOverride>false</checkFraudOverride>
                <merchantWebSite>http://www.example.com </merchantWebSite>
                <pcFingerPrint>owhjiflkwhefqwoaef</pcFingerPrint>
            </Fraud>
        </ns1:setTransaction>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Top

setTransaction example (Debit Order)
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soap.api.controller.web.payjar.com/"
    xmlns:ns2="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <SOAP-ENV:Header>
        <wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
            <wsse:UsernameToken wsu:Id="UsernameToken-9" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
                <wsse:Username>~~~SOAP Username goes here~~~</wsse:Username>
                <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">~~~SOAP Password goes here~~~</wsse:Password>
            </wsse:UsernameToken>
        </wsse:Security>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <ns1:setTransaction>
            <Api>ONE_ZERO</Api>
            <Safekey>~~~SAFEKEY goes here ~~~</Safekey>
            <TransactionType>ONCE_OFF_PAYMENT_AND_DEBIT_ORDER</TransactionType>
            <AdditionalInformation>
                <merchantReference>~~~Merchant ref goes here ~~~</merchantReference>
                <cancelUrl>http://example.com/cancel-page/</cancelUrl>
                <notificationUrl>http://example.com/notification-page/</notificationUrl>
                <returnUrl>http://example.com/return-page/</returnUrl>
                <supportedPaymentMethods>CREDITCARD</supportedPaymentMethods>
                <showBudget>false</showBudget>
            </AdditionalInformation>
            <Customer>
                <email>john@doe.com</email>
                <firstName>John</firstName>
                <lastName>Doe</lastName>
                <mobile>278288888888</mobile>
                <merchantUserId>0123456789 </merchantUserId>
            </Customer>
            <Basket>
                <amountInCents>1000</amountInCents>
                <currencyCode>ZAR</currencyCode>
                <description>Basket Description here</description>
            </Basket>
            <TransactionRecord>
                <statementDescription>Statement description comes here </statementDescription>
                <managedBy>MERCHANT</managedBy>
                <anonymousUser>false</anonymousUser>
            </TransactionRecord>
        </ns1:setTransaction>
    </SOAP-ENV:Body>
</ns1:setTransaction>

Top

setTransaction example (Once off payment and debit order)
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soap.api.controller.web.payjar.com/"
    xmlns:ns2="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <SOAP-ENV:Header>
        <wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
            <wsse:UsernameToken wsu:Id="UsernameToken-9" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
                <wsse:Username>~~~SOAP Username goes here~~~</wsse:Username>
                <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">~~~SOAP Password goes here~~~</wsse:Password>
            </wsse:UsernameToken>
        </wsse:Security>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <ns1:setTransaction>
            <Api>ONE_ZERO</Api>
            <Safekey>~~~SAFEKEY goes here ~~~</Safekey>
            <TransactionType>ONCE_OFF_PAYMENT_AND_DEBIT_ORDER</TransactionType>
            <AdditionalInformation>
                <merchantReference>~~~Merchant ref goes here ~~~</merchantReference>
                <cancelUrl>http://example.com/cancel-page/</cancelUrl>
                <notificationUrl>http://example.com/notification-page/</notificationUrl>
                <returnUrl>http://example.com/return-page/</returnUrl>
                <supportedPaymentMethods>CREDITCARD</supportedPaymentMethods>
                <showBudget>false</showBudget>
            </AdditionalInformation>
            <Customer>
                <email>john@doe.com</email>
                <firstName>John</firstName>
                <lastName>Doe</lastName>
                <mobile>278288888888</mobile>
                <merchantUserId>0123456789 </merchantUserId>
            </Customer>
            <Basket>
                <amountInCents>1000</amountInCents>
                <currencyCode>ZAR</currencyCode>
                <description>Basket Description here</description>
            </Basket>
            <TransactionRecord>
                <statementDescription>Statement description comes here </statementDescription>
                <managedBy>MERCHANT</managedBy>
                <anonymousUser>false</anonymousUser>
            </TransactionRecord>
        </ns1:setTransaction>
    </SOAP-ENV:Body>
</ns1:setTransaction>

Top

Related pages