How to get the receipt_url in Square Connect V2 - square-connect

I found the instructions to get the receipt_url in Version 1 of of Connect but I cannot find how to get the receipt_url for Connect Version 2 from a transaction. Where can we find that?

Unfortunately, there is no receipt_url currently in Connect V2 APIs. If you have a transaction_id, you can retrieve said transaction, and then the tender object (in the tenders array) will have an id which corresponds to a Connect V1 Payment (so you could use the tender_id with RetrievePayment as the payment_id).
References:
https://docs.connect.squareup.com/api/connect/v2#type-transaction

Related

Using Time To Live(TTL) for spring data cassandra repository

Not able use TTL with spring data CassandraRepository based implementation.
Spring data cassandra version: Latest
I am trying to use TTL property of cassandra for save operation using spring data repository based implementation. however looking at the reference documentation(https://docs.spring.io/spring-data/cassandra/docs/current/reference/html/) i dont see any straight forward way of using it.
Even though docs mentioned that we can use it but no example provided for repository based implementation. Do note that i see some example using cqlTemplate and cassadraOperations. But none for repository.
No code written yet as I am trying to figure out how to use it
Expectation would be some kind #TTL(value in seconds) annotation on repository save/update method for easier implementation.
Refer to A Sarkar's answer from this post TTL support in spring boot application using spring-data-cassandra
Please see my sample code here, https://github.com/nontster/spring-data-cassandra-demo
I borrow sample code from this tutorial https://www.baeldung.com/spring-data-cassandra-tutorial
You need to create demo keyspace before you can run this code,
CREATE KEYSPACE demo WITH replication = {'class':'SimpleStrategy', 'replication_factor' : 1};
Run saveBookTest() method in BookRepositoryIntegrationTest.java and you can see countdown TTL in column via (I set TTL to 600 seconds)
cqlsh:demo> SELECT title,TTL(year) FROM Book WHERE title='Head First Java' AND publisher='O''Reilly Media';
title | ttl(year)
-----------------+-----------
Head First Java | 597
(1 rows)

How to share location in a group with glympse rest api

I am trying to share my location to a card with following steps:
create a ticket with API /users/self/create_ticket
set the card_id of the ticket with API /tickets/:id/append_data
share ticket to a card with API /cards/:id/ticket, invite_code: random string like pUsl_79rB
append location into the ticket whit API /tickets/:id/append_location
Then I retrieve card members with API /cards/:id?members=true, I can see the ticket just created and shared to the card.
But the problem is that the invite_code is always "00" like following:
"ticket": {"invite_code": "00", "ticket_id": "160064993", "created_time": 1506573004818}
With invite_code "00", no one can get the location I shared.
Please help.
thanks.
You need to create invite code for the ticket created in step 1). So your step 1.1) would involve calling `POST tickets/:id/create_invite?type=link'. This will provide you with the code that goes to the card in step 3).

Which paypal api to just fetch all transactions

Very confused by the crowd of paypal-APIs, I wonder if I just can fetch the transactions (in and out) somehow, just like I would it export to csv via webinterface.
Here I am:
REST-API seems not working for "non-rest-transactions" Payment.all.size == 0 paypal-rest-api-list-payments-returns-no-entries
Merchant-API does not allow detailed info for specific transactions.
https://developer.paypal.com/webapps/developer/docs/classic/api/merchant/GetTransactionDetails_API_Operation_SOAP/ says:
Note The details for some kinds of transactions cannot be retrieved
with GetTransactionDetails. You cannot obtain details of bank transfer
withdrawals, for example.
I recieved a view transactions via transactionSearch. Took the transactionId from one of the transactions.
api.get_transaction_details(:transaction_id => transaction_id>)
=> #<PayPal::SDK::Merchant::DataTypes::GetTransactionDetailsResponseType:0x007fd3c0f1f8d8
#Ack="Failure",
#Errors=[#<PayPal::SDK::Merchant::DataTypes::ErrorType:0x007fd3c0f379d8
#ShortMessage="Invalid transaction type",
#LongMessage="You can not get the details for this type of transaction",
#ErrorCode="10004",
#SeverityCode="Error">]
Adaptive-API (PaymentDetails with transactionID) throws an "internal error 520002" with no details. (And I found no specification if it could fetch all transactions)
Ok, it's Paypal. But there must be a simple solution they forgot to mention. (?!) Or what did I miss?
Thanks and regards, Phil
I don't know where you're seeing info that the merchant API won't provide details about transactions, but that's simply wrong.
You you can use TransactionSearch to obtain a list of transactions within a given time period, and then you can loop through those results and use GetTransactionDetails to obtain the details for each individual transaction.

Is there a way to know if a device has version 3 of SNMP enabled without the credentials?

I need to do a device discovery which is working fine for version 1,2 because the community name by default "public" help me on this, but for the version 3 the credentials are required, do ou know any tool o method to know that ?
As described in https://www.rfc-editor.org/rfc/rfc3414#section-4 you can send an empty v3 pdu. If the device supports v3 protocol it will respond (a report message) with it's snmpEngineID.
'This may be accomplished by generating a Request message with a securityLevel of noAuthNoPriv, a msgUserName of zero-length, a msgAuthoritativeEngineID value of zero length, and the varBindList left empty.'
#DominikPawlak already shows the RFC compliant approach. If you want some code sample, #SNMP has a sample called snmpdiscover,
http://sharpsnmplib.codeplex.com/wikipage?title=SNMP%20Device%20Discovery&referringTitle=Documentation

reading EMV card using PPSE and not PSE

I'm trying to read the data off a contactless Visa Paywave card.
For the Paywave, I have to submit a SELECT using PPSE (2PAY.SYS.DDF01) instead of PSE (1PAY.SYS.DDF01).
The EMV book 1, section 11.3.4, table 43 only describes how to interpret the response for a successful SELECT command using PSE. Does anyone know or can refer me to a source that shows how to process the data returned from a successful SELECT command using PPSE?
Here's my request APDU:
00A404000e325041592e5359532e444446303100
Here's the response:
6F2F840E325041592E5359532E4444463031A51DBF0C1A61184F07A0000000031010500A564953412044454249548701019000
I understand tag 84, tag 85, tag BF0C from the response. According to the examples for reading PSE, I should be able to just send GET PROCESSION OPTIONS (to get the AIP and AFL) with PDOL = null after this successful response as follows: 80A80000830000.
But request 80A80000830000 returns error code 6985 - Command not allowed; conditions of use not satisfied.
I also tried reading all the files after successfully selecting the PPSE by traversing through every single SFI (0-30) and every single record (0-16) of each SFI. Yes, I also did the 3 bit shift and bitwise-OR the SFI with 0x4. But I got no data.
I'm stuck, any help that would point me into getting some info from my Paywave card would be appreciated!
Have you tried this tool from EMVLAB http://www.emvlab.org/emvtags/
Using that tool,
http://www.emvlab.org/tlvutils/?data=6F2F840E325041592E5359532E4444463031A51DBF0C1A61184F07A0000000031010500A564953412044454249548701019000
2PAY.SYS.DDF01 is for contactless (e.g. NFC ) cards, while 1PAY.SYS.DDF01 is for contact cards.
After successfully (SW1 SW2 = 90 00) reading a PSE, you should only search for the SFI (tag 88) which is a mandatory field in the FCI template returned.
With the SFI as your start index, your would have to read the records starting from the start index until you get a 6A83 (RECORD_NOT_FOUND). E.g. if your SFI is 1, you would do a readRecord with record_number=1. That would probably be successful. Then you increament record_number to 2 and do readRecord again. The increament to 3 .... Repeat it until you get 6A83 as your status.
The records read would be ADFs (at least 1). Then your would have to compare the read ADF Names with what your terminal support and also based on the ASI (Application Selection Indicator). At the end you would have a list of possible ADFs (Candidate list)
All the above steps (1-3) are documented in chapter 12.3.2 Book1 v4.3 of the EMV spec.
You would have to make a final selection (Chapter 12.4 Book1)
Read the spec book 1 chapter 12.3 - 12.4 for all the detailed steps.
You seem to have the flow mixed up a bit, you want to:
Send 1PAY or 2PAY, it doesn't actually matter for all of the cards I've tested. This will return a list of the AIDs available on the card. Alternately you can just select an AID straight away if you know it's there but good practice would be to check first.
Get the list of AIDs returned in response to 1PAY/2PAY, in PayWave's case this will probably be A0000000031010 if you sent 2PAY but you may get more if you send 1PAY.
Select one of the AIDs sent back (or one you already know is on there).
Then loop through the SFIs and records sending the Read Records command to get the data.
You don't have to send Get Processing Options before sending the Read Records command even though that's now a normal transaction flow goes.
I think the information you're looking for is available from this VISA website. But only if you're a registered and/or licensed partner of VISA.
EDIT: Looking at the resulting TLV struct under BF0C:
tag=0xBF0C, length=0x1A
tag=0x61, length=0x18
tag=0x4F, length=0x07, value=0xA0000000031010 // looks like an AID to me
tag=0x50, length=0x0A, value="VISA DEBIT"
tag=0x87, length=0x01, value=0x01
I would guess that you need to first select A0000000031010 before getting the processing options.
I was selecting application 2PAY.SYS.DDF01. when I should have been selecting AID = 0xA0000000031010. It looks like there's no records under application 2PAY.SYS.DDF01.
But there was 1 record under application 0xA0000000031010. After I got this application, I performed a READ RECORD, and the first record gave me the PAN and all the credit card info I wanted.
Thanks everyone for chiming in.

Resources