How do I programmatically set the payment_options?
Here is the value of payment_options/payment gateway json from a manually created invoice. The payment options works.
What is the syntax to set these programatically?
- "payment_options": {
- "payment_gateways": [
- "{\"configured\":true,\"can_show_billing_address\":false,\"additional_field1\":\"standard\",\"is_bank_account_applicable\":false,\"can_pay_using_new_card\":true,\"gateway_name\":\"paypal\"}",
- "{\"configured\":true,\"can_show_billing_address\":false,\"is_bank_account_applicable\":false,\"can_pay_using_new_card\":true,\"gateway_name\":\"payments_pro\"}"
- ]
- },
Here's my code:
- invoice.put("customer_id",customerid);
- invoice.put("zcrm_potential_id",deal_id);
- invoice.put("date",today);
- invoice.put("line_items",invoice_line_item);
- invoice_custom_fields_list = List();
- invoice_custom_fields_map = Map();
- invoice_custom_fields_map.put("api_name","cf_estimated_ship_date");
- invoice_custom_fields_map.put("value",zoho.currentdate.addWeek(production_weeks));
- invoice_custom_fields_list.add(invoice_custom_fields_map);
- invoice.put("custom_fields",invoice_custom_fields_list);
- params = Map();
- params.put("JSONString",invoice);
- if(create_invoice == true)
- {
- response = invokeurl
- [
- url :"https://books.zoho.com/api/v3/invoices?organization_id=" + books_organization_ID
- type :POST
- parameters:params
- connection:"books_invoices_create"
- ];
- info response;
- invoice_id = response.get("id");
- // End Create Invoice in Books
- // Attach Invoice Final pdf
- url = "https://invoice.zoho.com/api/v3/invoices/" + invoice_id + "/attachment";
- }