Payment verification with the iOS Paypal SDK - Clarification needed please - ios

I have a specific question about the verification side of Paypal (using the latest iOS PayPal SDK)
From this document: https://github.com/paypal/PayPal-iOS-SDK/blob/master/docs/single_payment.md
This is mentioned:
Send the payment response to your servers for verification, as well as any other processing required for your business, such as fulfillment. Tip: At this point, the payment has been completed, and the user has been charged. If you can't reach your server, it is important that you save the proof of payment and try again later.
And from there is a link to the verify-mobile payments documentation, in which various things are mentioned, i'm assuming this part applies to the iOS SDK (latest)
Looking up a payment using the REST API
You can payment id value in a response to look up a payment by calling the REST API. The following example retrieves a payment in the sandbox:
curl
https://api.sandbox.paypal.com/v1/payments/payment/PAY-5YK922393D847794YKER7MUI
\ -H "Content-Type: application/json" \ -H "Authorization: Bearer
{accessToken}" You should verify that the Payment:
Is approved ("state": "approved"). Contains a Transaction with: An
Amount with total and currency that match your expectation. A Sale
that is completed (in related_resources, with "state": "completed").
The live endpoint is
https://api.paypal.com/v1/payments/payment/{payment_id}.
https://developer.paypal.com/webapps/developer/docs/integration/mobile/verify-mobile-payment/
Got it. So given the above assumptions (which I hope are correct!) what should one do with the details returned from the server? Save them to a database?
The docs seem to be a little vague in terms of this particular subject. This is my understanding of the flow:
1) Make payment.
2) Send payment details to server.
3) Get back payment state from server.
4) Check that it's approved and the other details match up (amount, currency etc)
5) Upon making another payment, check to see if the payment id has already been used? This is another part of my confusion.
Thank you in advance for any assistance. Just would like some clarification in layman's terms to see if I understand the flow correctly.

from the sdk you will get a response which will have a state and id. the id you should save to database for your purposes, because you can always call /payments/id https://developer.paypal.com/webapps/developer/docs/api/#look-up-a-payment-resource and see the details of it. Every id is unique. state will have more information if the payment has been successful or not. Please check documentation. Hope it helps.

Related

The verification could not be sent to NeverBounce

I am new at Zapier and trying to make an email verification using NeverBounce from Zapier and complete the following setup.
I create an app in NeverBounce.
I complete Trigger in steps in Zapier.
Completed the Action and logged in NeverBounce by IP key.
And finally, during testing, I get this error!
The verification could not be sent to NeverBounce.
The app returned `{"message":"We were unable to complete your request. Check our system status at https://twitter.com/neverbounceapi as their may be an issue with our system. The following information was supplied: Insufficient credit balance.
Here is an screen shoot of the error I am facing
Thanks for your help😊.
The error message says you don't have enough credits, you may want to check your account. Or this may be just a glitch with the test procedure and you may want to just proceed with the Zap and see if the actual run is successful.
As an alternative, you may want to switch to Verifalia instead, which not only includes daily credits even with its free plan but also allows to verify lists of email addresses through Zapier (in addition to single email verification).
Verifalia integrations: https://verifalia.com/integrations
Verifalia Zapier integration: https://zapier.com/apps/verifalia/integrations
Disclaimer: I work for Verifalia and have developed its Zapier integration.

Check status after verification - Twilio Verify

I have a web app with following 3-step flow using Twilio Verify for email verification:
Creating verification code with Verify
Checking verification code with Verify
Create user account in my web api
After a successful Twilio Verify verification code check (step 2), I need to be able to do another Twilio Verfy call to ensure that the email was verified before a user account is actually created in my web api (step 3). But since the SID is deleted after successful email verification, I get following answer for a GET request to:
https://verify.twilio.com/v2/Services/{ServiceSid}/Verifications/{Sid}
{
"code": 20404,
"message": "The requested resource /Services/VAxxx/Verifications/VExxx was not found",
"more_info": "https://www.twilio.com/docs/errors/20404",
"status": 404
}
Now, for the Frontend, it's easy: I move to the final account creation step only if the email was verified successfully.
But, for a true stateless Backend, after accepting the Frontend request I first need to double-check with Twilio if the email was actually already verified.
True stateless in the sense that I do not want to store in a DB if an email was already verified or not. (This is already done by Twilio)
How can I do that? I didn't find the right API in the Twilio documetaion.
Twilio developer evangelist here.
I understand that you would like to get the information that appears available in the logs, however that is not available through the API. Once a verification has succeeded (or timed out after 10 minutes, or reached the maximum number of incorrect attempts) it is deleted and you can no longer access it through the API. I assume this is to prevent replay attacks, but I’m not on that team, so don’t know all the reasons behind it.
The result of this is that you cannot call on the verification check more than once from your code.
You will have to store the state within your own system because the API will not store that state for you. Much like during login with 2FA you would need to store the state that a password had been successfully entered.

Rails Square API - `Authorization` http header of your request was malformed

I am building a Rails 5 app that submits a payment to square.
I have a form that post register info to my DB then calculates amounts to be charged to credit card.
I am using the Square SqPaymentForm found in the Payment Forms doc.
When I attempt to process the CC I am receiving an error saying malformated authorization token.
I am not sure how to even pass an authorization token and all the documents and example code I look at dose not indicate that I need to configure any header model, method, etc..
Any help or advice is welcomed please keep in mind that this is my first attempt to link a ROR ap to a third party API. Here is my Git to view my code.

How do we get transaction fee amount from paypal?

I am using PayPal iOS sdk to accept payment from user in my iOS app. I am using sandbox for testing. The payment is working fine, I am getting successful payment response along with Payment_ID. I am passing that Payment_ID to my server and from there using REST API (Show payment details), I am trying to retrieve all the information related to that payment but it is not consistent response.
Sometimes I am getting transaction_fee while sometimes it does not return in API response.
I see there is another NVP/SOAP method to get details but that requires transaction_id while i am only having Payment_ID.
does anyone have solution on how to get transaction fee from paypal?
I got the solution now!
I was receiving Payment_ID in response from from Paypal iOS SDk after payment successfully done. I am passing that to my server and the server is calling Show payment details REST API to get all payment details
GET /v1/payments/payment/payment_id
In above API response for some cases when transaction state is completed, paypal does not returning transaction_fee_amount. but it returns sale-->id (transactionId).
Using Paypal PHP Library, I used that transactionId and made NVP call for below API,
https://developer.paypal.com/docs/classic/api/merchant/GetTransactionDetails_API_Operation_NVP/
Voila!! In successfull response of that I am getting all the details for that transaction.

PayPal Sandbox - CreateBillingAgreement call returns Internal Error (10001)

I'd appreciate any help with this, I've run around in circles trying all sorts of combinations with the PayPal Api - but I'm hitting a brick wall on this one.
I'm looking to call the CreateBillingAgreement method but each time I do it fails and reports a 10001 'internal error' from paypal in the response.
I have a valid token and I'm using version 84.0. I've successfully called SetupExpressCheckout and DoExpressCheckout, both of which succeed and the payment goes through. I'm setting up a future payment / pre-authorisation on the SetupExpressCheckout and the user agrees to that no problems.
​Do I need to change settings on the merchant in the sandbox? Am I calling things in the wrong order maybe? (SetExpress, GetExpress, DoExpress, CreateBilling)?
​I'm looking to use this billing agreement to allow a reference transaction in the future. I'm having a test account 'pay' using paypal and not forwarding any credit card details, the payment is for a digital service with no delivery (no shipping is set, no addresses or delivery costs are involved). The overall goal is to provide a one-click re-order button, whereby no details need to be entered by the customer.
I'm using the C# api in asp.net 4, or more specifically I've created Service References from the paypal sandbox wsdl and I'm using those in asp.net.
​Any and all help is appreciated - thanks.
​Russell.
You don't need to call CreateBillingAgreement if you're specifying billingtype MerchantInitiatedBilling in your SetExpressCheckout and DoExpressCheckoutPayment API call. CreateBillingAgreement is only necessary if you don't want to call DoExpressCheckoutPayment.
If MerchantInitiatedBilling is set, DoExpressCheckoutPayment will already return a billing agreement ID, which you can use in DoReferenceTransaction.
I don't have access to an example at hand, but will update this post as soon as I've found one for you.

Resources