Coder Social home page Coder Social logo

paymaya-php-sdk's Issues

2 undefined properties

 ------ ----------------------------------------------------------------
  Line   PayMaya/API/Checkout.php
 ------ ----------------------------------------------------------------
  37     Access to an undefined property PayMaya\API\Checkout::$id.
  45     Access to an undefined property PayMaya\API\Checkout::$id.
  48     Access to an undefined property PayMaya\API\Checkout::$status.
 ------ ----------------------------------------------------------------

Discovered by @phpstan

Cant install: Installation request for psr/log (locked at 1.1.2) -> satisfiable by psr/log[1.1.2]

I get this message when trying to install the SDK via composer. I am using Laravel Framework for this

 D:\Files and Projects\Projects\SakuraSmartWeb>composer require "paymaya/paymaya-sdk:*"./composer.json has been updated
  Loading composer repositories with package information
  Updating dependencies (including require-dev)
  Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for psr/log (locked at 1.1.2) -> satisfiable by psr/log[1.1.2].
    - paymaya/paymaya-sdk 0.0.2 requires psr/log 1.0.2 -> satisfiable by psr/log[1.0.2].
    - paymaya/paymaya-sdk dev-curl-error-patch requires psr/log 1.0.2 -> satisfiable by psr/log[1.0.2].
     - paymaya/paymaya-sdk dev-dev-master requires psr/log 1.0.2 -> satisfiable by psr/log[1.0.2].
     - paymaya/paymaya-sdk dev-master requires psr/log 1.0.2 -> satisfiable by psr/log[1.0.2].
     - Conclusion: don't install psr/log 1.0.2
     - paymaya/paymaya-sdk 0.0.1 requires psr/log 1.0.0 -> satisfiable by psr/log[1.0.0].
     - paymaya/paymaya-sdk dev-dev requires psr/log 1.0.0 -> satisfiable by psr/log[1.0.0].
     - Conclusion: don't install psr/log 1.0.0
     - Installation request for paymaya/paymaya-sdk * -> satisfiable by paymaya/paymaya-sdk[0.0.1, 0.0.2, dev-curl-error-patch, dev-dev, dev-dev-master, dev-master].

Installation failed, reverting ./composer.json to its original content.

Undefined index: ID in Register WEBHOOK

$successWebhook = new Webhook();
$successWebhook->id = $itemCheckout->id;
$successWebhook->name = Webhook::CHECKOUT_SUCCESS;
$successWebhook->callbackUrl = "http://localhost:8000/paymaya/success";
$successWebhook->register();

i was getting this error, I'm using Symfony Framework 3.3

Undefined index: ID

even though I already set the ID returned by PayMaya Checkout.

Undefined index during checkout

Am I missing something?

image

Here is my code:

`<?php

require __DIR__ . '/vendor/autoload.php';

use PayMaya\PayMayaSDK;
use PayMaya\API\Checkout;
use PayMaya\Model\Checkout\Item;
use PayMaya\Model\Checkout\ItemAmount;
use PayMaya\Model\Checkout\ItemAmountDetails;

use PayMaya\Model\Checkout\Buyer;
use PayMaya\Model\Checkout\Address;
use PayMaya\Model\Checkout\Contact;

class PaymayaClass{
    private $publicApiKey;
    private $secretApiKey;
    private $environment;

    function __construct($config){
        $this->publicApiKey = $config['publicApiKey'];
        $this->secretApiKey = $config['secretApiKey'];
        $this->environment = $config['environment'];
    }

    function checkout($paymentArray){

        PayMayaSDK::getInstance()->initCheckout($this->publicApiKey, $this->secretApiKey, $this->environment);

        $itemCheckout = new Checkout();

        $itemAmountDetails = new ItemAmountDetails();
        $itemAmountDetails->shippingFee = $paymentArray['shippingFee'];
        $itemAmountDetails->tax = $paymentArray['tax'];
        $itemAmountDetails->subtotal = $paymentArray['subTotal'];

        $itemAmount = new ItemAmount();
        $itemAmount->currency = $paymentArray['currency'];
        $itemAmount->value = $paymentArray['totalAmount'];
        $itemAmount->details=$itemAmountDetails;
        $item = new Item();
        $item->name=$paymentArray['itemName'];
        $item->code=$paymentArray['itemCode'];
        $item->description=$paymentArray['itemDescription'];
        $item->quantity=$paymentArray['quantity'];
        $item->amount=$itemAmount;
        $item->totalAmount = $itemAmount;

        $itemCheckout->items = array($item);
        $itemCheckout->totalAmount = $itemAmount;
        $itemCheckout->requestReferenceNumber='123';
        $itemCheckout->redirectUrl = array(
            'success'=>'https://demo.hamiliserver.com/APIReceiver/',
            'faliure'=>'https://demo.hamiliserver.com/APIReceiver/',
            'cancel'=>'https://demo.hamiliserver.com/APIReceiver/'
        );

        $itemCheckout->execute();

    }

}

?>
`

dependency check psr/log

on command 'compose require composer require "paymaya/paymaya-sdk:*"'

cli error appear: ''Conclusion: don't install psr/log 1.0.2"

Note: this is in Laravel 7

Undefined Index voidStatus, metadata

Good Day Paymaya,

I was testing php sdk in sandbox environment.

I was following your checkout example here:
https://github.com/PayMaya/PayMaya-PHP-SDK/blob/master/sample/Checkout/ItemCheckout.php

When I reach line 45 of your sample code as shown below:
$itemCheckout->retrieve();

I encounter these error:
Undefined index: voidStatus (8)
Undefined index: metadata (8)

The code involved is:
File: lib/PayMaya/API/Checkout.php
Function: retrieve

Upon investigation, the returned json indeed did not have fields voidStatus and metadata.

Below is sample response:
{
"merchant":{
"currency":"PHP",
"name":"Test Merchant for Core 5",
"email":"[email protected]",
"locale":"en",
"homepageUrl":"http://paymaya.com",
"isEmailToMerchantEnabled":true,
"isEmailToBuyerEnabled":true,
"isPaymentFacilitator":false,
"isPageCustomized":true,
"supportedSchemes":[
"Mastercard",
"Visa"
],
"expressCheckout":false,
"canPayPal":false
},
"buyer":{
"firstName":"John",
"middleName":"Michaels",
"lastName":"Doe",
"contact":{
"phone":"+63(2)1234567890",
"email":"[email protected]"
},
"shippingAddress":{
"line1":"9F Robinsons Cybergate 3",
"line2":"Pioneer Street",
"city":"Mandaluyong City",
"state":"Metro Manila",
"zipCode":"12345",
"countryCode":"PH"
},
"billingAddress":{
"line1":"9F Robinsons Cybergate 3",
"line2":"Pioneer Street",
"city":"Mandaluyong City",
"state":"Metro Manila",
"zipCode":"12345",
"countryCode":"PH"
}
},
"items":[
{
"name":"Leather Belt",
"code":"pm_belt",
"description":"Medium-sized belt made from authentic leather",
"quantity":"1",
"amount":{
"value":"69.00",
"details":{
"discount":"0.00",
"serviceCharge":"0.00",
"shippingFee":"14.00",
"tax":"5.00",
"subtotal":"50.00"
}
},
"totalAmount":{
"value":"69.00",
"details":{
"discount":"0.00",
"serviceCharge":"0.00",
"shippingFee":"14.00",
"tax":"5.00",
"subtotal":"50.00"
}
}
}
],
"status":"CREATED",
"id":"ee0e3f70-c200-4812-8c4c-02ababa4fbb3",
"totalAmount":{
"currency":"PHP",
"value":"69.00",
"details":{
"discount":"0.00",
"serviceCharge":"0.00",
"shippingFee":"14.00",
"tax":"5.00",
"subtotal":"50.00"
}
},
"requestReferenceNumber":"123456789",
"transactionReferenceNumber":null,
"receiptNumber":null,
"createdAt":"2017-10-30T13:12:57.612Z",
"updatedAt":"2017-10-30T13:12:57.612Z",
"expiredAt":"2017-10-30T14:12:57.605Z",
"paymentType":"CREDIT_CARD",
"paymentStatus":"PENDING",
"redirectUrl":{
"success":"https://shop.com/success",
"failure":"https://shop.com/failure",
"cancel":"https://shop.com/cancel"
},
"refundedAmount":"0",
"expressCheckout":false,
"canPayPal":false
}

Thank you.

API Key has expired

Using the following api keys it returns a response that the "Key has expired"

Screenshot

Undefined Index paymentType

No paymentType in responses. I assumed it's paymentScheme now.

this is the json response I got.

"merchant" => array:14 [▶]
"buyer" => []
"items" => array:1 [▶]
"status" => "CREATED"
"id" => "ca23efd8-9017-4e35-9af1-7d7ab4846c41"
"totalAmount" => array:3 [▶]
"requestReferenceNumber" => "46fe3f6241ee479153965a056a114dd95"
"transactionReferenceNumber" => null
"receiptNumber" => null
"createdAt" => "2017-11-10T08:57:40.624Z"
"updatedAt" => "2017-11-10T08:57:40.624Z"
"expiredAt" => "2017-11-10T09:57:40.622Z"
"paymentScheme" => "CREDIT_CARD"
"paymentStatus" => "PENDING"
"redirectUrl" => array:3 [▶]
"refundedAmount" => "0"
"expressCheckout" => false
"canPayPal" => false

Payment Failure.

I used your sample Checkout.php.
Tried all the Test Cards for checking out.

image

Same results.
I dont know if this is because im using sandbox or not.

Non-configurable cURL Options in HTTPConfig

The default cURL options in PayMaya\Core\HTTPConfig are fixed and are not very flexible. There are installations of PHP 5.6 and above where libcurl uses NSS instead of OpenSSL as the SSL/TLS provider, which means hard-coding CURLOPT_SSL_CIPHER_LIST to 'TLSv1' will be incompatible to these PHP installations, after setting said options through curl_setopt_array() in PayMaya\Core\HTTPConnection::execute(), as 'TLSv1' is only a valid value if OpenSSL is cURL's back-end. (See https://curl.haxx.se/libcurl/c/CURLOPT_SSL_CIPHER_LIST.html)

In addition, it is best to leave CURLOPT_SSLVERSION alone. See the corresponding entry at https://www.php.net/manual/en/function.curl-setopt.php for a description.

In closing, I highly recommend removing the CURLOPT_SSL_CIPHER_LIST and CURLOPT_SSLVERSION options from PayMaya\Core\HTTPConfig for better compatibility. The API's web server configuration on the other hand will be able to dictate which ciphers to be used on negotiation anyway. See the ssl_protocols, ssl_ciphers, and ssl_prefer_server_ciphers directives for NGINX as examples.

Error API call

Trying to run your sample code and encountered an error.

<br /> <b>Fatal error</b>: Uncaught Exception: Error API call in /storage/ssd4/275/12315275/public_html/paymaya/vendor/paymaya/paymaya-sdk/lib/PayMaya/Core/HTTPConnection.php:50 Stack trace: #0 /storage/ssd4/275/12315275/public_html/paymaya/vendor/paymaya/paymaya-sdk/lib/PayMaya/Core/CheckoutAPIManager.php(57): PayMaya\Core\HTTPConnection-&gt;execute('{&quot;url&quot;:null,&quot;bu...') #1 /storage/ssd4/275/12315275/public_html/paymaya/vendor/paymaya/paymaya-sdk/lib/PayMaya/API/Checkout.php(34): PayMaya\Core\CheckoutAPIManager-&gt;initiateCheckout(Array) #2 /storage/ssd4/275/12315275/public_html/paymaya/vendor/paymaya/paymaya-sdk/sample/Checkout/ItemCheckout.php(44): PayMaya\API\Checkout-&gt;execute() #3 {main} thrown in <b>/storage/ssd4/275/12315275/public_html/paymaya/vendor/paymaya/paymaya-sdk/lib/PayMaya/Core/HTTPConnection.php</b> on line <b>50</b><br />

PayMaya PHP SDK V2

Good Day,

Is your sample code or syntax for PayMaya PHP still working? because it seems outdated when I look at the syntax in your guide isn't?, because I'm looking for a code for how to write a Request to make a payment in PHP, this documentation("https://s3-us-west-2.amazonaws.com/developers.paymaya.com.pg/pay-by-paymaya/index.html#scan-dynamic-qr-payment-create-payment-post") just shows the header and the body of the Request but don't have a guide how to create a Request in PHP, could you help me where can I find a complete guide how to create a Request for create payment in PHP?

Not Production-Ready / SemVer compliance

Hi. I'd like to know when will this be ready for production use?

Thanks. Any response is much appreciated.

Also, I suggest you use SemVer (as composer recommends) for your release version pattern.

Undefined index: paymentType

I have followed the example given, when I try to retrieve checkout method it gives me an error of Undefined index: paymentType. what would I do?

psr/log version depedency locked only on 1.0.0

Request:

psr/log : 1.0.0 - psr/log : ~1.0

It would be nice you can adjust psr/log dependency to support version > 1.0,
at least to update composer.json to require ~1.0.

I encountered this dependency version conflict on laravel5.4 as all module requires ~1.0. (1.0.2 specifically) and the sdk is trying to install 1.0.0 version.

 Problem 1
    - Can only install one of: psr/log[1.0.0, 1.0.2]. <-- trying to install two version 
    - Can only install one of: psr/log[1.0.2, 1.0.0].
    - Can only install one of: psr/log[1.0.0, 1.0.2].
    - paymaya/paymaya-sdk 0.0.1 requires psr/log 1.0.0 -> satisfiable by psr/log[1.0.0].
    - Installation request for paymaya/paymaya-sdk * -> satisfiable by paymaya/paymaya-sdk[0.0.1].
    - Installation request for psr/log (locked at 1.0.2, required as ^1.0) -> satisfiable by psr/log[1.0.2].

Inline documentation

It would be better to have inline doc blocks for API documentation. I'll contribute along the way once I figure out how to use the SDK. Very promising.

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.