Lakshmi Priya.K
Lakshmi Priya.K

Reputation: 187

How to test capture payment and accept payment in Paypal sandbox?

I have redirected my customers to PayPal payment gateway by using the following form. It’s working properly.

    <form:input path="cmd" id="cmd" name="cmd" type="hidden" />
    <form:input path="business" id="business" name="business" type="hidden" />
    <form:input path="password" id="password" name="password" type="hidden" />
    <form:input path="custom" id="custom"  name="custom" type="hidden" />
    <form:input path="item_name" id="item_name" name="item_name" type="hidden" />
    <form:input path="amount"  id="amount" name="amount" type="hidden" />
    <form:input path="currencyCode" type="hidden" name="currency_code" value="EUR" />
    <form:input path="rm"  id="rm" name="rm" type="hidden" />
    <%-- <form:input path="returnUrl"  id="return" name="return" type="hidden" /> --%>
    <input type="hidden" name="return" value="${paymentForm.returnUrl}" />
    <form:input type="hidden" name="cancel_return" path="cancel_return" />
    <form:input type="hidden" name="cert_id" path="certId" />
   <!-- <input type="submit" value="Proceed with Payment" id="submit2" name="SUBMIT2"/>  -->
    </form:form>

Now I want to Implement the following features

  • I want to hold the payment from customer for one day
  • It means, block the money in customer account but not transferred to my account
  • Accept the payment after one day from when were customer actually paid
  • I send one Http request to PayPal to transfer money from customer account to my account.

    Thanks in Advance,
    Lakshmi Priya.K

    Upvotes: 2

    Views: 515

    Answers (1)

    Robert
    Robert

    Reputation: 19356

    Sounds like you'll want to implement an authorization & capture flow. For Website Payments Standard (and PayPal API-based products), you'll want to specify a 'payment action'.
    By default, all transactions are marked as 'Sale', which means they're settled right away.

    By setting a 'payment action' of 'authorization', the transactions creates an authorization on the buyer's funding source. PayPal guarantees a default honour period on authorization of three days.
    Authorizations are valid for 29 days, however, after 3 days we can no longer guarantee the funds will always be available.

    To set a payment action in Payments Standard, you will pass; <input type="hidden" name="paymentaction" value="authorization">

    For API-based payments, I would recommend verifying it against the API reference of the product you're attempting to integrate.

    For more information on authorizations, take a look at 'Using Authorization & Capture' on the developer portal.

    Upvotes: 2

    Related Questions