Giter Club home page Giter Club logo

paypayopa-sdk-php's People

Contributors

ashraf-km avatar chao-chang-paypay avatar codacy-badger avatar curtisfennerpaypay avatar dependabot-preview[bot] avatar dependabot[bot] avatar fossabot avatar javidlulu avatar mike-traff-paypay avatar navin-math avatar paypay-ayas avatar sanmai avatar sunaoka avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

paypayopa-sdk-php's Issues

Unauthorized request when checkWalletBalance function is called

Describe the bug
createAccountLinkQrCode and createPayment functions are ok but when I call CreatePayment method, scripts is fail.

To Reproduce
Steps to reproduce the behavior:

$paypayConfig = \Config::get('paypay');
$client = new Client([
    'API_KEY' => $paypayConfig['key'],
    'API_SECRET' => $paypayConfig['secret'],
    'MERCHANT_ID' => $paypayConfig['mid'],
], false);
$resp = $client->wallet->checkWalletBalance("MY_USER_AUTHORIZATION_ID", 1, 'JPY');
return response()->json($resp);

Result

PayPay\OpenPaymentAPI\Controller\ClientControllerException: Unauthorized request in file D:\SSC\test\payment-server\vendor\paypayopa\php-sdk\src\core\Controller.php on line 171

If the HTTP status code of the Check Cashback Details response is 200, I don't want to raise an exception.

Describe the bug
If the HTTP status code of the Check Cashback Details response is 200, I don't want to raise an exception.

throw new ClientControllerException(

For example, if NOT_ENOUGH_MONEY is raised, I want to get the cashbackId included in the response body.

https://www.paypay.ne.jp/opa/doc/jp/v1.0/cashback#section/%E3%83%AC%E3%82%B9%E3%83%9D%E3%83%B3%E3%82%B9%E3%82%B3%E3%83%BC%E3%83%89%E4%B8%80%E8%A6%A7
image

How about this as a suggested modification to the source code?

$ git diff
diff --git a/src/core/Controller.php b/src/core/Controller.php
index 8a77021..b68b4cf 100644
--- a/src/core/Controller.php
+++ b/src/core/Controller.php
@@ -167,7 +167,8 @@ class Controller
      */
     protected function parseResultInfo($apiInfo, $resultInfo, $statusCode)
     {
-        if (strcmp($resultInfo['code'], "SUCCESS") !== 0 && strcmp($resultInfo['code'], "REQUEST_ACCEPTED")) {
+        $acceptStatusCodeList = [200, 202];
+        if (in_array($statusCode, $acceptCodeList, true) === false) {
             throw new ClientControllerException(
                 $apiInfo,
                 $resultInfo, //PayPay API message

Also, let me ask you one question.
If the response code is NOT_ENOUGH_MONEY, BALANCE_OUT_OF_LIMIT, or INTERNAL_SERVICE_ERROR, will the data.status in the response body be FAILURE?
In what cases does data.status become FAILURE?

https://www.paypay.ne.jp/opa/doc/jp/v1.0/cashback#operation/checkCashback
image

composer.lock is redundant for libraries

This library includes composer.lock which is:

  • Not used when installing any library with Composer. It's just outright ignored.
  • It hinders testing under different versions of dependencies. Say, Travis CI would normally do composer install for you during CI, with composer.lock present you would have to do composer update additionally. Likewise, contributors would have to do that too.
  • It pollutes composer.json update diffs, since they both have to be updated.

There's no point to keep it committed in a library, on the contrary with a deployable project, which this project is not.

Here's what the documentation says:

However, this lock file will not have any effect on other projects that depend on it. It only has an effect on the main project.

Call to undefined method PayPay\OpenPaymentAPI\Models\CapturePaymentAuthPayload::setCodeType()

Describe the bug
When execute capture payment, there is showing "Call to undefined method PayPay\OpenPaymentAPI\Models\CapturePaymentAuthPayload::setCodeType()". In the package Models\CapturePaymentAuthPayload method, there is no exist the method but if remove the line $CAPayload->setCodeType("ORDER_QR"); from the code, there is showing another error "PayPay\OpenPaymentAPI\Controller\ClientControllerException
Order not found | [OPABD667B96120A4632BA10A42B212C4C2E]".

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://developer.paypay.ne.jp/products/docs/webpayment#capture-payment
  2. Execute Capture Payment
  3. See error
    Call to undefined method PayPay\OpenPaymentAPI\Models\CapturePaymentAuthPayload::setCodeType()
  4. Since method is not exist the package for Models\CapturePaymentAuthPayload so remove the line $CAPayload->setCodeType("ORDER_QR");
  5. There is showing another error
    PayPay\OpenPaymentAPI\Controller\ClientControllerException
    Order not found | [OPABD667B96120A4632BA10A42B212C4C2E]".

Would you please resolve it.

Magento 2 module

Hello!

We're evaluating PayPay and want to integrate it into Magento 2 and we are wondering if you might know about any module which was already developed or some third-party integration that supports PayPay and Magento 2?

Thank you very much for any help!

Best, Björn

Auth URL issues

URLs generated $client->payment->getUserAuthUrl($payload) give certification error when opened.

Optimized autoload of classes fails in composer version 2

Describe the bug

Optimized autoload of classes fails in composer version 2

To Reproduce

$ composer --version
Composer version 2.0.8 2020-12-03 17:20:38

$ composer dump-autoload --optimize
Generating optimized autoload files
Class PayPay\OpenPaymentAPI\Controller\ClientControllerException located in ./vendor/paypayopa/php-sdk/src/core/Controller.php does not comply with psr-4 autoloading standard. Skipping.
Class PayPay\OpenPaymentAPI\Controller\Controller located in ./vendor/paypayopa/php-sdk/src/core/Controller.php does not comply with psr-4 autoloading standard. Skipping.
Class PayPay\OpenPaymentAPI\Models\ModelException located in ./vendor/paypayopa/php-sdk/src/core/Model.php does not comply with psr-4 autoloading standard. Skipping.
Class PayPay\OpenPaymentAPI\Models\Model located in ./vendor/paypayopa/php-sdk/src/core/Model.php does not comply with psr-4 autoloading standard. Skipping.
Class PayPay\OpenPaymentAPI\Controller\Code located in ./vendor/paypayopa/php-sdk/src/Controllers/Code.php does not comply with psr-4 autoloading standard. Skipping.
Class PayPay\OpenPaymentAPI\Controller\Refund located in ./vendor/paypayopa/php-sdk/src/Controllers/Refund.php does not comply with psr-4 autoloading standard. Skipping.
Class PayPay\OpenPaymentAPI\Controller\Wallet located in ./vendor/paypayopa/php-sdk/src/Controllers/Wallet.php does not comply with psr-4 autoloading standard. Skipping.
Class PayPay\OpenPaymentAPI\Controller\User located in ./vendor/paypayopa/php-sdk/src/Controllers/User.php does not comply with psr-4 autoloading standard. Skipping.
Class PayPay\OpenPaymentAPI\Controller\Payment located in ./vendor/paypayopa/php-sdk/src/Controllers/Payment.php does not comply with psr-4 autoloading standard. Skipping.

Additional context

This is because there are multiple classes defined in a single file.

Is `atoum/atoum` in use?

Describe the bug

atoum/atoum is specified as a dependent package in composer.json.

However, I don't think atoum/atoum is used.

Can you please remove it if it is not used?
(I can PR it.)

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.