You are here

function paymentreference_page in Payment 7

Return a payment page for a field instance.

Parameters

array $instance:

Return value

array A Drupal build array.

1 string reference to 'paymentreference_page'
paymentreference_menu in modules/paymentreference/paymentreference.module
Implements hook_menu().

File

modules/paymentreference/paymentreference.module, line 446
Hook implementations and general functions.

Code

function paymentreference_page(array $instance) {
  $payment = new Payment(array(
    'context_data' => array(
      'paymentreference' => TRUE,
      'entity_type' => $instance['entity_type'],
      'bundle' => $instance['bundle'],
      'field_name' => $instance['field_name'],
    ),
    'currency_code' => $instance['settings']['currency_code'],
    'description' => $instance['settings']['description'],
    'finish_callback' => 'paymentreference_payment_finish',
  ));

  // @todo Description should be US English, but can be anything.
  $payment
    ->setLineItem(new PaymentLineItem(array(
    'amount' => $instance['settings']['amount'],
    'description' => $instance['settings']['description'],
    'name' => 'paymentreference',
  )));
  return drupal_get_form('payment_form_standalone', $payment);
}