How to receive the verify data from bank in Core - asp.net-mvc

I'm using this code to receive the verify data from bank API (Persian bank)
saleReferenceId = long.Parse(queryString["SaleReferenceId"].ToString());
saleOrderId = long.Parse(queryString["SaleOrderId"].ToString());
resultCode_bpPayRequest = queryString["ResCode"].ToString();
But After the user has paid the amount the SaleRefrenceId and other fields are empty. I wanna know how to receive these fields from bank API?
I used to receive it in asp.net.mvc by
Request.param["saleReferenceId"]
But know, I don't know how to take it in ASP.netcore
Plz help me with

Related

Twilio how to manage local phone numbers through api

I am trying to move my account off of using local numbers and onto toll free numbers.
I would like to get a list of all my local numbers. The incoming_phone_numbers api does not seem to return the Type attribute which tells me local vs toll free.
I believe I need to use the Active Number api, which is in preview, to get that info https://www.twilio.com/docs/phone-numbers/global-catalog/api/active-numbers
I am receiving a 404 response when I use the below script.
I've found post of people talking about this api, but all the comments were about the issue I am having with no resolution https://stackoverflow.com/a/63297180/3599659
from twilio.rest import Client
import keyring
import requests
from requests.auth import HTTPBasicAuth
account_sid = keyring.get_password("twilio", "account_sid")
auth_token = keyring.get_password("twilio", "auth_token")
client = Client(account_sid, auth_token)
numbers = client.incoming_phone_numbers.list(limit=1)
print(f"getting info for {numbers[0].sid}")
response = requests.get(f"https://preview.twilio.com/Numbers/ActiveNumbers/{numbers[0].sid}", auth=HTTPBasicAuth(account_sid, auth_token))
if not response:
print(f"Request for active numbers failed. status code:{response.status_code}. {response.content}")
quit()
print(response.content)
This API is in Private Developer Preview. I am not sure if it still open to accepting new customers. I am looking to discover this.
It does cost $0.005 per call but if you only have US numbers you can make a call to the lookups api requesting carrier information for the number.
response = requests.get(f"https://lookups.twilio.com/v1/PhoneNumbers/{numbers[0].phoneNumber}?Type=carrier", auth=HTTPBasicAuth(account_sid, auth_token))
This should list the carrier name as either Twilio - SMS/MMS-SVR or Twilio - Toll-Free - SMS-Sybase365/MMS-SVR so you can identify the toll free numbers that way. This is assuming the numbers were issued by twilio and haven't been ported in etc.

Tweepy bot to tweet DMs

I would like to make a bot on twitter to use with my friends, it would be like a spotted. The bot would need to tweet the messages they send on his dm. On the internet I found this function, but I don't know if it's right, nor how to close this puzzle, can someone help me?
api.list_direct_messages()
You can get the DM messages with
auth = tweepy.OAuthHandler('api_key', 'api_secret')
auth.set_access_token('access_token', 'token_secret')
api = tweepy.API(auth)
messages = get_api().list_direct_messages(count=5)
The code above would rin in a thread to fetch the messages every x minutes.
Once you have the messages you can process the list, send the tweet and delete the DMs (to avoid processing it again).
for message in messages:
text = message.message_create["message_data"]["text"]
api.update_status(f'Tweet DM content: {text}'
# remove DM
api.destroy_direct_message(message.id)

handling byte array of image in node js server

I am following this below library for my applications where user have to chat with other user.
SocketChat
There I can chat with other users. Now my prime concern is to send images to server and then that image is going to reflect in the chat of the other user's window. Its like Group chat.
I am done with image sending from iOS app
I don't know what to write to handle byte array which is of the image I sent from one of the client.
clientSocket.on('images', function(clientNickname, message){
var currentDateTime = new Date().toLocaleString();
var dataType = "imageType"
delete typingUsers[clientNickname];
io.emit("userTypingUpdate", typingUsers);
io.emit('newChatMessage', clientNickname, message, currentDateTime,dataType);
});
I think its not working. Its good for the string type data. Can you please let me know what to write there in order to receive image and send that back.

How to create contacts list like whats app did

I'm working on an app that creates an user profile. I need to be able to see who from my contacts has the app installed so that i am able to grant them access to my profile and see their profiles.
How do i get the full contact list, determine my phone number to create my account with it, and check how many people from the contacts have the app installed? (similar to how WhatsApp does it)
I know it's possible to get the contact list by using Apple API's, but do i have to send all the information to the server to check if they have the app installed?
Thank you.
I think you are managing one local database to store users locally.
First, You must have one contact mapping table on server that determines which number is allocate to which user (Each user must have unique number per account).
You have to pass array of phone numbers to your server request and fire query to get only those users whose phone numbers are in array.
You get one users objects array and that array you have to save in local database. (You can store all contacts in local database and update record (for appId, contactId, server name etc) is user is application user).
Finally these users who has appId are your application users.
Hope this concept might help you.
If you are using webservices your backend will can give the contacts which are using your application.
For getting the app contacts you have to use user phone number using phone number you can get the app user through webservices
to get all contact from Phonebook you can use below method in swift
first import Contacts
func FetchContact()
{
if #available(iOS 9.0, *) {
let contactStore = CNContactStore()
do {
let request:CNContactFetchRequest
request = CNContactFetchRequest(keysToFetch: [CNContactGivenNameKey, CNContactFamilyNameKey, CNContactMiddleNameKey, CNContactEmailAddressesKey,CNContactPhoneNumbersKey])
request.sortOrder = CNContactSortOrder.GivenName
try contactStore.enumerateContactsWithFetchRequest(request) {
(contact, cursor) -> Void in
self.dataArray?.addObject(contact)
}
}
catch{
print("Handle the error please")
}
//self.collectionView?.reloadData()
}
}

How to avoid posting duplicate sales receipt in Quickbooks desktop version using Data service?

I am posting Sales Rceipts from my application to QuickBooks Desktop using Data Service. My Invoice numbers are unique and i am posting them as a SalesReceipt DocNumner. I just wanted to check if the same DocNumber is already present in QuickBooks wittout querying all the QB Sales Receipts.
Is there any way to do it?
-Bharat
'DocNumber' is not an unique key and it is not mentioned in the following docs as a filter attribute. So, you have to query all the QB SalesReceipts.
for (QBSalesReceipt salesReceipt : qbSalesReceipt.findAll(context,i, 100)) {
System.out.println("Doc Number - " + salesReceipt.getHeader().getDocNumber());
}
IPP Docs - https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0500_quickbooks_windows/0600_object_reference/salesreceipt#Retrieving_SalesReceipts_Using_a_Query_Filter

Resources