Gravity Forms Checkout for Easy Digital Downloads
1.2.1
Integrate Gravity Forms purchases with Easy Digital Downloads
|
Public Member Functions | |
__construct () | |
init () | |
get_payment_status_from_gf_status ($status) | |
get_download_options_from_entry ($entry, $field, $download_id, $product, $option_name= '', $option_price=0) | |
get_form_field_by_id ($id, $form) | |
get_edd_data_array_from_entry ($entry, $form) | |
get_user_info ($form, $entry) | |
send_purchase_to_edd ($entry=null, $form) | |
post_payment_callback ($entry=array(), $action=array(), $result=true) | |
Public Attributes | |
const | version = '1.2.1' |
const | name = 'Gravity Forms Checkout' |
Plugin Name: Easy Digital Downloads - Gravity Forms Checkout Plugin URI: http://katz.co/downloads/edd-gf/ Description: Integrate Gravity Forms purchases with Easy Digital Downloads Author: Katz Web Services, Inc. Version: 1.2.1 Requires at least: 3.0 Author URI: http://katz.co License: GPL v3 Text Domain: edd-gf Domain Path: languages
KWS_GF_EDD::__construct | ( | ) |
Set constants, load textdomain, and trigger init() KWS_GF_EDD::init()
KWS_GF_EDD::get_download_options_from_entry | ( | $entry, | |
$field, | |||
$download_id, | |||
$product, | |||
$option_name = '' , |
|||
$option_price = 0 |
|||
) |
Returns an options
array for a download with variations.
This takes the submitted entry, the original GF form, and the EDD price variations and searches for matches to the price ID and the related amounts.
array | $entry | GF Entry array |
array | $field | GF Field array |
int | $download_id | The Download ID of the parent EDD download |
float | int | $field_id | The ID of the current field being processed |
amount
and price_id
keys. KWS_GF_EDD::get_edd_data_array_from_entry | ( | $entry, | |
$form | |||
) |
Take the submitted GF entry and form and generate an array of data for a new EDD order
This is the work horse for the plugin. It processes an array with the keys: cart_details
, user_info
, downloads
.
KWS_GF_EDD::get_form_field_by_id | ( | $id, | |
$form | |||
) |
Get a field array from a Gravity Forms form by the ID of the field
string | int | $id | Number of the field ID |
array | $form | Gravity Forms form array |
KWS_GF_EDD::get_payment_status_from_gf_status | ( | $status) |
Make GF and EDD statuses match
pending
. Passes default and $status
arguments. edd_gf_payment_status Override the status when there is a match. Passes matched value and $status
arguments. KWS_GF_EDD::get_user_info | ( | $form, | |
$entry | |||
) |
Get user info from the entry
array | $form | Gravity Forms form array |
array | $entry | Gravity Forms entry array |
KWS_GF_EDD::init | ( | ) |
Include the admin script and non-admin hooks
Check for plugin updates. Built into EDD version 1.9+
KWS_GF_EDD::post_payment_callback | ( | $entry = array() , |
|
$action = array() , |
|||
$result = true |
|||
) |
Update the payment status after payment is modified in Gravity Forms
$action = array( 'type' => 'cancel_subscription', // required 'transaction_id' => '', // required (if payment) 'subscription_id' => '', // required (if subscription) 'amount' => '0.00', // required (some exceptions) 'entry_id' => 1, // required (some exceptions) 'transaction_type' => '', 'payment_status' => '', 'note' => '' );
array | $entry | Gravity Forms entry array |
array | $action | Array describing the action (see method description above) |
boolean | $result | Whether the update was successful in GF edd_update_payment_status() |
KWS_GF_EDD::send_purchase_to_edd | ( | $entry = null , |
|
$form | |||
) |
Take a GF submission and add a purcase to EDD.
This converts the GF submission to an EDD order.
GFFormsModel::get_lead() KWS_GF_EDD::get_edd_data_array_from_entry() KWS_GF_EDD::get_payment_status_from_gf_status() edd_update_payment_status() GFCommon::to_number() edd_insert_payment() edd_insert_payment_note()
array | $entry | GF Entry array |
array | $form | GF Form array |