• Toll-free  888-665-8637
  • International  +1 717-220-0012
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

tappedtech
#1 Posted : Sunday, January 11, 2015 9:37:52 AM(UTC)
tappedtech

Rank: Member

Joined: 11/21/2014(UTC)
Posts: 66

How can I allow a user to pay with PayPal while using the BVC web service?
Aaron
#2 Posted : Monday, January 12, 2015 11:19:12 AM(UTC)
Aaron

Rank: Administration

Joined: 4/2/2004(UTC)
Posts: 2,381
United States
Location: Hummelstown, PA

Thanks: 6 times
Was thanked: 163 time(s) in 158 post(s)
The API alone isn't enough to integrate PayPal into your application. The reason is because your application will need to exchange data with PayPal and then use the API to send that data to BV Commerce.
Aaron Sherrick
BV Commerce
Toll-free 888-665-8637 - Int'l +1 717-220-0012
tappedtech
#3 Posted : Monday, January 12, 2015 4:04:04 PM(UTC)
tappedtech

Rank: Member

Joined: 11/21/2014(UTC)
Posts: 66

I realize that, sorry I didn't provide more information.

What do I need to do in the BVC API to facilitate this?

These are the steps from PayPal to verify a payment using their mobile SDK:
Your app makes a successful payment with a PayPal Mobile SDK.
Your app sends data about the payment to your server
Your server can store the payment id value in a database.
From your server, you use the payment id value to look up the payment details with the REST API.
You verify the payment details, as described below.


Once I've verified the payment on the server. How do I proceed with BVC?

Thanks!
Aaron
#4 Posted : Monday, January 12, 2015 5:57:54 PM(UTC)
Aaron

Rank: Administration

Joined: 4/2/2004(UTC)
Posts: 2,381
United States
Location: Hummelstown, PA

Thanks: 6 times
Was thanked: 163 time(s) in 158 post(s)
Store the accepted token in the ThirdPartyOrderId property of the Order object. This is used to authorize and capture the funds later. We also store the PayerID value in a CustomProperty in the Order object (devId = "bvsoftware", key = "PayerID").

Next you'll need to add the PayPal payment (OrderPayment object) to the order. Below is a snippet of code showing what the OrderPayment object should look like:

Code:
Orders.OrderPayment p = new Orders.OrderPayment();
p.OrderID = o.Bvin;
p.AuditDate = DateTime.Now;
p.PaymentMethodName = "Paypal Express";
p.PaymentMethodId = "33eeba60-e5b7-4864-9b57-3f8d614f8301";

// you'll also need to add the PayerID as a CustomProperty to this object as well

Once this data is all stored you can run the "Process New Order" workflow as discussed previously.

Edited by user Monday, January 12, 2015 5:58:30 PM(UTC)  | Reason: Not specified

Aaron Sherrick
BV Commerce
Toll-free 888-665-8637 - Int'l +1 717-220-0012
tappedtech
#5 Posted : Tuesday, January 13, 2015 5:02:44 PM(UTC)
tappedtech

Rank: Member

Joined: 11/21/2014(UTC)
Posts: 66

This is the data provided by the mobile SDK:
{
client = {
environment = mock;
"paypal_sdk_version" = "2.8.1";
platform = iOS;
"product_name" = "PayPal iOS SDK";
};
response = {
"create_time" = "2015-01-13T21:49:54Z";
id = "PAY-NONETWORKPAYIDEXAMPLE123";
intent = sale;
state = approved;
};
"response_type" = payment;
}


Is the "id" the token that gets stored in ThirdPartOrderId?

Can the payment be processed by BVC with just this information? Or do I need to poll PayPal's REST service for more payment information?

What is the PayerID?
Aaron
#6 Posted : Wednesday, January 14, 2015 2:30:15 PM(UTC)
Aaron

Rank: Administration

Joined: 4/2/2004(UTC)
Posts: 2,381
United States
Location: Hummelstown, PA

Thanks: 6 times
Was thanked: 163 time(s) in 158 post(s)
Originally Posted by: tappedtech Go to Quoted Post
Is the "id" the token that gets stored in ThirdPartOrderId?

It's a little difficult to tell because they're not using a 'real' value in their code sample, but my guess is yes.

Originally Posted by: tappedtech Go to Quoted Post
Can the payment be processed by BVC with just this information?

Yes, provided that you also get the PayerID as noted below.

Originally Posted by: tappedtech Go to Quoted Post
What is the PayerID?

PayPal should give you the PayerID after the customer has come back to your application from PayPal.
Aaron Sherrick
BV Commerce
Toll-free 888-665-8637 - Int'l +1 717-220-0012
tappedtech
#7 Posted : Wednesday, January 14, 2015 4:22:58 PM(UTC)
tappedtech

Rank: Member

Joined: 11/21/2014(UTC)
Posts: 66

Originally Posted by: Aaron Go to Quoted Post
PayPal should give you the PayerID after the customer has come back to your application from PayPal.


Do you know if the PayerID is the username or is it some other identifier?

The JSON information I posted earlier is all I get back from the mobile SDK. I'll try and see if their REST service provides more details.

Aaron
#8 Posted : Friday, January 16, 2015 10:26:37 AM(UTC)
Aaron

Rank: Administration

Joined: 4/2/2004(UTC)
Posts: 2,381
United States
Location: Hummelstown, PA

Thanks: 6 times
Was thanked: 163 time(s) in 158 post(s)
Originally Posted by: tappedtech Go to Quoted Post
Originally Posted by: Aaron Go to Quoted Post
PayPal should give you the PayerID after the customer has come back to your application from PayPal.


Do you know if the PayerID is the username or is it some other identifier?

No, the PayerID isn't the username (or at least it's not the user name in plain text). Looking at a few examples they are pretty much all capital letters (approximately 13 characters long) and some have a number mixed in.
Aaron Sherrick
BV Commerce
Toll-free 888-665-8637 - Int'l +1 717-220-0012
Aaron
#9 Posted : Friday, January 16, 2015 10:28:57 AM(UTC)
Aaron

Rank: Administration

Joined: 4/2/2004(UTC)
Posts: 2,381
United States
Location: Hummelstown, PA

Thanks: 6 times
Was thanked: 163 time(s) in 158 post(s)
It looks like you can find some additional information about the PayerID at the links below:

https://developer.paypal...b/accept-paypal-payment/
https://developer.paypal...gleItemPayment-curl-etc/
Aaron Sherrick
BV Commerce
Toll-free 888-665-8637 - Int'l +1 717-220-0012
tappedtech
#10 Posted : Sunday, January 25, 2015 4:02:07 PM(UTC)
tappedtech

Rank: Member

Joined: 11/21/2014(UTC)
Posts: 66

I was able to get the payerId by querying PayPal's REST API.

Could you please confirm this is how I should be adding the custom property and adding the payment to the order:

ws.Orders_Order_CustomPropertySet(ref token, order, "bvsoftware", "PayerID", payerId);

order = ws.Orders_Order_FindByBvin(ref token, orderBvin.ToString());

WebServices3.OrderPayment payment = new WebServices3.OrderPayment();
payment.OrderID = order.Bvin;
payment.ThirdPartyOrderId = paymentToken;
payment.PaymentMethodId = "33eeba60-e5b7-4864-9b57-3f8d614f8301";
payment.PaymentMethodName = "Paypal Express";

ws.Orders_Order_AddPayment(ref token, order, payment);
Aaron
#11 Posted : Monday, January 26, 2015 8:11:51 AM(UTC)
Aaron

Rank: Administration

Joined: 4/2/2004(UTC)
Posts: 2,381
United States
Location: Hummelstown, PA

Thanks: 6 times
Was thanked: 163 time(s) in 158 post(s)
Originally Posted by: tappedtech Go to Quoted Post
I was able to get the payerId by querying PayPal's REST API.

Great!

Originally Posted by: tappedtech Go to Quoted Post
Could you please confirm this is how I should be adding the custom property and adding the payment to the order:

ws.Orders_Order_CustomPropertySet(ref token, order, "bvsoftware", "PayerID", payerId);

There's a bug in the CustomProperty web service insert/update calls that prevent this from working properly. You will need to manually set the CustomProperty array of the object that you're working with (the Order object, in this case) and then update that.
Aaron Sherrick
BV Commerce
Toll-free 888-665-8637 - Int'l +1 717-220-0012
tappedtech
#12 Posted : Monday, January 26, 2015 5:02:52 PM(UTC)
tappedtech

Rank: Member

Joined: 11/21/2014(UTC)
Posts: 66

Thanks. I'll update the order's custom property manually.
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

©2024 Develisys. All rights reserved.
  • Toll-free  888-665-8637
  • International  +1 717-220-0012