xmlwordpresschargify

Chargify XML for Custom Field Wordpress


I am using chargify plugin. I want added a custom field in chargify account want to save data using XML.

Presently XML is like which is used to send data to chrgify:-

<?xml version="1.0" encoding="UTF-8"?>
        <subscription>
            <product_id>' . $_POST["submit"] . '</product_id>
            <customer_attributes>
            <first_name>'.$_POST["chargifySignupFirst"].'</first_name>
            <last_name>'.$_POST["chargifySignupLast"].'</last_name>
            <email>'.$_POST["chargifySignupEmail"].'</email>
        </subscription>

Please let me know how to add custom field in this xml so that it automatically get saved in chargify.

Thanks in advance.


Solution

  • This is the format for custom fields in XML:

    <subscription>
      <product_handle>monthly-plan</product_handle>
      [...]
      <metafields>
        <color>blue</color>
        <size>large</size>
      </metafields>
    </subscription>