本文整理汇总了PHP中DataForm::GetFieldByName方法的典型用法代码示例。如果您正苦于以下问题:PHP DataForm::GetFieldByName方法的具体用法?PHP DataForm::GetFieldByName怎么用?PHP DataForm::GetFieldByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataForm
的用法示例。
在下文中一共展示了DataForm::GetFieldByName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: RedirectToGateway
/**
* Redirect user to gateway payment form, using HTTP 'Location:' header or UI::RedirectPOST($host, $values);
*
* @param float $amount Purchase amount
* @param Order $order Order object
* @param array $post_values Array of fields, posted back by your payment form. Array keys are equal to field names you returned in IPaymentModule::GetPaymentForm()
* @return void
*/
public function RedirectToGateway(Order $order, $post_values = array())
{
$host = "https://merchant.webmoney.ru/lmi/payment.asp";
$params = array('LMI_PAYMENT_NO' => $order->ID, 'LMI_PAYEE_PURSE' => $this->Config->GetFieldByName('Purse')->Value, 'LMI_PAYMENT_AMOUNT' => number_format($order->GetBillingTotal(), 2, '.', ''), 'LMI_PAYMENT_DESC' => $order->Description, 'LMI_SIM_MODE' => $this->Config->GetFieldByName('TestPaymentSuccess')->Value ? '0' : '1', 'LMI_RESULT_URL' => CONFIG::$IPNURL);
if ($post_values['return_url']) {
$params['LMI_SUCCESS_URL'] = $post_values['return_url'];
}
UI::RedirectPOST($host, $params);
exit;
}
示例2: PostBack
/**
* Send postback to PayPal server
* @return string $res
*/
private final function PostBack($request)
{
$params = array(
"Method" => "order_synchro",
"Identifier" => $this->Config->GetFieldByName("MerchantIdentifier")->Value,
"Usrname" => $this->Config->GetFieldByName("Username")->Value,
"Pwd" => $this->Config->GetFieldByName("Password")->Value,
"tnxid" => $request['tnxid'],
"checksum" => $request['checksum'],
"parity" => $request['parity']
);
$req = http_build_query($params);
$postback_url = "https://www.monsterpay.com/secure/components/synchro.cfc?wsdl&{$req}";
Log::Log(sprintf("Sending Postback: %s", $postback_url), E_USER_NOTICE);
return @file_get_contents($postback_url);
}
示例3: deleteContact
function deleteContact () {
$title = 'Delete one of your contacts.';
try {
$dataTemplate = array(
'name' => 'Harald Frøland',
'street1' => 'Rådhusgata 1-3',
'street2' => 'Akersgaten 42 (H-blokk)',
'pc' => 'NO-8005',
'city' => 'Bodø',
'sp' => 'Nordland',
'cc' => 'NO',
'email' => $this->testConf->GetFieldByName('RealEmail')->Value,
'voice' => '+22.123456',
'fax' => '+22.123457'
);
$contact = $this->registry->NewContactInstanceByGroup('generic');
$contact->SetFieldList($dataTemplate);
$resp = $this->module->CreateContact($contact);
$contact->CLID = $resp->CLID;
$resp = $this->module->DeleteContact($contact);
$this->assertTrue($resp->Succeed(), $title);
} catch (RegistryException $e) {
$this->fail($title);
}
}
示例4: ProcessPayment
/**
* This method is called when user submits a payment form.
* @param float $amount Purchase amount
* @param int $orderid Order ID. Can be used as an unique identifier.
* @param string $payment_for Human-readable description of the payment
* @param array $post_values Array of fields, posted back by your payment form. Array keys are equal to field names you returned in IPaymentModule::GetPaymentForm()
* @return bool True if payment succeed or false if failed. If payment is failed and you return false, $this->GetFailureReason() will also be called.
*/
public final function ProcessPayment(Order $order, $post_values = array())
{
$this->OrderID = $order->ID;
// Generate Merchant Reference
$merchant_reference = "REF ".implode("", explode(" ", microtime()));
// Amount in cents.
$amount = (int)($order->GetBillingTotal()*100);
// Generate Request.
$request = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<JProxyPayLink>
<Message>
<Type>PreAuth</Type>
<Authentication>
<MerchantID>{$this->Config->GetFieldByName("merchantID")->Value}</MerchantID>
<Password>{$this->Config->GetFieldByName("password")->Value}</Password>
</Authentication>
<OrderInfo>
<Amount>{$amount}</Amount>
<MerchantRef>{$merchant_reference}</MerchantRef>
<MerchantDesc>".htmlspecialchars($order->Description)."</MerchantDesc>
<Currency>{$this->Config->GetFieldByName("csymbol")->Value}</Currency>
<CustomerEmail>{$post_values["email"]}</CustomerEmail>
<Var1>InvoiceID: {$order->ID}</Var1>
<Var2 />
<Var3 />
<Var4 />
<Var5 />
<Var6 />
<Var7 />
<Var8 />
<Var9 />
</OrderInfo>
<PaymentInfo>
<CCN>{$post_values["ccn"]}</CCN>
<Expdate>{$post_values["Expdate_m"]}{$post_values["Expdate_Y"]}</Expdate>
<CVCCVV>{$post_values["cvv"]}</CVCCVV>
<InstallmentOffset>0</InstallmentOffset>
<InstallmentPeriod>0</InstallmentPeriod>
</PaymentInfo>
</Message>
</JProxyPayLink>
";
Log::Log("ProxyPay3 request: " . $request, E_USER_NOTICE);
if ($this->Config->GetFieldByName("isdemo")->Value == 1)
$URL = "https://eptest.eurocommerce.gr/proxypay/apacsonline";
else
$URL = "https://ep.eurocommerce.gr/proxypay/apacsonline";
try
{
$ch = curl_init();
// Enable SSL
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,1);
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_HEADER, 0);
$params = array("APACScommand" => "NewRequest", "Data" => $request);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
if (!$error)
{
Log::Log(sprintf(_("ProxyPay3 response: %s"), $response), E_USER_NOTICE);
$response = simplexml_load_string($response);
if (!$response || intval($response->ERRORCODE) != 0)
$this->FailureReason = sprintf(_("Cannot proceed request. Error code: %s. Please contact Administrator."), $response->ERRORCODE);
else
$result = true;
}
else
$this->FailureReason = sprintf(_("Request to ProxyPay3 failed: %s"), $error);
}
catch (Exception $e)
{
$this->FailureReason = sprintf(_("Request to ProxyPay3 failed: %s"), $e->getMessage());
}
//.........这里部分代码省略.........
示例5: SetUp
function SetUp(DataForm $DF)
{
// User input and initialized by EPP-DRS in real test
$TestConf = AfiliasRegistryModule::GetTestConfigurationForm();
$test_conf = $TestConf->ListFields();
$test_conf['RegistrarID']->Value = '5080-BD';
$test_conf['ServerHost']->Value = 'inforfcote2.afilias.net';
$test_conf['ServerPort']->Value = '700';
$test_conf['Login-1']->Value = 'ClientB';
$test_conf['Password-1']->Value = 'foo-BAR2';
$test_conf['Password-1n']->Value = 'bar-FOO2';
// New password
// Initialize registry
$ModuleConf = AfiliasRegistryModule::GetConfigurationForm();
$module_conf = $ModuleConf->ListFields();
$module_conf['RegistrarID']->Value = $test_conf['RegistrarID']->Value;
$module_conf['ServerHost']->Value = $test_conf['ServerHost']->Value;
$module_conf['ServerPort']->Value = $test_conf['ServerPort']->Value;
$module_conf['Login']->Value = $test_conf['Login-1']->Value;
$module_conf['Password']->Value = $test_conf['Password-1']->Value;
$module_conf['SSLCertPath']->Value = $DF->GetFieldByName('SSLCertPath')->Value;
$module_conf['SSLCertPass']->Value = $DF->GetFieldByName('SSLCertPass')->Value;
$manifest_path = MODULES_PATH . "/registries/Afilias/module.xml";
$this->Module = new AfiliasRegistryModule(new RegistryManifest($manifest_path));
$this->Module->InitializeModule("info", $ModuleConf);
$this->Registry = new Registry($this->Module);
$this->module_conf = $module_conf;
$this->test_conf = $test_conf;
$this->C2 = $this->Registry->NewContactInstance(CONTACT_TYPE::REGISTRANT);
$this->C2->CLID = 'EPPOTE-C2';
$this->C3 = $this->Registry->NewContactInstance(CONTACT_TYPE::ADMIN);
$this->C3->CLID = 'EPPOTE-C3';
$this->C4 = $this->Registry->NewContactInstance(CONTACT_TYPE::BILLING);
$this->C4->CLID = 'EPPOTE-C4';
$this->C5 = $this->Registry->NewContactInstance(CONTACT_TYPE::TECH);
$this->C5->CLID = 'EPPOTE-C5';
$this->NSList = array(new Nameserver('ns1.eppvalid.info'), new Nameserver('ns2.eppvalid.info'));
}
示例6: RunTest
/**
* Enter description here...
*/
public function RunTest(DataForm $DF)
{
$filename = '/tmp/eppdrs-verisign-certtest-' . date('YmdHis') . '.log';
Log::RegisterLogger("File", "Verisign", $filename);
Log::SetDefaultLogger("Verisign");
// Build dataforms for modules
$DF1 = self::GetConfigurationForm();
$DF1->GetFieldByName('Login')->Value = $DF->GetFieldByName('Login_1')->Value;
$DF1->GetFieldByName('Password')->Value = $DF->GetFieldByName('Password_1')->Value;
$DF1->GetFieldByName('ServerHost')->Value = $DF->GetFieldByName('ServerHost')->Value;
$DF1->GetFieldByName('ServerPort')->Value = $DF->GetFieldByName('ServerPort')->Value;
$DF1->GetFieldByName('SSLCertPath')->Value = $DF->GetFieldByName('SSLCertPath')->Value;
$DF1->GetFieldByName('SSLCertPass')->Value = $DF->GetFieldByName('SSLCertPass')->Value;
$DF2 = self::GetConfigurationForm();
$DF2->GetFieldByName('Login')->Value = $DF->GetFieldByName('Login_2')->Value;
$DF2->GetFieldByName('Password')->Value = $DF->GetFieldByName('Password_2')->Value;
$DF2->GetFieldByName('ServerHost')->Value = $DF->GetFieldByName('ServerHost')->Value;
$DF2->GetFieldByName('ServerPort')->Value = $DF->GetFieldByName('ServerPort')->Value;
$DF2->GetFieldByName('SSLCertPath')->Value = $DF->GetFieldByName('SSLCertPath')->Value;
$DF2->GetFieldByName('SSLCertPass')->Value = $DF->GetFieldByName('SSLCertPass')->Value;
// Initialize modules
$Module = new VerisignRegistryModule(new RegistryManifest(MODULES_PATH . "/registries/Verisign/module.xml"));
$Module->InitializeModule('com', $DF1);
$Registry = new Registry($Module);
$Module2 = new VerisignRegistryModule(new RegistryManifest(MODULES_PATH . "/registries/Verisign/module.xml"));
$Module2->InitializeModule('com', $DF2);
$Registry2 = new Registry($Module2);
// The subject domain
$Domain = $this->RegistryAccessible->NewDomainInstance();
$Domain->Name = 'webta' . rand(1000, 9999);
$Domain->UserID = 1;
////
// 1. Using your OT&E1 account perform a CHECK command on domain name(s) until you
// receive domain available response
$oplog = array();
$op = array('title' => 'Perform a CHECK command on domain name(s)');
try {
$ok = $Registry->DomainCanBeRegistered($Domain)->Result;
$op['ok'] = (bool) $ok;
} catch (Exception $e) {
$op['ok'] = false;
$op['fail_reason'] = $e->getMessage();
}
$oplog[] = $op;
////
// 2. CREATE the Domain name using the CREATE command, term of registration should be
// 2 years
$op = array('title' => "CREATE the Domain name using the CREATE command");
try {
$Contact = $Registry->NewContactInstanceByGroup('generic');
$Domain->SetContact($Contact, CONTACT_TYPE::REGISTRANT);
$Domain->SetContact($Contact, CONTACT_TYPE::BILLING);
$Domain->SetContact($Contact, CONTACT_TYPE::TECH);
$Domain->SetContact($Contact, CONTACT_TYPE::ADMIN);
$Registry->CreateDomain($Domain, 2);
$op['ok'] = true;
} catch (Exception $e) {
$op['ok'] = false;
$op['fail_reason'] = $e->getMessage();
}
$oplog[] = $op;
////
// 3. CREATE 2 child name servers of newly created domain
//
$op = array('title' => "CREATE 2 child name servers of newly created domain");
try {
$ns1 = new NameserverHost('ns1.' . $Domain->GetHostName(), gethostbyname('hostdad.com'));
$ns2 = new NameserverHost('ns2.' . $Domain->GetHostName(), gethostbyname('hostdad.com'));
$Registry->CreateNameserverHost($ns1);
$Registry->CreateNameserverHost($ns2);
$op['ok'] = true;
} catch (Exception $e) {
$op['ok'] = false;
$op['fail_reason'] = $e->getMessage();
}
$oplog[] = $op;
////
// 4. UPDATE Domain to attach child name servers to domain
//
$op = array('title' => "UPDATE Domain to attach child name servers to domain");
try {
$nslist = $Domain->GetNameserverChangelist();
$nslist->Add($ns1);
$nslist->Add($ns2);
$Registry->UpdateDomainNameservers($Domain, $nslist);
$op['ok'] = count($Domain->GetNameserverList()) == 2;
} catch (Exception $e) {
$op['ok'] = false;
$op['fail_reason'] = $e->getMessage();
}
$oplog[] = $op;
////
// 5. UPDATE Domain's status to
// clientHold, clientUpdateProhibited, clientDeleteProhibited, and clientTransferProhibited
// within one command
$op = array('title' => "UPDATE Domain's status");
try {
//.........这里部分代码省略.........