Page 1 of 1

Connect with a payment provider through REST API

Posted: Sun Jul 26, 2015 9:02 am
by Timon
Hello all

I do have a question regarding connecting the demo app with a test environment of a payment provider via REST API.
I read my way through the documentation here: http://www.broadleafcommerce.com/docs/core/current/broadleaf-concepts/payment

So I would need to prepare and process JSON and send it and receive it via RESTful WS.

Is this feasible with the current provided classes?

Thank you for a brief answer.

With many thanks
Timon

Re: Connect with a payment provider through REST API

Posted: Mon Jul 27, 2015 5:02 am
by phillipuniverse
It depends on how you are planning on dealing with payment. I believe in the scenario that you described, whatever is going to invoke Broadleaf will need to take the payment information, you'll send that to Broadleaf via the REST API and then store it as OrderPayment and PaymentTransactions.

Re: Connect with a payment provider through REST API

Posted: Tue Jul 28, 2015 1:23 am
by Timon
Hello

Thank you very much for your reply.
As I just begun to get familiar with the broadleaf framework ...
Is the guidance as described here
http://www.broadleafcommerce.com/docs/core/current/broadleaf-concepts/payment/creating-a-payment-gateway-module adequate for this approach?
Or is some additional magic needed to make it work?
(I am still climbing up the learning curve so your support is highly appreciated ;))

Re: Connect with a payment provider through REST API

Posted: Tue Jul 28, 2015 9:43 am
by phillipuniverse
No, I believe what you are describing is actually taking the payment details (CC # etc) via some other system and then sending the results to Broadleaf. If that is the case, then in the REST API you need to populate an OrderPayment and an AUTHORIZE or AUTHORIZE_AND_CAPTURE PaymentTransaction for that payment.

Re: Connect with a payment provider through REST API

Posted: Tue Jul 28, 2015 12:20 pm
by Timon
Hello Phillip

Thank you for your answer.

And you are right that the CC information will be entered via an external page which will be integrated within the application as an iFrame.
I attached the sequence diagram of how it is meant to work (only that the cc holder will not enter the CC information via the shops web page)
As I am not even on Padawan level regarding the payment workflow outside what is described in the guidance...
I am kind of Lost ...
Where do I have to "hook" into the workflow process to create the OrderPayment and PaymentTransaction?
And how could I integrate the iFrame?
I so would appreciate some hints and help how to implement this ...

Screen Shot 2015-07-28 at 18.54.00.png
Screen Shot 2015-07-28 at 18.54.00.png (332.17 KiB) Viewed 9312 times


With many thanks
Timon

Re: Connect with a payment provider through REST API

Posted: Sat Aug 01, 2015 5:05 am
by Timon
Hello

Anybody an idea or experience how to "hook" into the payment workflow to achieve this requirement?

With many thanks
Timon

Re: Connect with a payment provider through REST API

Posted: Mon Aug 03, 2015 5:25 pm
by phillipuniverse
In the REST API, you need to populate an OrderPayment and an OrderPaymentTransaction representing the details that you got back from the Saferpay API.

Re: Connect with a payment provider through REST API

Posted: Tue Aug 04, 2015 8:44 am
by Timon
Hello Phillip

Thank you for your answer.

I found the OrderPayment interface and Impl.
But where to find the OrderPaymentTransaction class?

With many thanks
Timon

Re: Connect with a payment provider through REST API

Posted: Tue Aug 04, 2015 12:01 pm
by phillipuniverse
Sorry, misspoke. The class is PaymentTransaction and OrderPayment has a List of them.

Qualitatively, the OrderPayment is like "I want to pay $15 by credit card" and then the List<PaymentTransaction> are individual gateway transactions against that payment. For instance, the original charge of the user card has a PaymentTransactionType of either AUTHORIZE or AUTHORIZE_AND_CAPTURE.

Since you're taking the payment elsewhere and then just telling Broadleaf what you did, you would create an the OrderPayment and the PaymentTransaction for that payment all in 1 shot and then invoke the checkout workflow to check out.

Re: Connect with a payment provider through REST API

Posted: Sun Aug 09, 2015 5:32 am
by Timon
Hello Phillip

Thank you for your detailed reply.
Getting there now ... cheers again!