How to enable instamojo sandbox (test mode) Mode - php

I have integrated instamojo payment gateway in Codeigniter. I want to enable sandbox mode in instamojo payment gateway, i can not see any option to change mode to sandbox or test mode.Can anyone tell me how to change that.
Thank You in Advance.

The Instamojo class initializer accepts a third argument that can be used to specify the API URL, it defaults to: https://www.instamojo.com/api/1.1/
Hence for the test environment you can do:
$api = new Instamojo\Instamojo(
'[API_KEY]',
'[AUTH_TOKEN]',
'https://test.instamojo.com/api/1.1/');
Note that for this to work you'll have to create an account on https://test.instamojo.com first and also make sure you're using the credentials from https://test.instamojo.com/developers/.

Related

Pay 3rd Party With PayPal API

I'm developing an application which pays out payments to a 3rd party. The source code for what I'm using is found here:
http://paypal.github.io/PayPal-PHP-SDK/sample/doc/payments/CreateThirdPartyPayment.html
I've added the following as well for my ClientID and Client Secret:
$apiContext = new \PayPal\Rest\ApiContext(
new \PayPal\Auth\OAuthTokenCredential(
'xxxxxxxxxxxxxxxxxxxxxxxxx', // ClientID
'xxxxxxxxxxxxxxxxxxxxxxxxx' // ClientSecret
)
);
When using my sandbox credentials, the code succeeds as it should. When swapping to the live credentials, however, I get an invalid client, authentication failed error. I've ensure the live ClientID and Client Secret are exactly what I have on my developer portal.
I've been looking all over the developer portal looking for a possible setting I'm missing, or something not configured correctly but have come to a loss. Any advice?
Update: I also don't see any issues/errors on the developer portal when logged into developer.paypal.com
Update 2:
I found this just now:
public function setConfig(array $config)
{
PayPalConfigManager::getInstance()->addConfigs($config);
}
Do I need to set the config by $apiContext->setConfig('LIVE') (or something to this effect?)
With the assistance from #JashParakh I was able to solve the issue. I added the following:
$config['mode'] = 'Live';
$apiContext->setConfig($config);
The payment went through in live and is should have.

Pushwoosh: Set Badge with PHP API

I'm using a paid Pushwoosh Account in order to send programmatically push-notifications to my users.
I've implemented the Pushwoosh PHP SDK and everything works great, but I'm not able to set a Notification-Badge on iOS devices as seen on the following image:
My code so far is:
$devicesArr[] = ...
$pushwoosh = Pushwoosh::create()
->setApplication('79XXX-9CXXX')
->setAuth('Wkf...2C8');
//Create the Message
$request = CreateMessageRequest::create()
->addNotification(Notification::create()
->setContent('A new workout is available!')
->setDevices($devicesArr));
//Call the REST Web Service
$response = $pushwoosh->createMessage($request);
I tried to use the ->setBadge(5) method according to this page but this also does not work:
$request = SetBadgeRequest::create()
->setBadge(1)
->setHwid('18D...1AF');
Do you know how I can achieve my goal?
I can't reproduce this on Cordova Sample (https://github.com/Pushwoosh/pushwoosh-phonegap-cordova-sample/tree/master/Phonegap-iOS-Android-WP), can you share a simple sample?
Are you sure the app is closed when you receive push with badge?
Per the docs, this is not the method you use to set the badge number on the device.
Important
This method IS NOT used to update the badge value on the device.
Instead please use /createMessage request with the "ios_badges" parameter.
http://docs.pushwoosh.com/docs/setbadge

Using PayPal Integration Wizard: Problems with empty variables

What I have to do:
Client defines a quite tricky product.
Price is calculated according to different Parameters via javascript.
Client states, that he wants to pay with PayPal and sends form.
When checking the content of the form, I want to react on his wish to pay via PayPal.
I used the integration wizard. I implemented paypals expresscheckout.php and paypalfunctions.php.
I set the variables at the start of paypalfunctions.php (sandbox). Made the rest of the code as given and tracked it until the paypal-call.
There is a call to PayPal in their own function "hash_call", where they use these variables.
But they are empty.
code in paypalfunctions.php
Defines all the global variables and the wrapper functions
********************************************/
$PROXY_HOST = '127.0.0.1';
$PROXY_PORT = '808';
$SandboxFlag = true;
//'------------------------------------
//' PayPal API Credentials
//' Replace <API_USERNAME> with your API Username
//' Replace <API_PASSWORD> with your API Password
//' Replace <API_SIGNATURE> with your Signature
//'------------------------------------
$API_UserName="myemail";
$API_Password="mypw";
$API_Signature="mysignature";
...
code in hash_call: The function hash_call ist part of paypalfunctions.php
function hash_call($methodName,$nvpStr)
{
...
//declaring of global variables
global $API_Endpoint, $version, $API_UserName, $API_Password, $API_Signature;
...
Whats going wrong?
There is a link zu the wizard: https://devtools-paypal.com/integrationwizard/ecpaypal/code.php
Piet
It is possible that you are using the wrong API Credentials.
I noticed in your example you put the following:
$API_UserName="myemail";
$API_Password="mypw";
$API_Signature="mysignature";
Just to be clear your API User name is not your Email address. Your API Password is not your PayPal Password.
Just in case you need it, here is an example of what API credentials look like and how to request them from your PayPal Account. You can use these same instructions on your Sandbox account as well:
API Credential Information
Also make certain of your endpoint. The endpoint is where you are pointing your customers. Are you pointing them at the live site or the sandbox site?
Just in case you need them, here is the API endpoint information:
PayPal API Endpoint Information
Make certain that if you are using Sandbox Credentials you are using Sandbox endpoints, and if you are using live credentials, make certain to use the live endpoint.

Authorize.Net—Wrong Post URL? Getting an Error

I haven't worked with Authorize.Net before and I'm a bit lost. I've been working my way through the DPM documentation and tried to use the basic code example for PHP with the checkout.php, relay_response.php, and order_receipt.php pages.
When I visit www.myurl.com/checkout.php I can view the form just fine. However, when I submit it it sends the data to test.authorize.net/gateway/transact.dll and I receive the following error:
3,2,13,The merchant login ID or password is invalid or the account is
inactive.,,P,0,,,5.99,,auth_capture,,,,,,,,,,,,,,,,,,,,,,,,,,2D7E6D34CFEA4A68908E8F868DFFFFF6,,,,,,,,,,,,,,,,,,,,,,,,,,,,
I am trying to test against the live environment but I can't figure out how to get it to send to "secure.authorize.net/gateway/transact.dll" from the example code. I'm just a bit confused on where I'm going wrong.
Here's my checkout.php:
<?php
require_once($_SERVER['DOCUMENT_ROOT'].'/anet_sdk/AuthorizeNet.php');
$relay_response_url = $_SERVER['DOCUMENT_ROOT'].'/auth/relay_response.php';
$api_login_id = '*********';
$transaction_key = '***********';
$amount = "5.99";
$fp_sequence = "123";
echo AuthorizeNetDPM::getCreditCardForm($amount, $fp_sequence, $relay_response_url, $api_login_id, $transaction_key);
?>
There are two possible reasons for this:
Your authentication credentials are incorrect. Verify you are using the right information which may include generating a new transaction key.
You are mixing up production and development environments. Authorize.Net has a developer sandbox for which developers can test their code against without processing any real transactions or incurring any fees. The URL and login credentials for that are different than that of the production environment. Verify that you are using the production environment and not the development environment.

EBS payment gateway integration using PHP

i need to integrate ebs payment gateway. i am searching lot but i could find the solution.
Response is provided using POST method to the URL defined under ReturnURL parameter in the payment request. $response['ResponseCode'] == 0 means transaction successfully completed. Other than 0 value transactions failed. I can't find $response['ResponseCode'] == 0.
here my code
if(isset($_GET['DR'])) {
require('Rc43.php');
$DR = preg_replace("/\s/","+",$_GET['DR']);
$rc4 = new Crypt_RC4($secret_key);
$QueryString = base64_decode($DR);
$rc4->decrypt($QueryString);
$QueryString = split('&',$QueryString);
$response = array();
foreach($QueryString as $param){
$param = split('=',$param);
$response[$param[0]] = urldecode($param[1]);
}
}
I would understand how exactly the integration to EBC is done and look at one of the existing Broadleaf Payment modules as a template.
For example:
- Does EBC provide an API for direct server to server communication? (i.e. the Credit Card information is passed to your server and then relayed to the gateway? If so, take a look at http://docs.broadleafcommerce.org/curre ... odule.html
- Does EBC provide a mechanism for a Transparent Redirect or Silent Post? (i.e. the Credit Card form is sent directly to EBC thereby bypassing the merchant servers? If so, take a look at http://docs.broadleafcommerce.org/curre ... e.net.html
- Does EBC provide a mechanism for a Hosted Order Page? (i.e. you get redirected to EBC's servers to enter your credit card information. If so, take a look at http://docs.broadleafcommerce.org/curre ... odule.html)
The many different integration options that the Payment Gateway provides will determine how Broadleaf should integrate with it.
Hope that helps.
Reference : http://www.fetchflow.com/blog/authorize-net-invoicing

Categories