forked from LiveCarta/PayPal-PHP-SDK
Functional Tests Improvements and Refactoring
- Updated Functional Tests to refactor common code in one file - Re-sets the credentials to make sure previous tests doesnt change it for testing
This commit is contained in:
@@ -24,6 +24,18 @@ when the user is redirected from paypal back to your site</p></div></div><div cl
|
||||
|
||||
ResultPrinter::printResult(<span class="hljs-string">"Executed Payment"</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-variable">$payment</span>->getId(), <span class="hljs-variable">$execution</span>, <span class="hljs-variable">$result</span>);
|
||||
|
||||
<span class="hljs-keyword">try</span> {
|
||||
<span class="hljs-variable">$payment</span> = Payment::get(<span class="hljs-variable">$paymentId</span>, <span class="hljs-variable">$apiContext</span>);
|
||||
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) {
|
||||
ResultPrinter::printError(<span class="hljs-string">"Get Payment"</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
|
||||
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
|
||||
}
|
||||
|
||||
ResultPrinter::printResult(<span class="hljs-string">"Get Payment"</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-variable">$payment</span>->getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$payment</span>);
|
||||
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-variable">$payment</span>;
|
||||
|
||||
|
||||
} <span class="hljs-keyword">else</span> {
|
||||
ResultPrinter::printResult(<span class="hljs-string">"User Cancelled the Approval"</span>, <span class="hljs-keyword">null</span>);
|
||||
}</div></div></div></div></body></html>
|
||||
Reference in New Issue
Block a user