Skip to content

Undefined Index voidStatus, metadata #9

Description

@zent-lim

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":"test@paymaya.com",
"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":"paymayabuyer1@gmail.com"
},
"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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions