What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    How do I let the custumer change the quantity of a product in the payment form in android app

    Asked by Limor  on June 14, 2015 at 04:23 AM

    HI

    I'm writing an android app.

    I succeed adding a paypal button to it, but I don't know how to make two fields configurable by custumer:

    * product quantity

    * costumer address

     

    this is my  code so far:

     

    public void PayPalButtonClick(View v) {
    PayPalPayment newPayment = new PayPalPayment();
    newPayment.setCurrencyType("ILS");
    newPayment.setRecipient("momilk.israel@gmail.com");
    newPayment.setMerchantName("Picasso and PayPal");

    PayPalInvoiceData invoice = new PayPalInvoiceData();
    PayPalInvoiceItem item1 = new PayPalInvoiceItem();
    // Sets the name of the item.
    item1.setName(milk_bags_name[_value]);
    // Sets the total price which should be (quantity * unit price). The total prices of all PayPalInvoiceItem should add up
    // to less than or equal the subtotal of the payment.
    item1.setTotalPrice(milk_bags_cost[_value]);
    // Sets the unit price.
    item1.setUnitPrice(milk_bags_cost[_value]);
    // Sets the quantity.
    //item1.setQuantity(1);
    // Add the PayPalInvoiceItem to the PayPalInvoiceData. Alternatively, you can create an ArrayList<PayPalInvoiceItem>
    // and pass it to the PayPalInvoiceData function setInvoiceItems().
    invoice.getInvoiceItems().add(item1);

    invoice.setShipping(shipping_cost[_value]);

    BigDecimal st = milk_bags_cost[_value];
    st.add(shipping_cost[_value]);
    newPayment.setSubtotal(st);


    newPayment.setInvoiceData(invoice);

    Intent checkoutIntent = PayPal.getInstance().checkout(newPayment, this /*, new ResultDelegate()*/);



    // Use the android's startActivityForResult() and pass in our
    // Intent.
    // This will start the library.
    this.startActivityForResult(checkoutIntent, REQUEST_PAYPAL_CHECKOUT);


    //Intent paypalIntent = PayPal.getInstance().checkout(newPayment, this);
    //this.startActivityForResult(paypalIntent, 1);

    }
    payment form Android quantity app
  • Profile Image

    (Private)

    Answered by kapilshashtri  on June 14, 2015 at 05:44 AM

    Love problem solutionbaba ji

  • Profile Image
    JotForm Support

    Answered by Mike_G on June 14, 2015 at 01:46 PM

    I would like to apologize, but I'm sure I am not understanding what you want here. Well, I understand that you would like to create an Android App that has a Payment form and you would like to include a Quantity field for customers to select the quantity of the product they are purchasing.

    I'm not sure what the codes(included in your post) are for. I think this is what you would like to know: How-to-add-options-to-Payment-Forms

    You can create a Form here with JotForm and integrate Paypal with it. You can then open that form using your Android device's web browser.

    Setting-Up-Your-First-Order-Form

    Let us know how else we can be of assistance to you. Looking forward to your response. Thank you.