Jump to content

Building urls help


sford999

Recommended Posts

I'm trying to make a payment gateway for my script but i`m having a problem with the output
 
The code

// redirect to the payment gateway
$desc = urlencode($days.' days extension for '.$username);
$sign = calculateWidgetSignature($params, $secret_key);

$gatewayUrl = 'http://paymentprocessor.com/gateway?';
$gatewayUrl .= 'key='.$app_key.'&';
$gatewayUrl .= 'uid='.$userId.'&';
$gatewayUrl .= 'widget='.$widget.'&';
$gatewayUrl .= 'amount='.$amount.'&';
$gatewayUrl .= 'currencyCode='.$ccode.'&';
$gatewayUrl .= 'ag_name='.$desc.'&';
$gatewayUrl .= 'ag_external_id='.$days.'&';
$gatewayUrl .= 'ag_type=fixed&';
$gatewayUrl .= 'ag_period_length='.$days.'&';
$gatewayUrl .= 'ag_period_type=day&';
$gatewayUrl .= 'ag_recurring=0&';
$gatewayUrl .= 'sign_version=2&';
$gatewayUrl .= 'sign='.$sign;

The problem is when I echo/print the $gatewayUrl I get the following
 

http ://paymentprocessor.com/gateway?key=random_string&uid=1&widget=p4_1&amount=10¤cyCode=USD&ag_name=30+days+extension+for+username&ag_external_id=30&ag_type=fixed&ag_period_length=30&ag_period_type=day&ag_recurring=0&sign_version=2&sign=random_string

 
The highlighted part in red is stopping the code from working as its meant to say "&currencyCode" not ¤cyCode

Link to comment
https://forums.phpfreaks.com/topic/276242-building-urls-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.