How to get payer id from paypal via IOS MSDK2.x? - php

I have a question when using the Paypal IOS MSDK2.x in conjunction with Kount fraud checking.
Currently the MSDK2.x will return a payment confirmation in the delegate
"- (void)payPalPaymentViewController:(PayPalPaymentViewController *)paymentViewController didCompletePayment:(PayPalPayment *)completedPayment"
in this format of PayPalPayment class
{
"client": {
"environment": "sandbox",
"paypal_sdk_version": "2.0.0",
"platform": "iOS",
"product_name": "PayPal iOS SDK;"
},
"response": {
"create_time": "2014-02-12T22:29:49Z",
"id": "PAY-564191241M8701234KL57LXI",
"intent": "sale",
"state": "approved"
},
"response_type": "payment"
}
where the info "Payer Id" is not included.
To work with Konut, the Kount server needs the "Payer Id" to be provided/updated in the inquiry. This "Payer Id" can be obtained if the payment request is made via web form where the paypal server will return a URL of this format
"http://<return_url>?paymentId=PAY-6RV70583SB702805EKEYSZ6Y&token=EC-60U79048BN7719609&PayerID=7E7MGXCWTTKK2"
My question is anyone know how to get the "Payer Id" if the payment request is sent from mobile device that runs IOS MSDK2.x?
Thanks very much.

Actually I have solved this problem. Just had not got time to update it here.
The steps to do this are:
Use the payment id to get the security token from here
"https://api.paypal.com/v1/oauth2/token"
Use "POST" with your paypal private token.
Use the security token to to get the payer id.
https://api.paypal.com/v1/payments/payment/$your_payment_id"
You can use curl_setopt to do both steps on PHP. Hope this helps if anyone else has the same issue.
Thanks.

Related

m-Pesa STKPush Request throws an error "update failed9"

Folks, hope you all doing good.
I'm working on a project in PHP in which we have to integrate m-Pesa as payment gateway. I don't know how and why but "Lipa Na M-Pesa Online Payment"
this API when called it gives an error
update failed9
in Sim Tool Kit push dialog box. Even though we are getting a positive response from the m-Pesa server that "Your Request is accepted for processing" and then after a while(10 mins or so) our callback URL gets called by the m-Pesa server with a response of request timed out.
Here is my Request Body:
{
"BusinessShortCode": "242599",
"Password": "MjQyNTk5YmZiMjc5ZjlhYTliZGJjZjE1OGU5N2RkNzFhNDY3Y2QyZTBjODkzMDU5YjEwZjc4ZTZiNzJhZGExZWQyYzkxOTIwMTkwNzEzMTI1NTMw",
"Timestamp": "20190713125530",
"TransactionType": "CustomerBuyGoodsOnline",
"Amount": "1000",
"PartyA": "254708374149",
"PartyB": "242599",
"PhoneNumber": "254721705529",
"CallBackURL": "http://961bb2f4.ngrok.io/hooks/mpesa",
"AccountReference": "account",
"TransactionDesc": "test" }
Here is the error screenshot
Are you able to get the screen to enter your PIN? you can use that to tell if safaricom is able to initiate the API on your end.

Verify a signed Firebase user from Symfony backend

I have a firebase project and I use a simple web page to login to firebase with username and password just like below...
firebase.auth().signInWithEmailAndPassword
('test.account#gmail.com', 'password').
catch(function (error) {
});
And I got the response like below...
{
"kind": "identitytoolkit#VerifyPasswordResponse",
"localId": "iWFUfdgdsdfsC2",
"email": "test.account#gmail.com",
"displayName": "",
"idToken": "whfGUWiyDE74HsnwN5ZkJn7gX",
"registered": true,
"refreshToken": "SZaG1tmzkgn5EImQ_nRj8",
"expiresIn": "3600"
}
I followed "kreait/firebase-bundle". But didn't get any idea.
My question is is there any way to verify the signed user from symfony backend ?
Someone please help me...

Charging a card stored in vault not working for paypal sandbox mode

I am integrating paypal in my project. I am storing card in paypal vault. It is working fine.
But charging a stored card in totally not working.
Here is what i tried.
The url i am hitting
https://api.sandbox.paypal.com/v1/payments/payment
The headers i sent
Content-Type : application/json
Authorization : Bearer A101.cckgmkChgGI1jLstRxxxxxxxx
and the body
{
"intent":"sale",
"payer": {
"payment_method":"credit_card",
"funding_instruments":[
{
"credit_card_token":{
"credit_card_id":"CARD-62T3953xxxxx",
"payer_id":"user12345"
}
}
]
},
"transactions":[
{
"amount":{
"total":"125",
"currency":"USD"
},
"description":"This is test payment"
}
]
}
and the response i am getting
{
"name": "INTERNAL_SERVICE_ERROR",
"information_link": "https://api.sandbox.paypal.com/docs/api/#INTERNAL_SERVICE_ERROR",
"debug_id": "aa518e23593df"
}
and the information link given is not working
You should use credit card info in sandbox accounts that created in PayPal App to store to vault. Then it will work with creating payment. Good luck!

Google Wallet 500 Server Error

I got my subscriptions all working in the sandbox about 5 days ago, but a day after I finished testing it I started getting 500 server errors every time I try to test my subscriptions in sandbox and in production. I have not changed the code what so ever and my JWTs still decode perfectly.
Any ideas why this is happening? I've contacted Google many times but most of the people I get a hold of clearly have no idea what they are talking about...
Has anyone ever run into this issue before? Any input is appreciated!
The failing red line is the google sandbox code:
<script src="https://sandbox.google.com/checkout/inapp/lib/buy.js"></script>
POST:
[,"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiIxMTQ4MTc0NTgxNTIzNzcxMTY5OSIsImF1ZCI6Ikdvb2dsZSIsInR5cCI6Imdvb2dsZVwvcGF5bWVudHNcL2luYXBwXC9zdWJzY3JpcHRpb25cL3YxIiwiZXhwIjoxNDAyMjQ3NTMyLCJpYXQiOjE0MDIyNDM5MzIsInJlcXVlc3QiOnsibmFtZSI6IkF1dG9tYXRvbiBTY2hlZHVsZXIgU3Vic2NyaXB0aW9uIChQUk8pIiwiZGVzY3JpcHRpb24iOiJNb250aGx5IHN1YnNjcmlwdGlvbiB3aXRoIHVwIHRvIDUwIHVzZXJzLiIsImN1cnJlbmN5Q29kZSI6IlVTRCIsInNlbGxlckRhdGEiOiJ1c2VyX2lkOixzdWJzY3JpcHRpb25faWQ6MiIsImluaXRpYWxQYXltZW50Ijp7InBheW1lbnRUeXBlIjoiZnJlZV90cmlhbCJ9LCJyZWN1cnJlbmNlIjp7InByaWNlIjoiNjAuMDAiLCJjdXJyZW5jeUNvZGUiOiJVU0QiLCJmcmVxdWVuY3kiOiJtb250aGx5In19fQ.sju0xaOf9u3ufxow0XxWF4j-QUY0XgtF0A0d8g1rRiQ",,,1]
Response:
[,,4,"VTTMKJ"]
Based on above, this is the request object in your JWT payload:
"request": {
"name": "Automaton Scheduler Subscription (PRO)",
"description": "Monthly subscription with up to 50 users.",
"currencyCode": "USD",
"sellerData": "user_id:,subscription_id:2",
"initialPayment": {
"paymentType": "free_trial"
},
"recurrence": {
"price": "60.00",
"currencyCode": "USD",
"frequency": "monthly"
}
}
Note the docs regarding the structure and required fields in a subscription request. So:
There is no currencyCode in a subscription request
The above initialPayment object is missing required fields:
price
currencyCode
Hth....

get the user who sent application request

Scenario:
User A send application request to user B
User B accepts request
after accepting request, I want User A's facebook ID who actually sent request
In short I want inviting user on application request accept event of invitee user.
You can get the details on request (including creator details) by querying Graph API with ID of request (you have list of accepting request ids in request_ids parameter passed to you app canvas):
https://graph.facebook.com/REQUEST_ID
This will return details in following format (as described in requests documentation, see "Accepting an App Request / Request ID Format"):
{
"id": "REQUEST_OBJECT_ID",
"application": {
"name": "APP_DISPLAY_NAME",
"canvas_name": "APP_NAME", // This is identical to the app namespace
"namespace": "APP_NAMESPACE",
"id": "APP_ID"
},
"from": {
"name": "SENDER_USER_NAME",
"id": "SEND_USER_ID"
},
"message": "Check out this Awesome Request!",
"created_time": "2012-01-24T00:43:22+0000",
"type": "apprequest"
}

Categories