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

  • Profile Image
    Asked on June 14, 2015 at 04:23 AM


    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.setMerchantName("Picasso and PayPal");

    PayPalInvoiceData invoice = new PayPalInvoiceData();
    PayPalInvoiceItem item1 = new PayPalInvoiceItem();
    // Sets the name of the item.
    // 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.
    // Sets the unit price.
    // Sets the quantity.
    // Add the PayPalInvoiceItem to the PayPalInvoiceData. Alternatively, you can create an ArrayList<PayPalInvoiceItem>
    // and pass it to the PayPalInvoiceData function setInvoiceItems().


    BigDecimal st = milk_bags_cost[_value];


    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);

  • Profile Image
    Answered 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.


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