Giter VIP home page Giter VIP logo

paysafe_sdk_php's Introduction

Paysafe PHP SDK


Installation

Windows

On Windows, you will be required set the following environment variable that points to a valid CA certificate on your system in order to perform the https operations:

SSL_CERT_FILE

Alternatively, you can make a call in your code to the following static method using the path to your CA certificate:

\Paysafe\PaysafeApiClient::setCACertPath(_PATH_TO_CERTIFICATE_);

This SDK requires PHP >= 5.3 and cURL to be installed.

This SDK requires that you can complete an SSL connection using cURL to the API endpoints from within your hosting environment . Any cURL errors returned will require you to complete connectivity troubleshooting within your hosting environment. See cURL error codes for assistance: http://curl.haxx.se/libcurl/c/libcurl-errors.html

Usage

Running Sample Code

Update the following file with your credentials and account number:

/sample/config.php

PHP 5.3

Create a new virtual host in your local web server with the sample directory within your SDK directory as the webroot. Open your web browser and navigate to the URL specified in the virtual host configuration.

PHP 5.4+

In your command-line interface, navigate to the /sample directory inside of the SDK directory and type the following command:

php -S localhost:8081

Open your web browser and navigate to the following URL:

http://localhost:8081

paysafe_sdk_php's People

Contributors

asawarivaidya avatar francoisneron avatar jbpaylease avatar kumarvipin avatar lampelk avatar opussdksupport avatar payleasebrian avatar smartbrother avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

paysafe_sdk_php's Issues

DirectDebitService::submit and DirectDebitService::standaloneCredits do not gracefully handle bad data

DirectDebitService::submit does not gracefully handle bad data. If the submitted Purchase object has none of ach, eft, bacs, or sepa set, the function will cause a PHP error: Undefined variable: return

Additionally, DirectDebitService::standaloneCredits suffers from the same logic flaw. If the submitted StandaloneCredits object has none of ach, eft, or bacs set, the function will cause a PHP error:
Undefined variable: return

It would likely be more appropriate to throw an exception in these cases. Or, at least have some meaningful return.

CardPayments\Filter does not properly extend JSONObject

\Paysafe\CardPayments\Filter does not properly extend JSONObject. The class def looks like:

class Filter extends JSONObject

However, the Filter class is in the CardPayments sub-namespace, while JSONObject is in the root Paysafe namespace.

Based on the definition of DirectDebit\Filter, I believe the class def should be:

class Filter extends \Paysafe\JSONObject

can't authorize a payment with cents

`$auth = new Authorization(array(
'merchantRefNum' => "0f8fad5bd9cb469fa16570867728950e",
'amount' => 555,
'settleWithAuth' => true,
'card' => array(
'cardNum' => "4111111111111111",
'cvv' => '123',
'cardExpiry' => array(
'month' => "06",
'year' => "2020",
)
),
'billingDetails' => array(
'zip' => "M5H 2N2"
)
));

$response = $client->cardPaymentService()->authorize($auth);`

if the amount is 555.50 it fails saying it needs to be a Int

Customer vault example in documentation does not work

Example for creating a customer profile using a single-use token via the PHP SDK outlined at the following page does not function:
https://developer.paysafe.com/en/sdks/server-side/php/customer-vault/

Code outlined is as follows:

$profile = new Profile(array(
	"merchantCustomerId" => $merchantCustomerId,
	"locale" => "en_US",
	"firstName" => "John",
	"lastName" => "Smith",
	"email" => "[email protected]",
	"phone" => "713-444-5555",
	"card" => array(
		'singleUseToken' => "SCrGrrRANmOVtcVc"
	)
));
$response = $client->customerVaultService()->createProfile($profile);

However, the customer vault profile object ignores the 'card' property, so it is never stored and encoded in the request to create a vault profile. Example should not outline this process, or the 'card' property should be added to the field types in source/paysafe/customervault/profile.php and the optional fields set in source/paysafe/customervaultservice.php

Found issue with auto-loading

I fixed with below steps:

  1. lib/vendor/paysafegroup/paysafe_sdk_php/source/paysafe.php:

function __PaysafeAutoloader($className)
{
$classPath = str_replace("\", DIRECTORY_SEPARATOR, $className);

if (($classFile = realpath(__DIR__ . DIRECTORY_SEPARATOR . $classPath . '.php'))) {
    require_once( $classFile );
}

}

Removed use of strtolower function with first line of function.

  1. Renamed directory from "lib/vendor/paysafegroup/paysafe_sdk_php/source/paysafe" to "lib/vendor/paysafegroup/paysafe_sdk_php/source/Paysafe"

Please check - my side that is working now.

Thanks.

Issue with "profile" fields not being sent when doing authentication

Hello,
Found an issue with the following request:

$auth = $client->cardPaymentService()->authorize(new Authorization(array(
            'merchantRefNum' => uniqid(date('Ymd-')),
            'customerNotificationEmail' => $email,
            'amount' => $amount * $currencyBaseUnitsMultiplier,
            'settleWithAuth' => true,
            'card' => array(
                'cardNum' => $ccn,
                'cvv' => $cvv,
                'cardExpiry' => array(
                    'month' => $exp1,
                    'year' => $exp2
                )
            ),
            'profile' => array(
                'email' => $email,
                'firstName' => $firstName,
                'lastName' => $lastName
            ),
            'billingDetails' => array(
                'zip' => $postal_code
		    ),
		    'customerIp' => $_SERVER['REMOTE_ADDR']
        )));

All "profile" fields were not passed to PaySafe (first name, last name and email).
Had to edit the file "/Paysafe/CardPaymentService.php" and add 'profile' into a list of "setOptionalFields" on line 77.

storedcredential missing from card payment service

As per the API documentation, there is an additional field 'storedcredential' that is required for recurring transactions:
https://developer.paysafe.com/en/cards/api/#/introduction/complex-json-objects/storedcredential

This is not part of the optional fields for the card payment service authorise method:
https://github.com/paysafegroup/paysafe_sdk_php/blob/master/source/Paysafe/CardPaymentService.php#L77

Please add 'storedcredentials' to the optional fields list.

Look up for profile with DD accounts as wrong types

https://github.com/paysafegroup/paysafe_sdk_php/blob/master/source/paysafe/customervault/profile.php#L80

Currently

 'achBankAccounts' => '\Paysafe\CustomerVault\ACHBankaccounts',
 'bacsBankAccounts' => '\Paysafe\CustomerVault\BACSBankaccounts',
 'eftBankAccounts' => '\Paysafe\CustomerVault\EFTBankaccounts',
 'sepaBankAccounts' => '\Paysafe\CustomerVault\SEPABankaccounts'

Should be

 'achBankAccounts' => 'array:\Paysafe\CustomerVault\ACHBankaccounts',
 'bacsBankAccounts' => 'array:\Paysafe\CustomerVault\BACSBankaccounts',
 'eftBankAccounts' => 'array:\Paysafe\CustomerVault\EFTBankaccounts',
 'sepaBankAccounts' => 'array:\Paysafe\CustomerVault\SEPABankaccounts'

Class Not Found

/card-payment-simple.php - Class 'Paysafe\PaysafeApiClient' not found in /home/seb/Downloads/paysafe/sample/card-payment-simple.php on line 9

Is it normal ? I am on Ubuntu 14.04

Class `Paysafe\ThreeDSecureService` not found

Hi,

In PaysafeApiClient the method threeDSecureService() returns ThreeDSecureService. I'm getting a fatal error saying class Paysafe\ThreeDSecureService cannot be found. Simple fix was to just change ThreeDSecureService to ThreeDsecureService (lowercase 's' in secure).

Thanks,

Anthony

cardpayments/dateofbirth.php appears to have an incorrect class definition

File cardpayments/dateofbirth.php defines a class VisaAdditionalAuthData, which is of course also defined in file cardpayments/visaadditionalauthdata.php.

Should the class defined in dateofbirth.php instead be named DateOfBirth, as the naming scheme for the rest of the classes/filenames would suggest?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.