0

I am trying to get payments set up with Stripe using the Java eSignature REST API.

There are many different examples online and I've tried several of them. I can get the "Pay Now" button to appear on the sent document, but every time it's clicked it pops up an Error box: "Payment set up failed".

I am also putting the field at an anchor text in a composite template, if that's pertinent.

What area of the setup should I be looking at to determine why "set up" failed?

I am using a test Stripe account created using "Skip this account form" as indicated by https://developers.docusign.com/esign-rest-api/code-examples/code-example-payments

                Number numberTab = new Number()
                .value("250")
                .tabLabel("numberTab")
                .anchorString("LineItemTest")
                .anchorIgnoreIfNotPresent("false")
                .anchorXOffset("1")
                .anchorYOffset("0")
                .anchorUnits("inches")
                .documentId(tCompositeTemplate.getDocument().getDocumentId());
    
                PaymentLineItem lineItem = new PaymentLineItem()
                        .name("PaymentAmount1")
                        .description("Set payment Amount")
                        .amountReference("numberTab");

                PaymentDetails payDetails = new PaymentDetails()
                        .total(total)
                        .gatewayAccountId(<the gateway account id on the Docusign Payments page for my Stripe account>)
                        .currencyCode("USD")
                        .gatewayDisplayName("Stripe")
                        .addLineItemsItem(lineItem)
                        .status("new");
 
                FormulaTab formulaPayment = new FormulaTab()
                        .tabLabel("\\*PaymentTest")
                        .formula("550")
                        .roundDecimalPlaces("2")
                        .paymentDetails(payDetails)
                        .isPaymentAmount("true")
                        .required("true")
                        .locked("true")
                        .hidden("false")
                        .documentId(tCompositeTemplate.getDocument().getDocumentId())
                        .anchorString("PaymentTest")
                        .anchorIgnoreIfNotPresent("false")
                        .anchorXOffset("1")
                        .anchorYOffset("0")
                        .anchorUnits("inches")
                        .recipientId("1");

Saul
  • 73
  • 1
  • 8

2 Answers2

0

Saul, I suggest you try either one of these app. The purpose is that you try to see you can use the feature with someone's else code. It appears to me you set up your payment gateway incorrectly. So, when you go to either one of these apps, ensure you log in with YOUR account, the same one you use to test the above (in demo/developer sandbox). MySure or MyUni. Select the option at the right of either app and do not select "Continue with a preconfigured login" but instead select "Log in with your DocuSign developer account" and proceed to login. After that, see if you can complete the payment with the signature. I suspect whatever issue you see in your app will present itself. I would go back and configure my payment gateway again based on these instructions to fix the issue. If you are still stuck - let me know and I'll help.

Inbar Gazit
  • 12,566
  • 1
  • 16
  • 23
  • Inbar, I used the instructions on that page and from within https://admindemo.docusign.com/payments if I test the Stripe connection I get the green success box. I am not familiar with the esigndemos.com domain and am hesitant to provide it with my credentials. – Saul Aug 25 '20 at 01:41
  • A-ha! I think I know the issue. It turns out that in my Stripe account, I have more information to fill out. But this includes information like my SSN. As a developer, I don't want to have to do this. And Docusign says I don't have to, on the page I linked to in the OP Step 1 Item 3. But that option is not available to me. Any ideas? – Saul Aug 25 '20 at 13:00
  • You don't need to submit your SSN for a stripe test account. But you do for a production Stripe account. A finance or business person in your company is typically the person to create a production stripe account. – Larry K Aug 25 '20 at 13:02
  • I finally found the option to use a Stripe test account. And yet I am still getting the same "Payment set up failed" error :( – Saul Aug 25 '20 at 13:17
  • I wonder if you need to start with a new developer/demo account. It's possible you're still somehow using the stripe account that wasn't a test account and wasn't property configured. – Inbar Gazit Aug 25 '20 at 15:30
  • I deleted the original Stripe account payment method and there are output debugs that show I'm using the new one. If Docusign is using something else it makes me very nervous. Yet I do understand what you're saying. – Saul Aug 25 '20 at 15:52
  • I'm not sure, I have not had this happen to me, so was hoping you can start clean, from scratch, just in case. – Inbar Gazit Aug 25 '20 at 16:15
0

You can also start with the payments example (example 14) from the Java code examples

Another technique for payments is to first use the DocuSign web app to create a working envelope that includes the payment feature.

Then change the envelope to a template and use the template in your API application. (Create an envelope from a template using the API.) The benefit of this method is that later on, it is easier to change the template from the web app then to change your API program.

Larry K
  • 47,808
  • 15
  • 87
  • 140
  • Larry, I did base the payment info on those examples but we already have working signature functionality and I just need to add payments to it. I can't re-engineer the project. Do you see anything in the code I provided that looks wrong in how I've set it up? – Saul Aug 25 '20 at 01:44