Need help in integration, please help

deepakboriya
Contributor
Contributor

I am desinging an application in which I will be accepting guest credit/debit cards only without paypal account. So I read few documents of paypal and came across two solutions.

1. Paypal payment pro

2. Braintree

I have read both of them but I got couple of doubts.

In braintree, If I process the transaction then I get submitted_for_settlement status from braintree and same transaction get settled after few hours. I have to process some thing at my server after I receive settled status from braintree. So How can I get notified once its transation got settled at braintree gateway.

In Paypal payment pro, I have done the same stuff with paypal payment pro as well but am unable to get status of settled transaction. 

I can't use email notification because I have to process some logic at my server. Can I use webhooks to get notified once credit/debit card transaction get settled at paypal end. Could you please help me?

Login to Me Too
3 REPLIES 3

MTS_Andre
Moderator
Moderator

Hi, in most of the cases the settlement will work so you don't really need to check the status but in case you could either use the disbursement webhook or run a batch on your server calling Transaction.Find() and check the status of the settlement.

Login to Me Too

deepakboriya
Contributor
Contributor

Hi, I tried disbursement webhook but it didn't work for me. Could please help me with that.

I did below steps
1. I did transaction with dummy credit card 4111 XXXX XXXX 1111 on my application. I could see the same at my braintree control panel which was in submitted for settlement status.
2. I created a disbursement webhook on control panel and provided ngrok https URL to call my local machine once that transaction got settled. I cross verified the webhook by clicking "check URL" hyperlink on control panel and I got success(http code =200)response as well.
3. I wrote below piece of code at my code(in java) to accept the webhook call
@RequestMapping(value="/disbursementWebhook",method=RequestMethod.POST, consumes=MediaType.APPLICATION_JSON_VALUE)
@ResponseStatus(HttpStatus.OK)
public void disbursementWebhookTesting(/*@RequestParam(value="signature", required=false)String signature, @RequestParam(value="payload", required=false)String payload*/){
System.out.println("Disbursement Webhook Testing called...");
HashMap<String, String> sampleNotification = gateway.webhookTesting().sampleNotification(
WebhookNotification.Kind.DISBURSEMENT, "<my sandbox id>"
);
WebhookNotification webhookNotification = gateway.webhookNotification().parse(sampleNotification.get("bt_signature"), sampleNotification.get("bt_payload"));
System.out.println(webhookNotification.getDisbursement().toString());
}
4. After couple of hours, I could see that transaction got settled on control panel but I didn't receive webhook notification on my local machine.
Am I doing something wrong or missing something ?
Please help...

Login to Me Too

MTS_Andre
Moderator
Moderator

Hi, in this case Sandbox won't trigger disbursement webhooks as thre isn't any disbursement on Sandbox. You can eventually get more details contacting the Braintree Team: Braintreepayments Contact

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.