Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

E-Commerce Modules /

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, Ed, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba

SwipeStripe Paypal Authentication


Go to End


5 Posts   1464 Views

Avatar
Sajan

Community Member, 13 Posts

22 December 2015 at 6:09pm

Edited: 22/12/2015 6:11pm

Hey guys,

I have been setting up a SwipeStripe store and am trying to integrate the Paypal Express Checkout using the frankmullenger/silverstripe-payment-paypal.

I have followed the module installation instructions as indicated on github, however, when i go through the checkout process and click "Proceed to Pay", I am being thrown an error by the website which is stating:

[Notice] Undefined index: authentication
Line 33 in ..../payment-paypal/code/PayPalGateway.php

Which corresponds to the following line in the callAPI function;
$authentication = $config['authentication'];

It seems there is an error in retrieving the configuration of the API Details

How can i fix this error?

Avatar
helenclarko

Community Member, 166 Posts

23 December 2015 at 8:31am

Hi Sajan,

What does your YAML file look like?
Please dont post all your passwords though.

-helenclarko

Avatar
Sajan

Community Member, 13 Posts

23 December 2015 at 10:15am

Hi Helenclarko,

I have a file located in mysite/_config/payment.yaml.

The contents of the file look as follows:

---
Name: payment
After:
  - 'framework/*','cms/*'
---
PaymentGateway:
  environment:
    'dev'
PaymentProcessor:
  supported_methods:
    dev:
      - 'PayPalExpress'
    live:
      - 'PayPalExpress'
  PayPalGateway_Express: 
  live:
    authentication:
      username: 'username@mydomain.com'
      password: 'mypassword'
      signature: 'mysignature'
  dev:
    authentication:
      username: 'username@mydomain.com'
      password: 'mypassword'
      signature: 'mysignature'

Avatar
helenclarko

Community Member, 166 Posts

23 December 2015 at 11:06am

Hi Sajan,

With YAML the spacing is really important.

I could be wrong about the YAML below, but it may make all the difference.

---
Name: payment
After:
  - 'framework/*','cms/*'
---
PaymentGateway:
  environment:
    'dev'
PaymentProcessor:
  supported_methods:
    dev:
      - 'PayPalExpress'
    live:
      - 'PayPalExpress'
PayPalGateway_Express: 
  live:
    authentication:
      username: 'username@mydomain.com'
      password: 'mypassword'
      signature: 'mysignature'
  dev:
    authentication:
      username: 'username@mydomain.com'
      password: 'mypassword'
      signature: 'mysignature'

"PayPalGateway_Express:" just needs to not be indented. Give it a go, hopefully thats all it is.

-helenclarko

Avatar
Sajan

Community Member, 13 Posts

23 December 2015 at 11:36am

Wow....what a noob error i just made hahaha

That worked like magic! Thanks so much :)