本文整理汇总了PHP中Merchant类的典型用法代码示例。如果您正苦于以下问题:PHP Merchant类的具体用法?PHP Merchant怎么用?PHP Merchant使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Merchant类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: capture
/**
* @param \Ilis\Bundle\PaymentBundle\Entity\Transaction\CreditCard $transaction
*/
public function capture(CreditCardTransaction $transaction)
{
if (!is_numeric($transaction->getAmount()) || $transaction->getAmount() <= 0) {
throw new Exception("Invalid amount");
}
// TODO: Check if the transaction has set the proper payment method
$request = new WsRequest();
$request->setOrder($transaction->getId());
$amount = (double) number_format($transaction->getAmount(), 2, '.', '') * 100;
$request->setAmount($amount);
$request->setOrder($transaction->getIdentifier());
$request->setMerchantCode($this->merchant->getCode());
$request->setTerminal($this->merchant->getTerminal());
$request->setCurrency($this->merchant->getCurrency());
$request->setPan($transaction->creditCard);
$request->setCvv2($transaction->cvv);
$request->setExpiryDate(sprintf("%s%s", $transaction->expiryDateYear, $transaction->expiryDateMonth));
$request->setTransactionType(WsTransaction::TYPE_AUTH);
$this->merchant->signRequest($request);
$response = $this->client->makeRequest($request);
$operation = $response->getOperation();
$authCode = $operation ? trim((string) $operation->Ds_AuthorisationCode) : null;
if ($response->isValid() && !empty($authCode)) {
$transaction->setStatus(Transaction::STATUS_SUCCESS);
$transaction->setAuthCode((string) $response->getOperation()->Ds_AuthorisationCode);
} else {
$transaction->setStatus(Transaction::STATUS_ERROR);
$transaction->setStatusCode((string) $response->getCode());
}
$transaction->setRawData($response->asXml());
}
开发者ID:3lchamac0,项目名称:IlisPaymentBundle,代码行数:34,代码来源:Redsys.php
示例2: compare
public static function compare(Merchant $a, Merchant $b)
{
if ($a->getApiKey() != $b->getApiKey()) {
return false;
}
if ($a->getEndpoint() != $b->getEndpoint()) {
return false;
}
return true;
}
开发者ID:expressly,项目名称:php-common,代码行数:10,代码来源:Merchant.php
示例3: _process_return
public function _process_return()
{
$action = $this->CI->input->get('action', TRUE);
if ($action === FALSE) {
return new Merchant_response('failed', 'invalid_response');
}
if ($action === 'success') {
return new Merchant_response('return', '', $_POST['txn_id']);
}
if ($action === 'cancel') {
return new Merchant_response('failed', 'payment_cancelled');
}
if ($action === 'ipn') {
// generate the post string from _POST
$post_string = 'cmd=_notify-validate&' . http_build_query($_POST);
$response = Merchant::curl_helper($this->settings['test_mode'] ? self::PROCESS_URL_TEST : self::PROCESS_URL, $post_string);
if (!empty($response['error'])) {
return new Merchant_response('failed', $response['error']);
}
$memo = $this->CI->input->post('memo');
if (strpos("VERIFIED", $response['data']) !== FALSE) {
// Valid IPN transaction.
return new Merchant_response('authorized', $memo, $_POST['txn_id'], (string) $_POST['mc_gross']);
} else {
// Invalid IPN transaction
return new Merchant_response('declined', $memo);
}
}
}
开发者ID:rosellkarlrossj,项目名称:FireSALE,代码行数:29,代码来源:merchant_paypal.php
示例4: _process
public function _process($params)
{
$data = array('VPSProtocol' => '2.23', 'TxType' => 'PAYMENT', 'Vendor' => $this->settings['vendor'], 'VendorTxCode' => $params['transaction_id'], 'Description' => $params['reference'], 'Amount' => sprintf('%01.2f', $params['amount']), 'Currency' => $params['currency_code'], 'CardHolder' => $params['card_name'], 'CardNumber' => $params['card_no'], 'CV2' => $params['csc'], 'CardType' => strtoupper($params['card_type']), 'ExpiryDate' => $params['exp_month'] . $params['exp_year'] % 100, 'AccountType' => 'E', 'ApplyAVSCV2' => 2);
if ($data['CardType'] == 'MASTERCARD') {
$data['CardType'] = 'MC';
}
if (!empty($params['card_issue'])) {
$data['IssueNumber'] = $params['card_issue'];
}
if (!empty($params['start_month']) and !empty($params['start_year'])) {
$data['StartDate'] = $params['start_month'] . $params['start_year'] % 100;
}
$response = Merchant::curl_helper($this->settings['test_mode'] ? self::PROCESS_URL_TEST : self::PROCESS_URL, $data);
if (!empty($response['error'])) {
return new Merchant_response('failed', $response['error']);
}
// convert weird ini-type format to a useful array
$response_array = explode("\n", $response['data']);
foreach ($response_array as $key => $value) {
unset($response_array[$key]);
$line = explode('=', $value, 2);
$response_array[trim($line[0])] = isset($line[1]) ? trim($line[1]) : '';
}
if (empty($response_array['Status'])) {
return new Merchant_response('failed', 'invalid_response');
} elseif ($response_array['Status'] == 'OK') {
return new Merchant_response('authorized', $response_array['StatusDetail'], $response_array['VPSTxId'], (double) $params['amount']);
} else {
return new Merchant_response('declined', $response_array['StatusDetail']);
}
}
开发者ID:rat4m3n,项目名称:PyroCart,代码行数:31,代码来源:merchant_sagepay_direct.php
示例5: getMerchant
public static function getMerchant()
{
if (!self::$merchant) {
$class = get_called_class();
$class = substr($class, strrpos($class, '\\') + 1);
self::$merchant = Merchant::get($class, 'object_name');
}
return self::$merchant;
}
开发者ID:krvd,项目名称:cms-Inji,代码行数:9,代码来源:MerchantHelper.php
示例6: _process
public function _process($params)
{
$fp_sequence = $params['reference'];
$time = time();
$fingerprint = AuthorizeNetSIM_Form::getFingerprint($this->settings['api_login_id'], $this->settings['transaction_key'], $params['amount'], $fp_sequence, $time);
$data = array('x_amount' => $params['amount'], 'x_delim_data' => 'FALSE', 'x_fp_sequence' => $fp_sequence, 'x_fp_hash' => $fingerprint, 'x_fp_timestamp' => $time, 'x_relay_response' => 'TRUE', 'x_relay_url' => $params['return_url'], 'x_login' => $this->settings['api_login_id'], 'x_show_form' => 'PAYMENT_FORM');
$sim = new AuthorizeNetSIM_Form($data);
$post_url = $this->settings['test_mode'] ? self::PROCESS_URL_TEST : self::PROCESS_URL;
Merchant::redirect_post($post_url, $sim->getHiddenFieldString());
}
开发者ID:rat4m3n,项目名称:PyroCart,代码行数:10,代码来源:merchant_authorize_net_sim.php
示例7: add
function add()
{
//debug($_SERVER['DOCUMENT_ROOT']);
include $_SERVER['DOCUMENT_ROOT'] . "/app/webroot/payment/Sfa/BillToAddress.php";
include $_SERVER['DOCUMENT_ROOT'] . "/app/webroot/payment/Sfa/CardInfo.php";
include $_SERVER['DOCUMENT_ROOT'] . "/app/webroot/payment/Sfa/Merchant.php";
include $_SERVER['DOCUMENT_ROOT'] . "/app/webroot/payment/Sfa/MPIData.php";
include $_SERVER['DOCUMENT_ROOT'] . "/app/webroot/payment/Sfa/ShipToAddress.php";
include $_SERVER['DOCUMENT_ROOT'] . "/app/webroot/payment/Sfa/PGResponse.php";
include $_SERVER['DOCUMENT_ROOT'] . "/app/webroot/payment/Sfa/PostLibPHP.php";
include $_SERVER['DOCUMENT_ROOT'] . "/app/webroot/payment/Sfa/PGReserveData.php";
$oMPI = new MPIData();
$oCI = new CardInfo();
$oPostLibphp = new PostLibPHP();
$oMerchant = new Merchant();
$oBTA = new BillToAddress();
$oSTA = new ShipToAddress();
$oPGResp = new PGResponse();
$oPGReserveData = new PGReserveData();
$oMerchant->setMerchantDetails("96039227", "96039227", "96039227", "10.10.10.238", rand() . "", "Ord1234", $_SERVER['HTTP_HOST'] . "/app/webroot/payment/SFAResponse.php", "POST", "INR", "INV123", "req.Sale", "100", "", "Ext1", "true", "Ext3", "Ext4", "New PHP");
$oBTA->setAddressDetails("CID", "Tester", "Aline1", "Aline2", "Aline3", "Pune", "A.P", "48927489", "IND", "[email protected]");
$oSTA->setAddressDetails("Add1", "Add2", "Add3", "City", "State", "443543", "IND", "[email protected]");
#$oMPI->setMPIRequestDetails("1245","12.45","356","2","2 shirts","12","20011212","12","0","","image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*","Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)");
//debug( $oPostLibphp);
// debug( $oMerchant);
// debug( $oMerchant);
// debug( $oMerchant);
$oPGResp = $oPostLibphp->postSSL($oBTA, $oSTA, $oMerchant, $oMPI, $oPGReserveData);
if ($oPGResp->getRespCode() == '000') {
$url = $oPGResp->getRedirectionUrl();
#$url =~ s/http/https/;
#print "Location: ".$url."\n\n";
#header("Location: ".$url);
redirect($url);
} else {
print "Error Occured.<br>";
print "Error Code:" . $oPGResp->getRespCode() . "<br>";
print "Error Message:" . $oPGResp->getRespMessage() . "<br>";
}
}
开发者ID:Numerico-Informatic-Systems-Pvt-Ltd,项目名称:gsmpoly,代码行数:40,代码来源:BlogsController.php
示例8: _verifyGatewayResponse
private function _verifyGatewayResponse($response)
{
if (isset($response['response']['merchant'])) {
// return a populated instance of merchant
return new Result\Successful([Merchant::factory($response['response']['merchant']), OAuthCredentials::factory($response['response']['credentials'])]);
} else {
if (isset($response['apiErrorResponse'])) {
return new Result\Error($response['apiErrorResponse']);
} else {
throw new Exception\Unexpected("Expected merchant or apiErrorResponse");
}
}
}
开发者ID:braintree,项目名称:braintree_php,代码行数:13,代码来源:MerchantGateway.php
示例9: _process
public function _process($params)
{
$request = array('amount' => (int) ($params['amount'] * 100), 'card' => $params['token'], 'currency' => strtolower($params['currency_code']), 'description' => $params['reference']);
$response = Merchant::curl_helper(self::API_ENDPOINT . '/v1/charges', $request, $this->settings['api_key']);
if (!empty($response['error'])) {
return new Merchant_response('failed', $response['error']);
}
$data = json_decode($response['data']);
if (isset($data->error)) {
return new Merchant_response('declined', $data->error->message);
} else {
return new Merchant_response('authorized', '', $data->id, $data->amount / 100);
}
}
开发者ID:rosellkarlrossj,项目名称:FireSALE,代码行数:14,代码来源:merchant_stripe.php
示例10: _process
public function _process($params)
{
// post data to 2checkout
$data = array('sid' => $this->settings['account_no'], 'cart_order_id' => $params['reference'], 'total' => $params['amount'], 'tco_currency' => $params['currency_code'], 'skip_landing' => 1, 'x_Receipt_Link_URL' => $params['return_url']);
foreach (array('card_holder_name' => 'card_name', 'street_address' => 'address', 'street_address2' => 'address2', 'city' => 'city', 'state' => 'region', 'zip' => 'postcode', 'country' => 'country', 'phone' => 'phone', 'email' => 'email') as $key => $field) {
if (isset($params[$field])) {
$data[$key] = $params[$field];
}
}
if ($this->settings['test_mode']) {
$data['demo'] = 'Y';
}
Merchant::redirect_post(self::PROCESS_URL, $data);
}
开发者ID:rosellkarlrossj,项目名称:FireSALE,代码行数:14,代码来源:merchant_2checkout.php
示例11: _process
public function _process($params)
{
$card_name = explode(' ', $params['card_name'], 2);
$data = array('USER' => $this->settings['username'], 'PWD' => $this->settings['password'], 'SIGNATURE' => $this->settings['signature'], 'VERSION' => '65.1', 'METHOD' => 'doDirectPayment', 'PAYMENTACTION' => 'Sale', 'AMT' => sprintf('%01.2f', $params['amount']), 'CURRENCYCODE' => $params['currency_code'], 'ACCT' => $params['card_no'], 'EXPDATE' => $params['exp_month'] . $params['exp_year'], 'CVV2' => $params['csc'], 'IPADDRESS' => $this->CI->input->ip_address(), 'FIRSTNAME' => $card_name[0], 'LASTNAME' => isset($card_name[1]) ? $card_name[1] : '');
if (isset($params['card_type'])) {
$data['CREDITCARDTYPE'] = ucfirst($params['card_type']);
if ($data['CREDITCARDTYPE'] == 'Mastercard') {
$data['CREDITCARDTYPE'] = 'MasterCard';
}
}
if (isset($params['card_issue'])) {
$data['ISSUENUMBER'] = $params['card_issue'];
}
if (isset($params['start_month']) and isset($params['start_year'])) {
$data['STARTDATE'] = $params['start_month'] . $params['start_year'];
}
if (isset($params['address'])) {
$data['STREET'] = $params['address'];
}
if (isset($params['city'])) {
$data['CITY'] = $params['city'];
}
if (isset($params['region'])) {
$data['STATE'] = $params['region'];
}
if (isset($params['postcode'])) {
$data['ZIP'] = $params['postcode'];
}
if (isset($params['country'])) {
$data['COUNTRYCODE'] = strtoupper($params['country']);
}
// send request to paypal
$response = Merchant::curl_helper($this->settings['test_mode'] ? self::PROCESS_URL_TEST : self::PROCESS_URL, $data);
if (!empty($response['error'])) {
return new Merchant_response('failed', $response['error']);
}
$response_array = array();
parse_str($response['data'], $response_array);
if (empty($response_array['ACK'])) {
return new Merchant_response('failed', 'invalid_response');
} elseif ($response_array['ACK'] == 'Success' or $response_array['ACK'] == 'SuccessWithWarning') {
return new Merchant_response('authorized', '', $response_array['TRANSACTIONID'], (double) $response_array['AMT']);
} elseif ($response_array['ACK'] == 'Failure' or $response_array['ACK'] == 'FailureWithWarning') {
return new Merchant_response('declined', $response_array['L_ERRORCODE0'] . ': ' . $response_array['L_LONGMESSAGE0']);
} else {
return new Merchant_response('failed', 'invalid_response');
}
}
开发者ID:rat4m3n,项目名称:PyroCart,代码行数:48,代码来源:merchant_paypal_pro.php
示例12: _process
public function _process($params)
{
$date_expiry = $params['exp_month'];
$date_expiry .= $params['exp_year'] % 100;
$request = '<Txn>' . '<PostUsername>' . $this->settings['username'] . '</PostUsername>' . '<PostPassword>' . $this->settings['password'] . '</PostPassword>' . '<CardHolderName>' . htmlspecialchars($params['card_name']) . '</CardHolderName>' . '<CardNumber>' . $params['card_no'] . '</CardNumber>' . '<Amount>' . sprintf('%01.2f', $params['amount']) . '</Amount>' . '<DateExpiry>' . $date_expiry . '</DateExpiry>' . '<Cvc2>' . $params['csc'] . '</Cvc2>' . '<InputCurrency>' . $params['currency_code'] . '</InputCurrency>' . '<TxnType>Purchase</TxnType>' . '<TxnId>' . $params['transaction_id'] . '</TxnId>' . '<MerchantReference>' . $params['reference'] . '</MerchantReference>' . '<EnableAddBillCard>' . (int) $this->settings['enable_token_billing'] . '</EnableAddBillCard>' . '</Txn>';
$response = Merchant::curl_helper(self::PROCESS_URL, $request);
if (!empty($response['error'])) {
return new Merchant_response('failed', $response['error']);
}
$xml = simplexml_load_string($response['data']);
if (!isset($xml->Success)) {
return new Merchant_response('failed', 'invalid_response');
} elseif ($xml->Success == '1') {
return new Merchant_response('authorized', (string) $xml->HelpText, (string) $xml->DpsTxnRef, (string) $xml->Transaction->Amount);
} else {
return new Merchant_response('declined', (string) $xml->HelpText, (string) $xml->DpsTxnRef);
}
}
开发者ID:rosellkarlrossj,项目名称:FireSALE,代码行数:18,代码来源:merchant_dps_pxpost.php
示例13: buildMerchants
public function buildMerchants($xml)
{
$merchants = new Merchants();
$merchants->setPageOffset((string) $xml->PageOffset);
$merchants->setTotalCount((string) $xml->TotalCount);
// merchant
$merchantArray = array();
foreach ($xml->Merchant as $merchant) {
$tmpMerchant = new Merchant();
$tmpMerchant->setId((string) $merchant->Id);
$tmpMerchant->setName((string) $merchant->Name);
$tmpMerchant->setWebsiteUrl((string) $merchant->WebsiteUrl);
$tmpMerchant->setPhoneNumber((string) $merchant->PhoneNumber);
$tmpMerchant->setCategory((string) $merchant->Category);
$tmpLocation = new Location();
$location = $merchant->Location;
$tmpLocation->setName((string) $location->Name);
$tmpLocation->setDistance((string) $location->Distance);
$tmpLocation->setDistanceUnit((string) $location->DistanceUnit);
$tmpAddress = new Address();
$address = $location->Address;
$tmpAddress->setLine1((string) $address->Line1);
$tmpAddress->setLine2((string) $address->Line2);
$tmpAddress->setCity((string) $address->City);
$tmpAddress->setPostalCode((string) $address->PostCode);
$tmpCountry = new Country();
$tmpCountry->setName((string) $address->Country->Name);
$tmpCountry->setCode((string) $address->Country->Code);
$tmpCountrySubdivision = new CountrySubdivision();
$tmpCountrySubdivision->setName((string) $address->CountrySubdivision->Name);
$tmpCountrySubdivision->setCode((string) $address->CountrySubdivision->Code);
$tmpAddress->setCountry($tmpCountry);
$tmpAddress->setCountrySubdivision($tmpCountrySubdivision);
$tmpPoint = new Point();
$point = $location->Point;
$tmpPoint->setLatitude((string) $point->Latitude);
$tmpPoint->setLongitude((string) $point->Longitude);
// ACCEPTANCE FRAMEWORK NEEDS LOOKED AT <RETURN XML AND DOC DOES NOT HAVE ALL VALUES>
//$tmpAcceptance = new Acceptance();
//$acceptance = $merchant->Acceptance;
// FEATURES FRAMEWORK NEEDS LOOKED AT <RETURN XML AND DOC DOES NOT HAVE ALL VALUES>
//$tmpFeatures = new Features();
//$features = $merchant->Features;
$tmpLocation->setPoint($tmpPoint);
$tmpLocation->setAddress($tmpAddress);
$tmpMerchant->setLocation($tmpLocation);
array_push($merchantArray, $tmpMerchant);
}
$merchants->setMerchant($merchantArray);
return $merchants;
}
开发者ID:vicenteguerra,项目名称:Flashbuy,代码行数:51,代码来源:MerchantLocationService.php
示例14: _process_return
public function _process_return()
{
if (($payment_code = $this->CI->input->get_post('AccessPaymentCode')) === FALSE) {
return new Merchant_response('failed', 'invalid_response');
}
$data = array('CustomerID' => $this->settings['customer_id'], 'UserName' => $this->settings['username'], 'AccessPaymentCode' => $_REQUEST['AccessPaymentCode']);
$response = Merchant::curl_helper(self::PROCESS_RETURN_URL . '?' . http_build_query($data));
if (!empty($response['error'])) {
return new Merchant_response('failed', $response['error']);
}
$xml = simplexml_load_string($response['data']);
if (!isset($xml->TrxnStatus)) {
return new Merchant_response('failed', 'invalid_response');
} elseif ($xml->TrxnStatus == 'True') {
return new Merchant_response('authorized', '', (string) $xml->TrxnNumber, (double) $xml->ReturnAmount);
} else {
return new Merchant_response('declined', (string) $xml->TrxnResponseMessage, (string) $xml->TrxnNumber);
}
}
开发者ID:rosellkarlrossj,项目名称:FireSALE,代码行数:19,代码来源:merchant_eway_shared.php
示例15: _process
public function _process($params)
{
// eway thows HTML formatted error if customerid is missing
if (empty($this->settings['customer_id'])) {
return new Merchant_response('failed', 'Missing Customer ID!');
}
$request = '<ewaygateway>' . '<ewayCustomerID>' . $this->settings['customer_id'] . '</ewayCustomerID>' . '<ewayTotalAmount>' . sprintf('%01d', $params['amount'] * 100) . '</ewayTotalAmount>' . '<ewayCustomerInvoiceDescription>' . $params['reference'] . '</ewayCustomerInvoiceDescription>' . '<ewayCustomerInvoiceRef>' . $params['transaction_id'] . '</ewayCustomerInvoiceRef>' . '<ewayCardHoldersName>' . $params['card_name'] . '</ewayCardHoldersName>' . '<ewayCardNumber>' . $params['card_no'] . '</ewayCardNumber>' . '<ewayCardExpiryMonth>' . $params['exp_month'] . '</ewayCardExpiryMonth>' . '<ewayCardExpiryYear>' . $params['exp_year'] % 100 . '</ewayCardExpiryYear>' . '<ewayTrxnNumber>' . $params['transaction_id'] . '</ewayTrxnNumber>' . '<ewayCVN>' . $params['csc'] . '</ewayCVN>' . '<ewayCustomerFirstName></ewayCustomerFirstName>' . '<ewayCustomerLastName></ewayCustomerLastName>' . '<ewayCustomerEmail></ewayCustomerEmail>' . '<ewayCustomerAddress></ewayCustomerAddress>' . '<ewayCustomerPostcode></ewayCustomerPostcode>' . '<ewayOption1></ewayOption1>' . '<ewayOption2></ewayOption2>' . '<ewayOption3></ewayOption3>' . '</ewaygateway>';
$response = Merchant::curl_helper($this->settings['test_mode'] ? self::PROCESS_URL_TEST : self::PROCESS_URL, $request);
if (!empty($response['error'])) {
return new Merchant_response('failed', $response['error']);
}
$xml = simplexml_load_string($response['data']);
if (!isset($xml->ewayTrxnStatus)) {
return new Merchant_response('failed', 'invalid_response');
} elseif ($xml->ewayTrxnStatus == 'True') {
return new Merchant_response('authorized', (string) $xml->ewayTrxnError, (string) $xml->ewayTrxnNumber, (double) $xml->ewayReturnAmount / 100);
} else {
return new Merchant_response('declined', (string) $xml->ewayTrxnError);
}
}
开发者ID:rat4m3n,项目名称:PyroCart,代码行数:20,代码来源:merchant_eway.php
示例16: _process_return
public function _process_return()
{
if ($this->CI->input->get('result', TRUE) === FALSE) {
return new Merchant_response('failed', 'invalid_response');
}
// validate dps response
$request = '<ProcessResponse>' . '<PxPayUserId>' . $this->settings['user_id'] . '</PxPayUserId>' . '<PxPayKey>' . $this->settings['key'] . '</PxPayKey>' . '<Response>' . $this->CI->input->get('result', TRUE) . '</Response>' . '</ProcessResponse>';
$response = Merchant::curl_helper(self::PROCESS_URL, $request);
if (!empty($response['error'])) {
return new Merchant_response('failed', $response['error']);
}
$xml = simplexml_load_string($response['data']);
if (!isset($xml->Success)) {
return new Merchant_response('failed', 'invalid_response');
} elseif ($xml->Success == '1') {
return new Merchant_response('authorized', (string) $xml->ResponseText, (string) $xml->DpsTxnRef, (double) $xml->AmountSettlement);
} else {
return new Merchant_response('declined', (string) $xml->ResponseText, (string) $xml->DpsTxnRef);
}
}
开发者ID:rat4m3n,项目名称:PyroCart,代码行数:20,代码来源:merchant_dps_pxpay.php
示例17: _process
public function _process($params)
{
$data = array('instId' => $this->settings['installation_id'], 'cartId' => $params['reference'], 'amount' => $params['amount'], 'currency' => $params['currency_code'], 'testMode' => $this->settings['test_mode'] ? 100 : 0, 'MC_callback' => $params['return_url']);
if (!empty($params['card_name'])) {
$data['name'] = $params['card_name'];
}
if (!empty($params['address'])) {
$data['address1'] = $params['address'];
}
if (!empty($params['address2'])) {
$data['address2'] = $params['address2'];
}
if (!empty($params['city'])) {
$data['town'] = $params['city'];
}
if (!empty($params['region'])) {
$data['region'] = $params['region'];
}
if (!empty($params['postcode'])) {
$data['postcode'] = $params['postcode'];
}
if (!empty($params['country'])) {
$data['country'] = $params['country'];
}
if (!empty($params['phone'])) {
$data['tel'] = $params['phone'];
}
if (!empty($params['email'])) {
$data['email'] = $params['email'];
}
if (!empty($this->settings['secret'])) {
$data['signatureFields'] = 'instId:amount:currency:cartId';
$signature_data = array($this->settings['secret'], $data['instId'], $data['amount'], $data['currency'], $data['cartId']);
$data['signature'] = md5(implode(':', $signature_data));
}
$post_url = $this->settings['test_mode'] ? self::PROCESS_URL_TEST : self::PROCESS_URL;
Merchant::redirect_post($post_url, $data);
}
开发者ID:rosellkarlrossj,项目名称:FireSALE,代码行数:38,代码来源:merchant_worldpay.php
示例18: _process
public function _process($params)
{
$fp_sequence = $params['reference'];
$time = time();
$fingerprint = AuthorizeNetSIM_Form::getFingerprint($this->settings['api_login_id'], $this->settings['transaction_key'], $params['amount'], $fp_sequence, $time);
$data = array('x_amount' => $params['amount'], 'x_delim_data' => 'FALSE', 'x_fp_sequence' => $fp_sequence, 'x_fp_hash' => $fingerprint, 'x_fp_timestamp' => $time, 'x_invoice_num' => $params['reference'], 'x_relay_response' => 'TRUE', 'x_relay_url' => $params['return_url'], 'x_login' => $this->settings['api_login_id'], 'x_show_form' => 'PAYMENT_FORM', 'x_customer_ip' => $this->CI->input->ip_address());
// set extra billing details if we have them
if (isset($params['card_name'])) {
$names = explode(' ', $params['card_name'], 2);
$data['x_first_name'] = $names[0];
$data['x_last_name'] = isset($names[1]) ? $names[1] : '';
}
if (isset($params['address']) and isset($params['address2'])) {
$params['address'] = trim($params['address'] . " \n" . $params['address2']);
}
foreach (array('x_company' => 'company', 'x_address' => 'address', 'x_city' => 'city', 'x_state' => 'region', 'x_zip' => 'postcode', 'x_country' => 'country', 'x_phone' => 'phone', 'x_email' => 'email') as $key => $field) {
if (isset($params[$field])) {
$data[$key] = $params[$field];
}
}
$sim = new AuthorizeNetSIM_Form($data);
$post_url = $this->settings['test_mode'] ? self::PROCESS_URL_TEST : self::PROCESS_URL;
Merchant::redirect_post($post_url, $sim->getHiddenFieldString());
}
开发者ID:rosellkarlrossj,项目名称:FireSALE,代码行数:24,代码来源:merchant_authorize_net_sim.php
示例19: PostLibPHP
<?php
include "Sfa/Merchant.php";
include "Sfa/PGResponse.php";
include "Sfa/PostLibPHP.php";
$oPostLibphp = new PostLibPHP();
$oMerchant = new Merchant();
$oPGResp = new PGResponse();
$oMerchant->setMerchantRelatedTxnDetails("00002116", "00002116", "00002116", "21345", "201208091494345", "000000130470", "130470", "", "", "INR", "req.Refund", "10", "", "Ext1", "Ext2", "Ext3", "Ext4", "Ext5");
$oPgResp = $oPostLibphp->postRelatedTxn($oMerchant);
print "Response Code:" . $oPgResp->getRespCode() . "<br>";
print "Response Message" . $oPgResp->getRespMessage() . "<br>";
print "Transaction ID" . $oPgResp->getTxnId() . "<br>";
print "Epg Transaction ID" . $oPgResp->getEpgTxnId() . "<br>";
print "Auth Id Code :" . $oPgResp->getAuthIdCode() . "<br>";
print "RRN :" . $oPgResp->getRRN() . "<br>";
开发者ID:Numerico-Informatic-Systems-Pvt-Ltd,项目名称:gsmpoly,代码行数:16,代码来源:TestRelated.php
示例20: getMerchant
/**
* 微信小店组件
* @return object
*/
public function getMerchant()
{
if ($this->_merchant === null) {
$this->_merchant = Yii::createObject(Merchant::className(), [$this]);
}
return $this->_merchant;
}
开发者ID:lkk,项目名称:yii2-wechat-sdk,代码行数:11,代码来源:MpWechat.php
注:本文中的Merchant类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论