react-native-paytm not working - react-native

I am trying to use react-native-paytm for payment gateway, I followed the steps what was there in react-native-paytm module, but it is not working for me, Even i don't Know the error and Don't Know how to resolve it
Here is the code that what i have done
payNow(){
// alert("payNow")
var details = {
generationUrl: "https://cinealerts.com/webservices/paytm/xxx.php",
validationUrl: "https://cinealerts.com/webservices/paytm/xxx.php",
mid: "my mid", // Prod
industryType: "Retail", //Prod
website: "APP_STAGING", //prod
channel: "WAP",
amount: "5",
orderId: "12345678",
requestType: "DEFAULT",
email: "hussian#gmail.com",
phone: "7777777777",
theme: "merchant",
custId: "9988344556",
};
paytm.startPayment(details);
}
when i click on button it will call the paynow function, in payNow function one popUp is open and automatically it closed with out showing anything, I don't know how to resolve this issue, and even i don't know that what is the issue.
Any one please give me suggestions that how to resolve this issue, Any help much appreciated.

A better documented fork:
https://github.com/sujayjaju/react-native-paytm
It worked for me on Android. I still need to test on iOS

Make sure you are using the correct values of paytm parameters.
In your code, you are using APP_STAGING in website parameter. It should be APPSTAGING.
To check the correct parameters value of website parameter, follow the steps :-
Log into your Paytm dashborad - https://staging-dashboard.paytm.com
Go to settings->profile
Check value of Website
Also I need to add one more parameter to get it working i.e. mode:'stage'.
I am sharing my code that worked fine for me in android.
var details = {
mid: "my_mid",
industryType: "Retail", //Prod
website: "APPSTAGING", //prod
channel: "WAP",
amount: 100,
orderId: "ORDER_12390",
email: "abc#gmail.com",
phone: 7777777777,
custId: "CUST-12879",
checksumhash: "checksum generated using paytm sdk",
callback: "my_call_back_url",
mode:'stage',
};
// alert(JSON.stringify(details));
paytm.startPayment(details);

Related

Integrating nativescript-paytm plugin in nativescript-vue application

I'm having a nativescript-vue application where I want to integrate nativescript-paytm plugin, I created a method on click event: payNow() which contains all the necessary details of Paytm as described in Readme.md/documentation/demo app.
import {
Paytm,
Order,
TransactionCallback,
IOSCallback
} from "#nstudio/nativescript-paytm";
const paytm = new Paytm()
methods: {
payNow() {
paytm.setIOSCallbacks({
didFinishedResponse: function(response) {
console.log(response);
},
didCancelTransaction: function() {
console.log("User cancelled transaction");
},
errorMissingParameterError: function(error) {
console.log(error);
}
});
// Sample order
const order = {
// This will fail saying duplicate order id
// generate your own order to test this.
MID: "rzqfRq*******83",
ORDER_ID: "NOETIC_ORDER_0001",
CUST_ID: "CUST_6483",
INDUSTRY_TYPE_ID: "Retail",
CHANNEL_ID: "WAP",
TXN_AMOUNT: "10.00",
WEBSITE: "WEBSTAGING",
CALLBACK_URL: "https://pguat.paytm.com/paytmchecksum/paytmCallback.jsp",
EMAIL: "rubal#example.com",
MOBILE_NO: "9876543210",
CHECKSUMHASH: "NDspZhvSHbq44K3A9Y4daf9En3l2Ndu9fmOdLG+bIwugQ6682Q3JiNprqmhiWAgGUnNcxta3LT2Vtk3EPwDww8o87A8tyn7/jAS2UAS9m+c="
};
paytm.initialize("STAGING");
paytm.createOrder(order);
paytm.startPaymentTransaction({
someUIErrorOccurred: function(inErrorMessage) {
console.log(inErrorMessage);
},
onTransactionResponse: function(inResponse) {
console.log(inResponse);
},
networkNotAvailable: function() {
console.log("Network not available");
},
clientAuthenticationFailed: function(inErrorMessage) {
console.log(inErrorMessage);
},
onErrorLoadingWebPage: function(
iniErrorCode,
inErrorMessage,
inFailingUrl
) {
console.log(iniErrorCode, inErrorMessage, inFailingUrl);
},
onBackPressedCancelTransaction: function() {
console.log("User cancelled transaction by pressing back button");
},
onTransactionCancel: function(inErrorMessage, inResponse) {
console.log(inErrorMessage, inResponse);
}
});
}
}
While executing so I only get to see screens like this:
I can see that while cancelling I get a message in my console User cancelled transaction by pressing back button that means these things are also working but I am unable to see any screen, atleast if any error message is visible I can try to debug. Help me out with this.
Here's the message which I get in my command prompt:
JS: Avoid using ListView or ScrollView with no explicit height set inside StackLayout. Doing so might results in poor user interface performance and a poor user experience.
chromium: [INFO:library_loader_hooks.cc(36)] Chromium logging enabled: level = 0, default verbosity = 0
chromium: [INFO:aw_field_trial_creator.cc(54)] First-WebView-Experiment not found
JS: 'User cancelled transaction by pressing back button'
JS: Avoid using ListView or ScrollView with no explicit height set inside StackLayout. Doing so might results in poor user interface performance and a poor user experience.
chromium: [INFO:CONSOLE(0)] "The SSL certificate used to load resources from https://pguat.paytm.com will be distrusted in the future. Once distrusted, users will be prevented from loading these resources. See https://g.co/chrome/symantecpkicerts for more information.", source: (0)
chromium: [INFO:CONSOLE(0)] "The SSL certificate used to load resources from https://pguat.paytm.com will be distrusted in the future. Once distrusted, users will be prevented from loading these resources. See https://g.co/chrome/symantecpkicerts for more information.", source: https://pguat.paytm.com/oltp-web/processTransaction?ORDER_ID=NOETIC_ORDER_0001 (0)
JS: 'User cancelled transaction by pressing back button'
JS: Avoid using ListView or ScrollView with no explicit height set inside StackLayout. Doing so might results in poor user interface performance and a poor user experience.
chromium: [INFO:CONSOLE(0)] "The SSL certificate used to load resources from https://pguat.paytm.com will be distrusted in the future. Once distrusted, users will be prevented from loading these resources. See https://g.co/chrome/symantecpkicerts for more information.", source: (0)
chromium: [INFO:CONSOLE(0)] "The SSL certificate used to load resources from https://pguat.paytm.com will be distrusted in the future. Once distrusted, users will be prevented from loading these resources. See https://g.co/chrome/symantecpkicerts for more information.", source: https://pguat.paytm.com/oltp-web/processTransaction?ORDER_ID=NOETIC_ORDER_0001 (0)
For more info I raised issue on GitHub repo: https://github.com/nstudio/nativescript-paytm/issues/5
Edit:
I tried adding it through playground, but since it uses external library integration is not possible. However I tried using in following link
https://play.nativescript.org/?template=play-vue&id=CpqoNA&v=2
Hope this gives more clear picture about it.
Edit:
My whole payment.vue file looks like following link: https://gist.github.com/nitish1986/f23644514082efe757f132e943f2df51
Thanks

Keystonejs 4.0 File system storage adapter image preview

How do I get an image preview for a Types.File field in the admin UI.
It says "The FS adapter supports all the default Keystone file schema fields. It also additionally supports and enables the filename path (required)." However when I try (doc):
format: function(item, file){
return '<img src="/files/'+file.filename+'" style="max-width: 300px">'
}
Nothing appears in the UI
The format function hasn't been working for a while as far as I can tell from the Keystone GitHub. I don't know if the function exists in Keystone 4.0. Reference here.
You could fork the current beta and patch the function yourself if you need this immediately.
You can find it at https://github.com/keystonejs/keystone/blob/v4.0.0-beta.5/fields/types/file/FileType.js#L81
Doesn't seem right to me, though. I hope they will fix it before releasing 4.0, along with the missing File Array type.
Image previews are now possible in the latest master branch of keystone (see https://github.com/keystonejs/keystone/pull/4509). At the moment you need to depend on the git version of keystone, so put this in your package.json and run npm install:
"keystone": "https://github.com/keystonejs/keystone.git"
In your model, specify thumb: true on the image field in question. You also need the url property in the schema. For example:
const storage = new keystone.Storage({
adapter: keystone.Storage.Adapters.FS,
fs: {
path: keystone.expandPath('./uploads/images'),
publicPath: '/images/'
},
schema: {
url: true,
}
})
ImageUpload.add({
name: { type: Types.Key, index: true },
image: {
type: Types.File,
storage: myStorage,
thumb: true
},
createdTimeStamp: { type: String }
});
The admin UI should now show a small preview of the image and a link to it.

Remove Ship To label from Paypal Payment

How to remove Ship to label from PayPal payment. I am using Nuget package PayPal using MVC 4 site. The problem is everything works fine but i have to remove Ship To box. Is there any option to remove this.
Are you using Payments Standard or Express Checkout? I'm going to assume it's Express Checkout.
With that assumption being true, you can add NOSHIPPING=1 to your request in order to eliminate the shipping selection during checkout.
This link will solve my issue.
Thank for above suggestions.
paypal api: take immediate payment without a shipping address
When I was using smart payment buttons, the following helped me to hide ship to.
createOrder: function(data, actions) {
var payableAmount = 3;
return actions.order.create({
purchase_units: [{
amount: {
value: payableAmount
}
}],
application_context: {
shipping_preference: 'NO_SHIPPING'
}
})
}

Sending Additional Info with a Typeahead Query

I'm using Bootstrap 3.2.0 and jQuery 2.1.1.
I've implemented typeahead search suggestions and now wanted to go a step further. I am using the remote method and was hoping to send more than just the query to the PHP that will run a SQL script:
$(function() {
var productEngine = new Bloodhound({
datumTokenizer: function (datum) { return Bloodhound.tokenizers.whitespace(datum.value); },
queryTokenizer: Bloodhound.tokenizers.whitespace,
limit: 10,
remote: { url: 'php/product_suggest.php?storeid='.concat(localStorage.getItem('store_id'), '&query=%QUERY') }
});
productEngine.initialize();
$('input#product_suggest').typeahead(null, {
displayKey: 'value',
source: productEngine.ttAdapter()
});
});
I've also tried building the URL and saving as a variable. Then attempting to call that variable in the remote.
remote: { url: builtURL }
As I don't particularly know how this url is being parsed and used or how the %QUERY is being added, I'm assuming my issue lies in my lack of knowledge around how typeahead is processing this.
I thought this would be a fairly common request, but Google has let me down. Anyone have any suggestions or can point me towards examples of sending additional info with a typeahead query?

FB.ui with method 'feed' is resulting in an 'unknown error' and CAPTCHA request

We're using code that we've used before, so I suspect that this may be site-related. In using a standard:
FB.ui(
{
method: 'feed',
app_id: '<?= $LDP->config->facebook->id ?>',
name: 'Post Name',
link: flink,
picture: "https://www.domain.ca/templates/visual/images/share.gif",
caption: "Caption",
description: 'Join the fun today!',
actions: [
{ name: "Check it out!", link: flink }
]
},
function(response) {
if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}
}
);
It first displays the expected share dialog, and when you click the button at bottom right to go through with the stream publication, a new popup appears with:
Title: Require Captcha
unknown error
Security Check
please enter the text below
[captcha appears]
The only button is "Ok". Correctly solving the Captcha results in a crash (Facebook servers throwing a 500 error).
Any ideas?
I'm experiencing this too. I can confirm that changing the domain in the link makes it all good.
I got a parallel domain for our app and after three days the same Captcha with "Unknown error" appeared. Best of all – if a user gives the correct Captcha words the post will still fail. This is pretty annoying and we're getting complaints from our users.
Turns out this is a bug with Facebook (broken captcha issue). The pop-up is an innate anti-spam system, but people should be able to succeed with the CAPTCHA. I'd filed a private bug with Facebook, and it's slated to be fixed apparently.
Try calling FB.init() before calling FB.ui() to see if that helps get things in sync. Also be sure to specify the channelUrl in the init call too.