Why isn't the item name and number not being submitted with the DoExpressCheckout?
Here is what I am sending:
// Single-item purchase
$nvps["METHOD"] = "SetExpressCheckout";
$nvps["RETURNURL"] = "http://www.domain.com/angelpaypal/test/success.php"; // server
$nvps["CANCELURL"] = "http://www.domain.com/angelpaypal/test/fail.php"; // server
$nvps["PAYMENTREQUEST_0_PAYMENTACTION"] = "Sale";
$nvps["PAYMENTREQUEST_0_NOTIFYURL"] = "http://www.domain.com/includes/ipn/paypal/config/ipn-listener.php";
$nvps["PAYMENTREQUEST_0_AMT"] = "$Price";
$nvps["PAYMENTREQUEST_0_CURRENCYCODE"] = "USD";
$nvps["PAYMENTREQUEST_0_ITEMAMT"] = "$Price";
$nvps["L_PAYMENTREQUEST_0_NAME0"] = "$Desc";
$nvps["L_PAYMENTREQUEST_0_NUMBER0"] = "$Item";
$nvps["L_PAYMENTREQUEST_0_AMT0"] = "$Price";
$nvps["L_PAYMENTREQUEST_0_QTY0"] = "1";
$nvps["L_PAYMENTREQUEST_0_ITEMCATEGORY0"] = "Digital"; // specific to Digital Goods
Below is the response:
TOKEN = EC-7RN61912TS2838617
SUCCESSPAGEREDIRECTREQUESTED = false
TIMESTAMP = 2014-03-07T19:16:39Z
CORRELATIONID = b65c4f8669542
ACK = Success
VERSION = 109.0
BUILD = 9917844
INSURANCEOPTIONSELECTED = false
SHIPPINGOPTIONISDEFAULT = false
PAYMENTINFO_0_TRANSACTIONID = 3PF8162359151561E
PAYMENTINFO_0_TRANSACTIONTYPE = expresscheckout
PAYMENTINFO_0_PAYMENTTYPE = instant
PAYMENTINFO_0_ORDERTIME = 2014-03-07T19:16:39Z
PAYMENTINFO_0_AMT = 5.00
PAYMENTINFO_0_FEEAMT = 0.45
PAYMENTINFO_0_TAXAMT = 0.00
PAYMENTINFO_0_CURRENCYCODE = USD
PAYMENTINFO_0_PAYMENTSTATUS = Completed
PAYMENTINFO_0_PENDINGREASON = None
PAYMENTINFO_0_REASONCODE = None
PAYMENTINFO_0_PROTECTIONELIGIBILITY = Ineligible
PAYMENTINFO_0_PROTECTIONELIGIBILITYTYPE = None
PAYMENTINFO_0_SECUREMERCHANTACCOUNTID = KEPBS3TF5VPSL
PAYMENTINFO_0_ERRORCODE = 0
PAYMENTINFO_0_ACK = Success
As yuo can see, I am specifying item name and number, although in the response above, I don't see these fields - I want to use them in the IPN (NOTIFYURL) I've added
What you've shown here is SetExpressCheckout. Setting the items here will only make them show up on the PayPal review page during checkout. It will not carry all the way through to the final transaction unless you include those same itemizes details in the DoExpressCheckoutPayment request.
DECP is the end all, be all. Whatever gets sent with that is what ends up in the final PayPal details.
Related
Trying to integrate tranzila payment gateway in my php project and testing with dummy credit card numbers on localhost before go live.I get php code from tranzila official document.
code given below
`
$tranzila_api_host = 'secure5.tranzila.com';
$tranzila_api_path = '/cgi-bin/tranzila71u.cgi';
// Prepare transaction parameters
$query_parameters['supplier'] = 'TERMINAL_NAME'; // 'TERMINAL_NAME' should be replaced by actual terminal name
$query_parameters['sum'] = '45'; // Transaction sum
$query_parameters['currency'] = '1'; // Type of currency 1 NIS, 2 USD, 978 EUR, 826 GBP, 392 JPY
$query_parameters['ccno'] = '12312312'; // Test card number
$query_parameters['expdate']= '0820'; // Card expiry date: mmyy
$query_parameters['myid'] = '12312312'; // ID number if required
$query_parameters['mycvv'] = '123'; // number if required
$query_parameters['cred_type'] = '1'; // This field specifies the type of transaction, 1 - normal transaction, 6 - credit, 8 - payments
// $query_parameters['TranzilaPW'] = 'TranzilaPW' ;
$query_string = '' ;
foreach($query_parameters as $name => $value) {
$query_string .= $name.'='.$value.'&' ;
}
$query_string = substr($query_string , 0 , - 1 ) ; // Remove trailing '&'
// Initiate CURL
$cr = curl_init();
curl_setopt($cr,CURLOPT_URL ,"https://$tranzila_api_host$tranzila_api_path");
curl_setopt($cr,CURLOPT_POST,1);
curl_setopt($cr,CURLOPT_FAILONERROR,true);
curl_setopt($cr,CURLOPT_POSTFIELDS,$query_string) ;
curl_setopt($cr,CURLOPT_RETURNTRANSFER,1);
curl_setopt($cr,CURLOPT_SSL_VERIFYPEER,0);
// Execute request
$result = curl_exec($cr);
$error = curl_error($cr);
if(!empty($error)){
die( $error );
}
curl_close ($cr);
// Preparing associative array with response data
$response_array = explode('&',$result);
$response_assoc = array();
if(count($response_array) > 1){
foreach($response_array as $value){
$tmp = explode('=',$value);
if (count($tmp) > 1 ){
$response_assoc [$tmp[0]] = $tmp[1];
}
}
}
// Analyze the result string
if(!isset($response_assoc['Response'])){
die($result."\n");
/**
* When there is no 'Response' parameter it either means
* that some pre-transaction error happened (like authentication
* problems), in which case the result string will be in HTML format,
* explaining the error, or the request was made for generate token only
* (in this case the response string will only contain 'TranzilaTK'
* parameter)
*/
}else if($response_assoc['Response'] !== '000'){
die($response_assoc['Response']."\n");
// Any other than '000' code means transaction failure
// (bad card, expiry, etc ..)
}else{
die("Success \n");
}
`
Here i replaced supplier with my original supplier name which i can't show here for security reasons.When run this code with actual supplier i got 'Not Authorized' error.
I am trying to charge a card using Authorize.NET's PHP SDK. But it keeps giving me this error:
Thu, 29 Mar 2018 17:00:56 +0000 ERROR : [_sendRequest] (/lib/shared/AuthorizeNetRequest.php : 100) - ----Request---- Invalid SSL option
It has worked before, but now it keeps giving me a error, I have researched this but have found no answer, I have tried this in my code:
$sale->VERIFY_PEER = false;
I have also updated my cert.pem file but it still gives me a error.
PHP CODE:
<?php
require 'vendor/autoload.php';
use lib\net\authorize\api\contract\v1 as AnetAPI;
use lib\net\authorize\api\controller as AnetController;
define("AUTHORIZENET_LOG_FILE", "phplog");
$usermeta = get_user_meta(get_current_user_id(), '_carddetails_', TRUE);
define("AUTHORIZENET_API_LOGIN_ID", "[LOGIN_ID]");
define("AUTHORIZENET_TRANSACTION_KEY", "[TRANSACTION_KEY]");
define("AUTHORIZENET_SANDBOX", true);
$sale = new AuthorizeNetAIM(AUTHORIZENET_API_LOGIN_ID, AUTHORIZENET_TRANSACTION_KEY);
$sale->VERIFY_PEER = false;
$sale->amount = $_POST['grandTotal'];
$sale->card_num = $usermeta['number'];
$sale->exp_date = $usermeta['expdate'];
$sale->addLineItem('item1', // Item Id
'Order 1', // Item Name
'Order 1', // Item Description
'1', // Item Quantity
$_POST['grandTotal'], // Item Unit Price
'N' // Item taxable
);
$customer = (object) array();
$customer->first_name = $usermeta['firstname'];
$customer->last_name = $usermeta['lastname'];
$customer->company = $usermeta['company'];
$customer->address = $usermeta['address'];
$customer->city = $usermeta['city'];
$customer->state = $usermeta['state'];
$customer->zip = $usermeta['zip'];
$customer->country = $usermeta['country'];
$customer->cust_id = 9999;
$customer->customer_ip = $_SERVER['REMOTE_ADDR'];
$sale->setFields($customer);
$response = $sale->authorizeAndCapture();
$responseCode = $response->response_code;
$authCode = $response->authorization_code;
$avsResultCode = $response->avs_response;
$transId = $response->transaction_id;
$transHash = $response->md5_hash;
$accountNumber = $response->account_number;
$accountType = $response->card_type;
$description = $response->description;
if ($response->approved)
{
echo "iT worked";
}
else
{
echo $response->error_message;
}
?>
You should grab the latest cert from https://github.com/AuthorizeNet/sdk-php/tree/master/lib/ssl. It was last updated 5 days ago as of writing this post to include new Authorize certs.
Disabling or changing the default peer and cert verification could be dangerous.
I have figured it out.
I commented this out:
$sale->VERIFY_PEER = false;
And commented line 80 of HttpClient.php
Here is where I found the answer at: https://github.com/AuthorizeNet/sdk-php/issues/223
I am using kannel sms gateway, to send sms
Sorry, if this question is asked before, but I tried to find solution, but I didn't get any, unfortunately I have to post this question.
I am sending message through php script(smpp client) to smpp server, which connects to bearer box and send message.
There are multiple issues am facing:
1. Am not able to get delivery report
2. Am getting an error in logs of smsbox : ERROR: URL <03b3423a> doesn't start with http://' norhttps://'
I tried different solutions, but none of them are working.
I am in need that if number "A" sends message to number "B", then number "A" should get acknowledgement that message had been delivered to number "B"
Here are my details of configuration files:
kannel.conf
group = core
dlr-storage=internal
admin-port = 13000
smsbox-port = 13001
admin-password = bar
log-file = "/var/log//kannel/kannel.log"
box-deny-ip = "*.*.*.*"
box-allow-ip = "127.0.0.1"
access-log = "/var/log/kannel/access.log"
#---------------------------------------------
# SMSC CONNECTIONS
group = "smsc"
smsc = "http"
smsc-id = "http"
#system-type = "generic"
system-type = "kannel"
port = 13015
log-file = /var/log/kannel/smsc.log
status-success-regex = "success"
status-permfail-regex = "failure"
status-tempfail-regex = "retry later"
generic-status-sent = 200
generic-status-error = 404
#reroute-dlr = true
#transceiver-mode = 0
receive-port=13015
send-url = "http://192.168.1.124:8090"
smsc-username = "cust2"
smsc-password = "cust#123"
connect-allow-ip = "*.*.*.*"
#dlr-url="http://192.168.1.106/dlr.php?type=%d"
#---------------------------------------------
# SMSBOX SETUP
group = smsbox
bearerbox-host = 127.0.0.1
bearerbox-port = 13001
smsbox-id = cust2
#---------------------------------------------
# SEND-SMS USERS
group = sendsms-user
username = cust2
password = cust#123
#user-deny-ip = ""
#user-allow-ip = ""
#---------------------------------------------
# SERVICES
group = sms-service
keyword = default
text = "No service specified"
group = smsbox-route
smsbox-id = cust2
smsc-id = "http"
opensmppbox.conf
group = core
dlr-storage = internal
group = opensmppbox
opensmppbox-id = OPENSMPP
opensmppbox-port = 2775
bearerbox-host = 127.0.0.1
bearerbox-port = 13001
our-system-id = outbind
smpp-logins = /usr/local/kannel/smpplogins.txt
use-systemid-as-smsboxid = true
route-to-smsc = http
log-file = /usr/local/kannel/smppbox.log
transmitter.php
<?php
//print "<pre>";
require_once "smpp.php";
$tx=new SMPP('192.168.1.81',2775);
$tx->debug=true;
$tx->system_type="http";
$tx->addr_npi=1;
$tx->sms_registered_delivery_flag=1;
$tx->sms_sm_default_msg_id=1;
//$tx->dlr_url="http://192.168.1.124/cgi-bim/drl";
//$tx->dlr_url="http://192.168.1.124:8090";
print_r($tx);
//print "open status: ".$tx->state."\n";
$tx->bindTransmitter("cust2","cust#123");
$tx->sms_source_addr_npi=1;
//$tx->sms_source_addr_ton=1;
$tx->sms_dest_addr_ton=1;
$tx->sms_dest_addr_npi=1;
$tx->sendSMS("2121","791400000","Hello world");
//$tx->sendSMS("2121","2121","Hello world!!!");
$tx->close();
unset($tx);
Please let me know, if any further information is needed
Thanks for help in advance
What is the response of the call http://192.168.1.124:8090
send-url = "http://192.168.1.124:8090"
Response must be like success, failure or retry later
status-success-regex = "success"
status-permfail-regex = "failure"
status-tempfail-regex = "retry later"
If the response is correct you will get the correct DLR
We have the following code to transfer our buyer's details to the PayPal:
$ShippingAddr = new AddressType;
// more code ...
$ShippingAddr->Phone = $_userdata['user_phone'];
$BillingAddr = new AddressType;
// more code ...
$BillingAddr->Phone = $_userdata['user_phone'];
$setECReqDetails = new SetExpressCheckoutRequestDetailsType();
// more code ...
$setECReqDetails->Address = $ShippingAddr;
$setECReqDetails->BillingAddress = $BillingAddr;
$setECReqType = new SetExpressCheckoutRequestType();
$setECReqType->Version = '104.0';
$setECReqType->SetExpressCheckoutRequestDetails = $setECReqDetails;
$setECReq = new SetExpressCheckoutReq();
$setECReq->SetExpressCheckoutRequest = $setECReqType;
$setECResponse = $paypalService->SetExpressCheckout($setECReq);
Working fine apart from the phone number which remains empty on PayPal checkout site.
Any idea what we did wrong?
I believe you are trying to get users information as per this webservice. https://developer.paypal.com/docs/api/#get-user-information
So you should call it this way according to the paypal doc,
$_userdata['phone_number'];
I am using the following code to work, but it is not working
require('DIBSFunctions.php');
//Define input variables (here simply static variables)
$Merchant = "123456";
$OrderID = "AHJ798123AH-BH";
$Currency = "208"; //DKK
$Amount = "30000"; //In smallest possible unit 30000 Øre = DKK 300
$CardNo = "5019100000000000"; //DIBS test Dankort values
$ExpMon = "06"; //DIBS test Dankort value
$ExpYear = "13"; //DIBS test Dankort value
$CVC = "684"; //DIBS test Dankort value
$MD5['K1'] = "~.(S96%u|(UV,~ifxTt.DAKSNb&SKAHD"; //K1 and K2 MUST be gathered through
$MD5['K2'] = "qJuH6vjXHLSDB*%¤&/hbnkjlBHGhjJKJ"; //ones DIBS admin-webinterface.
//Call function DIBSAuth to authorise payment
$RES = DIBSAuth($Merchant,$Amount,$Currency,$CardNo,$ExpMon,$ExpYear,$CVC,$OrderID,$MD5);
echo '<pre>';
print_r($RES);
//Check the response (the DIBS API returns the variable transact on success)
if ( $RES['transact'] != "" )
{
printf ("Authorisation successful! TransaktionID = %s",$RES['transact']);
//Call function DIBSCapt to capture payment
$RES2 = DIBSCapt($Merchant, $Amount, $RES['transact'], $OrderID);
if ( $RES2['status'] == "ACCEPTED" )
{
printf ("Transaction completed");
} else {
printf ("Capture failed!");
}
} else {
printf ("Authorisation failed");
}
This is the code output
Array
(
[reason] => 2
[status] => DECLINED
)
Authorisation failed
require('DIBSFunctions.php');
this file contains the username and password, I am providing it. e.g.
function http_post($host, $path, $data, $auth="") {
$auth['username'] = '123456';
$auth['password'] = '987656656';
//rest of the code
}
if someone wants to see the file 'DIBSFunctions.php' it can be downloadable from here http://tech.dibspayment.com/toolbox/downloads/dibs_php_functions/
i contact to the technical support and got the answer below:
The problem you are experiencing is due to the fact that you are trying to send us real card numbers (test or live). This form of integration requires a PCI certification of your systems.
Most customers use a so called hosted solution, where you use our payment windows. Please refer to tech.dibs.dk for documentation.