Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Exception when trying to apply Credit Card Payment to Sales Receipt #517

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Serfe-com
Copy link

This MR fixes the issue that prevents the CC payment on sale receipt conversion which triggers #275.

Use SalesReceiptCCPayment instead of CreditCardPayment to avoid the mapping.

To make this work use the following structure:

$salesReceiptObj = SalesReceipt::create([
            "CustomerRef" => [
                "value" => $customerRequestObj->Id,
            ],
            "BillEmail" => [
                "Address" => $billingEmail,
            ],
            "Line" => [[
                "Id" => "1",
                "LineNum" => 1,
                "Description" => "Pest Control Services",
                "Amount" => 35.0,
                "DetailType" => "SalesItemLineDetail",
                "SalesItemLineDetail" => [
                    "ItemRef" => [
                        "value" => "1",
                        "name" => "Pest Control",
                    ],
                    "UnitPrice" => 35,
                    "Qty" => 1,
                    "TaxCodeRef" => [
                        "value" => "NON",
                    ],
                ],
            ]],
            "PaymentType" => "CreditCard",
            "SalesReceiptCCPayment" => [
                "CreditChargeInfo" => [
                    "ProcessPayment" => true,
                ],
                "CreditChargeResponse" => [
                    "CCTransId" => "E2XT5I2FFZGS"
                ]
            ],
            "TxnSource" => "IntuitPayment",
        ]);

We avoid the mapping from CreditCardPayment to BillPaymentCreditCard with this.

We don't know if removing the mapping might affect this, so we added this to conserve backward compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant