Can I sell PayPal product with BlueSnap and charge it later that day for additional cost?

76 Views Asked by At

I use BlueSnap API to sell products, using PayPal. In my website, I send the shoppers to PayPal without them filling-in any shipping details - once they log in to PayPal I get those details from their BlueSnap account.

But the problem is that I don't know where the shoppers are located before sending them to PayPal, so there's the issue of shipping and tax that may need to be added on top of the product price.

Is there any way for me to send the shopper to PayPal for a certain amount – let's say $50 - and later according to the shipping details add a $7 surcharge without the shopper re-approving the deal?

I usually use this Payment API call:

{
    "amount": 50,
    "softDescriptor": "My SD",
    "currency": "USD",
    "paypalTransaction": {
        "cancelUrl": "http://www.cancelURL.com",
        "returnUrl": "http://www.returnURL.com"
    },
    "transactionFraudInfo": {"fraudSessionId": 1234}
}

There's no obvious spot for potential surcharge, so I'm not sure if that's even possible – and what are the limitations? I read this documentation and couldn't get a clear picture. https://developers.bluesnap.com/v8976-JSON/docs/create-paypal-transaction

I'd appreciate any help!

1

There are 1 best solutions below

1
On BEST ANSWER

BlueSnap has a few flows to handle PayPal purchases – and from what you're describing, it looks like the split-step PayPal flow should work for you. When you send the request via the API, simply send this (POST):

{
    "merchantTransactionId": "mysurchagetransaction",
    "softDescriptor": "SOFTDESC",
    "amount": "50.00",
    "currency": "USD",
    "payerInfo": {
        "firstName": "John",
        "lastName": "Doe"
     },
     "paypalTransaction": {
         "transactionType": "AUTH_ONLY",
         "returnUrl": "http://www.returnURL.com",
         "cancelUrl": "http://www.cancelURL.com",
         "maxAmount": "70.00"
    }
}

The $70 is your limit – you can go as high as 40% more than the amount, otherwise BlueSnap will not allow the transaction. The idea is that at this point, you want to send the Shopper to PayPal for a $50 purchase – but you expect a potential surcharge once you know where they're from, up to $70 potentially. The response to this API call will include the order ID (keep it for later!), as well as the usual redirect link to PayPal. Your shopper will be redirected there, approve $50 and then be redirected again to your returnURL (your website).

When the shopper returns, you get a BlueSnap shopper ID – and it will have all the shipping data taken from PayPal. To look at the data, you can retrieve the shopper the usual way: https://developers.bluesnap.com/v8976-JSON/docs/retrieve-vaulted-shopper.

Now comes the second step, which is recommended to take place within a few hours (PayPal has a time window). You consider the shopper's shipping address for tax/shipping surcharges, and then you send this capture funds API call (PUT):

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

Note that you chose to charge $58, so you didn't use your full $70 max amount. That's fine, and the shopper will have no record in PayPal of the $70 you considered charging – just the $58. Also, the shopper didn't have to re-approve the purchase, or login again to PayPal. Although it isn't mandatory, I would recommend you tell the shopper the amount you plan to charge when they return to your website – if it's applicable to the flow of your site.

I hope I helped!