apeisa

Payment base class + PaymentStripe + PaymentPaypal

Recommended Posts

Sonia, any hope to get access to the site and server so I could take a look at it? You can pm me credentials.

Share this post


Link to post
Share on other sites
10 hours ago, godmok said:

Hi apeisa, will there be a compatibility for PW 3.0? Or is there a way to force it to run?

For what it's worth, I'm running it with 2.8.x no problem. Aren't 3.0 and 2.8.x essentially the same apart from the namespaces stuff? Does namespaces affect the module?

  • Like 1

Share this post


Link to post
Share on other sites

For what it's worth, I'm successfully running the base payment class and the Stripe class on a 3.0.33 installation. Not tried the Paypal module.

  • Like 2

Share this post


Link to post
Share on other sites

Hi, sorry for late feedback.

You are both right. It is running now and set to the sandbox.

I still got this error on PaymentModule when I look into the module settings: "Method PaymentGatewayPayPal::getTitle does not exist or is not callable in this context". It seems to be alright on the frontend.

On the frontend i get an error where I finish the transaction and get to the success site, but there i get this:

Quote

Error: Exception: Couldn't get access into (in D:\WT-NMP\WWW\tp\site\assets\cache\FileCompiler\site\modules\PaymentPaypal\PaymentPaypal.module line 68)

#0 D:\WT-NMP\WWW\tp\site\templates\views\register_form_view.php(45): PaymentPaypal->processPayment()
...

I get from PayPal an post input with a lot of data from the payment process, but after the payment forwarded to the process/success page it always gives me this error.

Share this post


Link to post
Share on other sites

I've been trying to get this to work on a fresh install of PW 3.0.36 and the PW3 versions of Payment base + PaymentStripe

When trying your example scritp, it throws an error on line 28 of the paymentStripe.module 

Stripe::setApiKey($this->secretKey);

Error: Class 'Stripe' not found (line 28 of /...blah..../modules/PaymentStripe/PaymentStripe.module) 

I tried the older versions of the modules but hit the same problem. 

Kind regards

 

Share this post


Link to post
Share on other sites

Yes I did Apeisa. And then tried with the master branch and got the same trouble (after replacing the Stripe Lib files). 

I've just tried again with the latest PW3 and PaymentModule-PW3 and PaymentStripe-PW3.  I've selected Stripe as the active payment module in the base module and also tried selecting both Stripe and Payment module. This was using Wamp and PHP 5.4.4. I tried on a live server with PHP 5.6 and got the same result. By the way - I am using the '?step=process' in the URL.

Error: Class 'ProcessWire\Stripe' not found (line 28 of /..blah../site/modules/PaymentStripe-PW3/PaymentStripe.module) 

Kind Regards

Nik

Share this post


Link to post
Share on other sites

NikNak, I think there was namespace problems, can you try updating to latest commit from pw3 branch?

Share this post


Link to post
Share on other sites

Hi again,

I'm now getting an error about needing to upgrade to TLS 1.2  - on both my MAMP and on my live server - but this is a Stripe security thing for me to look into.

Thanks for the help 

Kind r

Nik

Share this post


Link to post
Share on other sites

Hi @apeisa

Looking at using the payments module with Stripe, and have both PaymentsModule and PaymentsStripe installed with config. Seem to be getting a error using your example code, no such embed? Method PaymentStripe::embed does not exist or is not callable in this context

using the code here but adding a product unit (as it was erroring without): http://modules.processwire.com/modules/payment-stripe/

Share this post


Link to post
Share on other sites

Worked it out. payment->embed() should have been payment->render(); Would be ace to add some docs with your payment modules if possible. Happy to contribute if I get my head around it...

  • Like 2

Share this post


Link to post
Share on other sites

PaypalPayments - having problem on Process step not validating. There was an error, which went away after chaning the settings to use Curl, but now it always returns "Payment canceled or something went wrong" after sucessful retunr from paypal.

I orginally had different pages for each checkout item, but now doing the whole checkout process on one url.

@apeisa Happen to know what might be happening here at all?

Thanks!

Share this post


Link to post
Share on other sites

OK soooooooo, may have fixed it. Doing everything over Ajax and somehow it was working originally using the basic implemtation in the docs. However I finally got to the bottom of it and it wasn't keeping take of the price after returning from Stripe to finalise.

So I added a flip flop variable for the price so if it's not there it grabs it from the session.

$amount = $itemPage->price;

// save price for later
if($amount == 0){
	$amount = $session->get('price');
}else{
	$session->set('price',$amount);
}
$payment->addProduct($title, $amount, 1);

 

Share this post


Link to post
Share on other sites

With regards to paymentstripe specifically...

Does anybody know if this still works?

If it does can anybody provide help more than the example provided? Like how would I tie this into a payment form? Is that even what this does?

I am in the process of trying (and failing miserably) to set this up with stripe elements in a cusom form. I am using the processwire form API to create the form but it is not submitting...sometimes without errors and sometimes with errors.

If someone could just give an example of how to use this with a form that would be incredibly helpful.

Share this post


Link to post
Share on other sites

Hi @cleanboy

I think i'm right in saying that the payment modules are wrappers for the Stripe and Paypal libraries, therefore you can access the Stripe methods in Processwire.

That said, I think you were asking how to use it, the example shows how you can pass amounts and basic customer information to Stripe, if a successful request is made Stripe pass you back a payment button which enables the customer to click and add their card details. The module does not store any information on the purchase, what was purchased, who by or anything infact, its just a way of interacting with Stripe or Paypal.

If you need to track payments or are selling physical items you will need someway of keeping track of transactions and items like a store e.g. padloper or create your own tracking (which I've done several times mainly because I've been selling digital goods like subscriptions so have little need for item tracking or postage variables).

Hope that helps.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.