Paypal API integration for debit and Credit card with Node JS - reactjs

I am tiring to add credit debit card integration that are already saved in our database and I don't want user to fill those information to the paypal debit/credit card payment form.
I want to know
Is there a way to auto populate information from my database to paypal from?
Or how can I use orders API to directly pass the information to the paypal using API integration.
The Paypal really is a mess. Can anyone please help me in the integration.
NOTE : I am using React JS as front-end and nestjs as back-end.

You can't populate a form, and storing credit card information in your database is a potentially problematic practice you should review (better to tokenize/vault it) and requires a full PCI self-assessment review.
But as for how to send credit cards to PayPal via an API, if anaccount is enabled for Advanced Credit and Debit Card processing, the below might allow you to use the v2/checkout/orders API with card details in the payment_source object
(Edit: apparently more permissions are needed from PayPal for this)
{
"intent": "CAPTURE",
"payer": {
"name":{
"given_name": "John",
"surname": "Doe"
},
"email_address":"johndoe#buyersemail.com"
},
"purchase_units": [
{
"reference_id": "0000",
"description": "Transaction description",
"custom_id": "Optional arbitrary private transaction-related ID/data, 127 chars",
"soft_descriptor": "Shows On CC statement",
"amount": {
"currency_code": "USD",
"value": "100",
"breakdown": {
"item_total": {
"currency_code": "USD",
"value": "100"
},
"shipping": {
"currency_code": "USD",
"value": "0"
}
}
},
"shipping":{
"name":{
"full_name":"John Doe"
},
"address": {
"address_line_1": "123 nowhere lane ",
"address_line_2": "Unit 123",
"admin_area_2": "San Jose",
"admin_area_1": "CA",
"postal_code": "95131",
"country_code": "US"
}
}
}
],
"payment_source": {
"card": {
"number": "4032038000494967",
"expiry": "2023-04",
"security_code":"123",
"name": "John Doe",
}
}
}

Related

Graph API User delta query not returning Manager following a change to the user

When I run this initial query:
https://graph.microsoft.com/beta/users/delta?$select=id,displayName,manager,jobTitle&$filter=id+eq+'87fa2ed7-5e58-4ff5-85ca-42a973e103e7'
I get the following response (as expected):
{
"#odata.context": "https://graph.microsoft.com/beta/$metadata#users(id,displayName,jobTitle,manager)",
"#odata.nextLink": "https://graph.microsoft.com/beta/users/delta?$skiptoken=<removed>",
"value": [
{
"displayName": "Jane Doe",
"jobTitle": "Super Administrator",
"id": "87fa2ed7-5e58-4ff5-85ca-42a973e103e7",
"manager#delta": [
{
"#odata.type": "#microsoft.graph.user",
"id": "1ab00b74-6f7e-45ca-8629-22d64632501d"
}
]
}
]
}
I follow the #odata.nextLink URL, which returns:
{
"#odata.context": "https://graph.microsoft.com/beta/$metadata#users",
"#odata.deltaLink": "https://graph.microsoft.com/beta/users/delta?$deltatoken=<removed>",
"value": []
}
I don't really understand why it doesn't just give me the deltaLink in the first call, but that isn't the issue. At this point, I make a change to the user's job title in Azure AD (outside of Graph API) and then follow the #odata.deltaLink, which returns:
{
"#odata.context": "https://graph.microsoft.com/beta/$metadata#users",
"#odata.deltaLink": "https://graph.microsoft.com/beta/users/delta?$deltatoken=<removed>",
"value": [
{
"displayName": "Jane Doe",
"jobTitle": "Administrator",
"id": "87fa2ed7-5e58-4ff5-85ca-42a973e103e7"
}
]
}
No manager!!
The only attribute changed was the job title; Manager is unchanged. This behavior is the same in both the v1.0 and beta endpoints. Also, I am not using the "prefer:return=minimal" header (or any additional headers for that matter).
Can anyone provide some insight into this?

Azure Indoor Maps not rendering

Trying to create floor plan upload to azure indoor maps. It is uploaded using postman and got the tilesetid but when I provide tilesetid in the Azure Indoor maps sample, it is not rendering the image in html file. When I use sample zip file provided by azure it is working fine.
Following the article as shown in Azure Indoor Maps
Autocad settings
Below is the manifest file
{
"version": "1.1",
"directoryInfo": {
"name": "Digital Twins Testing Building",
"streetAddress": "Contoso Way",
"unit": "1",
"locality": "Eastside",
"postalCode": "00000",
"adminDivisions": [
"Contoso City",
"Contoso State",
"United States"
],
"hoursOfOperation": "Mo-Fr 08:00-17:00 open",
"phone": "1 (425) 555-1234",
"website": "www.contoso.com",
"nonPublic": false,
"anchorLatitude": 33.44277,
"anchorLongitude": -112.072754,
"anchorHeightAboveSeaLevel": 1000,
"defaultLevelVerticalExtent": 2
},
"buildingLevels": {
"levels": [{
"levelName": "Ground Level",
"ordinal": 0,
"verticalExtent": 5,
"filename": "./GroundLevelFloorPlan.dwg"
}]
},
"georeference": {
"lat": 33.44277,
"lon": -112.072754,
"angle": 0
},
"dwgLayers": {
"exterior": [
"exterior"
],
"unit": [
"unit"
]
}
}
From the manifest, I see you expressed loading only exterior and unit, and didn't pass the label layer which is what brings labels and let you add more properties for the units (or zones). If you don't see the map, I would suggest checking the conversion results (see here) which is always a good practice. Another good way to troubleshoot is review the content in the dataset via WFS API, for example units via https://atlas.microsoft.com/wfs/datasets//collections/unit/items?api-version=1.0&subscription-key={{subcriptionkey}}

Cannot set SKU using Quickbooks API

I’m trying to create an item using the Quickbooks Online API, but the field Sku is just ignored. I send a body like this:
{
"TrackQtyOnHand": true,
"Name": "Garden Supplies",
"Sku": "ITEM-1",
"QtyOnHand": 10,
"IncomeAccountRef": {
"name": "Sales of Product Income",
"value": "79"
},
"AssetAccountRef": {
"name": "Inventory Asset",
"value": "81"
},
"InvStartDate": "2015-01-01",
"Type": "Inventory",
"ExpenseAccountRef": {
"name": "Cost of Goods Sold",
"value": "80"
}
}
However in the object I get back as response, the Sku field is not there.
I set the parameter minorVersion to 45 (which is something I was suggested to do), but still not working.
I think the problem is that the param minorVersion should actually be minorversion (all lowercase).

How to get 'trades' resource from Coinbase API?

I use coinbase-node and got transaction API response.
In this response, I can see something like:
{
...
"created_at": "2019-04-21T13:58:12Z",
"updated_at": "2019-04-21T13:58:12Z",
"resource": "transaction",
"resource_path": "/v2/accounts/68a42d04-2075-529c-8cd8-183cd148c45f/transactions/279db234-ca73-5e66-b70a-94502d44739e",
"instant_exchange": false,
"trade": {
"id": "f4ff2d5d-07b7-5c2c-807d-7b98591b488a",
"resource": "trade",
"resource_path": "/v2/accounts/68a42d04-2075-529c-8cd8-183cd148c45f/trades/f4ff2d5d-07b7-5c2c-807d-7b98591b488a"
},
"details": {
"title": "Converted to Bitcoin Cash",
"subtitle": "Using BTC Wallet",
"payment_method_name": "BTC Wallet"
},
...
}
my goal is to find a way to get a trade by ID
any ideas?
This post should help you.
How to import conversions in coinbase api?
At this moment it is impossible to get trades from API call, but you can construct object yourself using trade Id.

Docusign REST API MERGE FIELD - SALESFORCE

Im trying to prefill my document with salesforcse Lead Name, however i cant accomplish it, the signHereTabs, and dateSignedTab is showing but the
texttabs dont get any data,
The REST API Documentation https://docs.docusign.com/esign/restapi/CustomTabs/CustomTabs/create/#request
says: that the row field is the "Specifies the row number in a Salesforce table that the merge field value corresponds to." but if i pass the salesforce record id im getting the error:
DocuSign Response{
"errorCode": "INVALID_REQUEST_PARAMETER",
"message": "The request contained at least one invalid parameter. int value expected for parameter: mergeField.row"
}
This is my json request:
{
"emailSubject": "Agreement",
"emailBlurb": "MSTSolutions is sending you this request for your electronic signature and enter or update confidential payment information.Please review and electronically sign by following the link below.",
"templateId": "42a4815d-f8ac-4972-b1ea-2e1534324658",
"envelopeIdStamping": "false",
"templateRoles": [{
"roleName": "Signer 1",
"name": "TEST TEST",
"email": "xxx#xxxx.com",
"recipientId": "1",
"tabs": {
"signHereTabs": [{
"xPosition": "25",
"yPosition": "50",
"documentId": "1",
"pageNumber": "1"
}],
"dateSignedTabs": [{
"name": "Date Signed",
"xPosition": "25",
"yPosition": "100",
"documentId": "1",
"pageNumber": "1"
}],
"textTabs": [{
"tabLabel": "LeadFirstName",
"xPosition": "25",
"yPosition": "200",
"documentId": "1",
"pageNumber": "1",
"mergeField": {
"configurationType":"Salesforce",
"path":"Lead",
"row":"00Q29000003fI13",
"writeback":"true",
"allowSenderToEdit":"true",
}
}]
}
}],
"status": "sent"
}
Thanks
Fairly sure the error is is how your path is configured. Try this:
"path": "Lead.FirstName"
and then remove the "Row" line
If you use the 'GET /v2/accounts/{accountId}/envelopes' create endpoint you can pass in the lead/opportunity/account Ids via the "Custom Fields" section. This will set all custom Salesforce fields you have defined in the template (relating to the SFIDs you provide) without having to set each tab one by one.
"customFields":{
"textCustomFields":[
{
"value":"0060n00000DIvfNAAT",
"name":"Opportunity",
"configurationType":"salesforce"
}
]
}
Note the textCustomFields is enclosed in a customFields block (which matches the published API) and most importantly, the configuration type must be set to "salesforce" and the Name must be "Opportunity" (etc) without the ##SF prefix which appears in a lot of examples on the web (for the SOAP api). By examining the 'GET /v2/accounts/{accountId}/envelopes/{envelopeId}/custom_fields' endpoint you can see that the API is automatically afixing the ##SF prefix and modifying the Value to include the record name:
{
"textCustomFields": [
{
"fieldId": "10140751586",
"name": "##SFOpportunity",
"show": "false",
"required": "false",
"value": "0060n00000DIvfNAAT~Test Opp Lisa Simpson"
}
}

Resources