Can I sell PayPal pre-paid products on BlueSnap?

78 Views Asked by At

I have an account with BlueSnap, where I offer my shoppers to buy using PayPal. I use the payment API when I send credit card orders, and in that I can separate Authorization and capture like this:

{
    "amount": 100,
    "vaultedShopperId": xxxx1240,
    "recurringTransaction": "ECOMMERCE",
    "softDescriptor": "MYSOFT",
    "currency": "USD",
    "cardTransactionType": "AUTH_ONLY"
}

And capture later with this:

{
    "cardTransactionType": "CAPTURE",
    "transactionId": xxxxx77363
}

But I don't know how to do this for PayPal transactions. The reason I need delay the capture is because I want to sell a pre-ordered item, and I don't want to charge the shopper in PayPal until I get the product ready to ship.

I'm using the Payment API, and I wasn't sure how I can separate the purchase to two stages/phases. I looked in the documentation and I couldn't find a simple answer. Is there a way to do this?

1

There are 1 best solutions below

0
On BEST ANSWER

BlueSnap has a few ways to interact with PayPal. Through the Payment API they have three flows, each for a specific scenario:

  • the standard flow is used for the basic PayPal purchase.
  • split-step flow is where you first send a shopper to PayPal and authorize the payment and capture later that day.
  • delayed capture is where you send the shopper to PayPal, then create a pending order in PayPal - and you can capture the funds months later.

For the problem you're describing, it sounds like the delayed capture flow is the best fit.

The full API is here: https://developers.bluesnap.com/v8976-JSON/docs/update-paypal-transaction, and https://developers.bluesnap.com/v8976-JSON/docs/create-paypal-transaction.

You can start off by sending a create order request (via POST):

{
    "merchantTransactionId": "testtransaction1",
    "softDescriptor": "ABC COMPANY",
    "amount": "100.00",
    "currency": "USD",
    "payer-info": {
        "firstName": "John",
        "lastName": "Doe"
     },
     "paypalTransaction": {
         "transactionType": "SET_ORDER",
         "returnUrl": "http://www.returnURL.com",
         "cancelUrl": "http://www.cancelURL.com",
         "maxAmount": "120.00"
     }
}

After this is sent the response will include a PayPal redirection URL and the BlueSnap order ID (save for later). Send your shopper there.

After the shopper has returned from PayPal and you are sure you want to set a pending order (and for how much) send this request (via PUT):

{
    "amount": "105.00",
    "currency": "USD",
    "paypalTransaction": {
        "orderId": "4006145",
        "transactionType": "DO_ORDER"
    }
}

The order ID in this request was provided in the first step. Now you can wait until your product has arrived and is ready for shipping. Once it's shipped (which can be weeks after step 2) you can send the capture request to get the money (via PUT):

{
    "amount": "104.00",
    "currency": "USD",
    "paypalTransaction": {
        "orderId": "4006145",
        "transactionType": "CAPTURE"
    }
}

Note: you cannot capture for more money than you send in step 2 - so consider the potential surcharges when you're creating the pending order!

Hope it helped :)