Question

We're using PayPal's Website Payments PayFlow Pro to process credit cards on our website, and we recently joined the PayPal Partner program that lets you specify a "BN Code" with each transaction processed to get credit for it. The only trouble is... all of the documentation for how to use BN codes is for the obsolete Express Checkout style of processing transactions (which was basically just sending over form data as a long query string), rather than the current model with XMLPay.

In the old model, this "BN code" was specified as the BUTTONSOURCE parameter, and so I know to use the <ButtonSource> tag in XMLPay. However, I don't know where to put it.

Neither the XMLPay Developer's Guide nor the Website Payments Pro Payflow Edition - XMLPay Developer's Guide seemed very helpful in answering this question. They give examples of placing the <ButtonSource> tag immediately inside a <PayPal> tag, which is used as the <Tender>. The problem with that is that most of our customers will not be using PayPal as their tender; they'll be using their credit cards.

I tried a number of transactions, moving the <ButtonSource> tag around to various spots, both inside a <PayPal> tag and standing alone without one. With every different attempt I made, either the transaction was declined, or the code simply didn't come through.

Here's an example of the XMLPay request we're sending to PayPal. I know this is not correct placement of <ButtonSource> tag, but could someone here tell me where I need to place that tag? Or could you just post a revised copy of this XML that does it the right way?


<?xml version="1.0" encoding="UTF-8"?>
<XMLPayRequest xmlns="http://www.paypal.com/XMLPay" Timeout="30" Version="2.0">
  <RequestData>
    <Vendor>************</Vendor>
    <Partner>PayPal</Partner>
    <Transactions>
      <Transaction>
        <Sale>
          <PayData>
            <Invoice>
              <NationalTaxIncl>false</NationalTaxIncl>
              <TotalAmt>10.00</TotalAmt>
              <BillTo>
                <Address>
                  <Street>1234 Fake Street</Street>
                  <Zip>90210</Zip>
                </Address>
              </BillTo>
            </Invoice>
            <Tender>
              <Card>
                <CardType>VISA</CardType>
                <CardNum>****************</CardNum>
                <ExpDate>******</ExpDate>
                <NameOnCard>John Smith</NameOnCard>
                <CVNum>***</CVNum>
              </Card>
            </Tender>
            <ButtonSource>MyCompanyBNCode</ButtonSource>
          </PayData>
        </Sale>
      </Transaction>
    </Transactions>
  </RequestData>
  <RequestAuth>
    <UserPass>
      <User>************</User>
      <Password>************</Password>
    </UserPass>
  </RequestAuth>
</XMLPayRequest>

Many thanks!

Was it helpful?

Solution

You would put it in the extdata tag, covered in the guide starting on page 16. Same goes for any other parameter that doesn’t have an XML value.

Generic example from the guide:

<Sale>
     <PayData>
          (Invoice)
          (Tender)
     </PayData>
     (ExtData)*
</Sale>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top